Adding Audio Output To The Raspberry Pi Zero – Tinkernut Workbench


The Raspberry Pi Zero W is an amazing miniature computer piece of technology. I want to turn it into an epic portable Spotify radio that displays visuals such as Album Art. So in this new series called “Tinkernut Workbench”, I show you step by step what it takes to build a product from the ground up.

The first biggest hurdle to overcome is the fact that the Pi Zero (at least at the time of this post) doesn’t have audio output. There are a few different ways to get around that.

  1. Split out the audio from the HDMI output
  2. Purchase a digital audio extension: Adafruit MAX98357 or Pi Zero “hat” extension
  3. Make a simple circuit to extract audio from the GPIO pins

If you go with option 1 or 2, you can skip to step 5, but if you want to make your own custom audio output, continue reading. The Adafruit blog has a fantastic guide for how to make your own PWM audio adapter. And it’s actually surprisingly easy…if you’re not afraid of a soldering iron. The basic idea is to force the audio through the GPIO pins of the raspberry pi. In this case, it’s pins 18 and 13 (and ground). You can see a schematic below for what I’m going to try and accomplish.

And here’s the parts it requiers:

  1. 2 x 10 µF capacitors
  2. 2 x 0.33 or 0.01 capacitors
  3. 2 x 270 Ohm resistors
  4. 2 x 150 Ohm resistors
  5. Female 3.5mm audio jack

I was able to arrange the components on a bread board and then hooked up a pair of powered speakers for testing.

So to see if this micro-contraption works, we need to tweak the raspberry pi software a little bit. Since we enabled SSH on the raspberry pi, we can login into it remotely from a different computer. On Linux and Mac, you can open up a terminal and just type “ssh pi@192.168.###.###” (replacing # with the static IP you set) and login with your password. On Windows, you’ll need a third party SSH tool. I’m fond of Putty for Windows. Download and install it, then set up a new SSH connection pointing to your Pi’s static IP. Then just login with your password.

We have to tell the Pi to force audio to the PWM pins (Pins 18 and 13), and there are several different methods of doing this, but one of the simplest ways I found was to add a line to the configtxt file:

  • sudo nano /boot/config.txt
  • #add to bottom of file
  • ctrl X (to exit) Y (to confirm save)
  • sudo reboot

After rebooting, I now need to force the Raspberry Pi’s audio through the PWM channel. So after reconnecting to the Pi through SSH, type “sudo raspi-config” and go to 7. Advanced Options > A4 Audio > 1 Force 3.5mm. Then save and exit. With the powered speakers on and plugged into the breadboard, and the breadboard plugged into the Raspberry Pi, I can test it all out by playing some audio using this command:

  • aplay /usr/share/sounds/alsa/Front_Center.wav

If you can hear audio then everything’s working correctly and we can move everything from the breadboard to a nice, compact circuit board! To make it easy to connect the circuit board to the Pi Zero, I turned the Pi Zero off, disconnected everything, and soldered some header pins to each of the pin ports. Then on the circuit board, I soldered some female header pins so that they could fit together easily. From there I soldered on all my components, fired the Pi back up, and tested it out again to make sure it still worked. Looking good! Now for the Amp!

Comments Show: How To Make A Motion Detecting CCTV – Part1

Comments Show

Homemade Levitation Machine

Can you use App specific passwords? Is there a more secure way to store passwords? Can you use this to make a Portal Turret? I’ll answer these comments and more!

Homemade Motion Detecting CCTV – Part1: Software

Important Links:


Comments Show: How To Make A Basic Email Server

Comments Show

Homemade Levitation Machine

What if my port 25 is blocked? Is the Email server safe? What if my IP address changes? In this video I’ll answer these comments and more from my latest tutorial: How to Make A Basic Email Server

How to Make A Basic Email Server

Important Links:


No Video This Week Due To Computer Crash

Computer Crash


No Video This Week

This hasn’t been the best week for me. On top of the blizzard that hit the Northeastern US that kept me stranded for 3 days, my computer has now crashed and has been sent off for repairs. I should have it back by Monday, but at the moment, I have no computer to edit together my comments show. I f nothing else goes wrong (fingers crossed), it’ll be up next weekend.


Let Me Promote You!

I’m attempting to give you guys a chance to show me your best videos and I’ll promote them on my website. Check out to find out all about it.