Cup o’ Sound – Audio Playback Coffee Cup
Bring the productive bustle of ambient coffee shop sounds with you anywhere by building a white noise machine in a cup! This project uses the Adafruit Audio FX Board to play a 30-minute audio file on repeat. The circuit is battery-powered with the help of a lipoly backpack, which also allows for convenient recharging over USB and the easy addition of a power switch. A speaker rests inside the lip of the cup, driven by a class D audio amplifier using a 10K potentiometer for volume control.
The Cup o’ Sound requires no programming and is excellent for practicing your through-hole and free-wire soldering skills. The result is a satisfyingly compact handful of portable sound that can be reused in many contexts or rewired to act as a speaker alone.
Before you begin, familiarize yourself with the following guides:
- Adafruit Guide to Excellent Soldering
- Adafruit Audio FX Sound Board
- Adafruit Pro Trinket LiPoly/LiIon Backpack
For this project, you will need:
- 16MB Audio FX Board
- half-size Perma-Proto board
- Adafruit Lipoly Backpack
- Adafruit Mono 2.5W Class D Audio Amplifier – PAM8302
- lipoly battery
- illuminated on/off button
- 10K potentiometer*
- button quick-connect wires (optional but handy)
- stranded wire in various colors
- paper coffee cup with lid
- pliers and soldering tools
- heat shrink tubing
- craft or utility knife
*Yes, I realize this is a linear taper pot. If you’ve got a logarithmic one, feel free to use that!
The lipoly backpack sits atop the audio FX board with the provided headers. Other connections as follows:
- trigger pin 2 -> GND
- potentiometer first leg -> GND
- potentiometer second leg -> audio board R
- potentiometer third leg -> amp A+
- amp A- -> GND
- amp Vin -> 5V
- amp GND -> GND
- switch leads to lipoly backpack (after cutting connecting trace)
- switch LED + -> 220 ohm resistor -> 5V
- switch LED – -> GND
- amp outputs to speaker
Load Sound and Prepare Components
First thing’s first– load some sound on your Audio FX Board! We’ve formatted a mono OGG file containing close to 30 minutes of coffee shop white noise:
Follow the Audio FX Board guide to transfer the sample file (or a file you make) to your device.
Next, it’s time to breadboard the circuit. We highly recommend grabbing two audio boards and saving one for breadboard prototyping. It saves a lot of time and frustration to work out a circuit on a solderless breadboard before soldering your components together. Ask us how we know!
Solder the headers and screw terminals onto your amp, and solder wires onto your speaker:
On the lipoly backpack, cut the trace connecting the switch pads, and solder two quick-connect wires in place. While you’re there, add a solder bridge to convert the charger to 500mA where marked.
Since the switch has to be installed from the outside of the cup, it’ll be hard to connect wires to it inside the cup. That’s where these arcade button quick-connects come in handy! See how they tightly grip the pins without any soldering? Cool. Take a good look now, since we can’t quite get our camera lens inside the cup to see them later:
Solder the lipoly backpack to the audio board with the included long headers. Trim the rest of your headers and solder them in place on the audio board. See how the lipoly backpack headers come up short on the underside? You may want to insert the headers from underneath the audio board if you want them to be the same depth as the others (for inserting into a solderless breadboard). This was the second board we assembled for this project, and in prep for the final circuit, the header depth discrepancy wasn’t a problem.
After prototyping, remove the potentiometer from the solderless breadboard and solder on three wires (with heat shrink tubing) to prepare for installing in the coffee cup.
Solder Circuit and Assemble
Position the audio board with the USB port at the edge of the Perma-Proto. Solder the leads in place:
Next add the amp as shown, and solder up the rest of the components according to the circuit diagram. Remember to use quick-connect wires for the LED inside the pushbutton.
Mark and cut a hole for the on/off switch at the base of the cup. Remove the switch’s screw-ring and install the switch, reattaching the screw-ring on the inside.
Likewise, make a hole for the volume adjustment knob at the side of the cup. The potentiometer attaches from the inside with a washer and nut on the outside, and the knob slips over from the outside.
Use a pair of pliers to bend the flanges on the speaker to achieve a good fit inside the coffee cup.
Enjoy your new ambient bliss. Power up and get cracking on your novel, or code up that new hot app!
You can optionally cut a hole in the base of the cup for USB recharging. Battery life will vary based on audio content and volume.