Pinterest Stumbleupon Whatsapp
Ads by Google

Have you ever wanted a speaker that could stream it’s own music? What about one that’s connected to Spotify, Google Music and SoundCloud? AirPlay support sound good? In this project I’ll show you how to get just that with an old speaker and a Raspberry Pi.

You’ll need basic electronics skills Beginner's Electronics: 10 Skills You Need to Know Beginner's Electronics: 10 Skills You Need to Know Many of us have never even touched a soldering iron - but making things can incredibly rewarding. Here's ten of the most basic DIY electronics skills to help you get started. Read More but otherwise it’s really easy to make.

We’ve said it time and time again at MakeUseOf. Raspberry Pis are awesome. I’ve made one into a media centre The Easiest Raspberry Pi Media Centre, With RasPlex The Easiest Raspberry Pi Media Centre, With RasPlex Read More , Christian turned his into a wireless printer Make Your Own Wireless Printer With A Raspberry Pi Make Your Own Wireless Printer With A Raspberry Pi Fewer cables, flexibility about where you can put your printer – wireless printing is a win-win. Unless you have an older printer. Raspberry Pi to the rescue! Read More and James used his to browse the Internet anonymously Build Your Own: Safeplug (Tor Proxy Box) Build Your Own: Safeplug (Tor Proxy Box) Why pay $50 for a Tor proxy box when you can make your own with a Raspberry Pi and USB WiFi dongle? Read More . This project is my favourite by far.

Step 1: What You Need

For this project you need a Raspberry Pi; preferably a B+ The Raspberry Pi B+ Is Here. What's Changed? The Raspberry Pi B+ Is Here. What's Changed? Read More but any model will do with a USB wireless dongle, a Micro USB power cable, a case and a MicroSD Card. I used this kit from Amazon.

You also need an old speaker. I used a Vantage guitar speaker with a built in amplifier that I had lying around. You can pick up similar models for about $50 but any old speaker should work. The Raspberry Pi’s sound output isn’t great so if the speakers don’t have a built in amplifier like mine did, you’ll need to add one to your Pi. I like this one from HiFiBerry although it doesn’t support the B+ yet.

You’ll also need:

  • An aux cable
  • A two-plug socket
  • A plug
  • Two metres of three-core cable
  • Insulating tape or heat shrink
  • Heavy duty mounting tape
  • Solder and a soldering iron
  • Various screwdrivers
  • Wire strippers
  • Clippers

Step 2: Flashing The Pi

Before starting with the build, it’s important to get the Raspberry Pi working properly. For this project I’m using Wouter van Wijk’s Pi MusicBox operating system.

Download and extract the .zip file from Wouter’s site.

There are many ways to flash — or install a disk image — on an SDCard for a Raspberry Pi. The GUI interfaces are easier but aren’t as surefire as doing it yourself via the command line. The Embedded Linux Wiki has a full guide on the different methods available for each platform. Follow the steps they provide. If one method doesn’t work, try another.

Once the MicroSD card is flashed, use Windows Explorer or Finder to navigate to the config folder and open settings.ini in a text editor.

Under Network Settings enter your WiFi details and save the file. You can also name your speaker; the default name is MusicBox but I called mine TheAmp. My first choice, TheAwesomeAmp was too long.

It’s possible to configure everything now but it’s easier to do it through the web interface.

Step 3: Configuring Pi MusicBox

Insert the MicroSD card into the Pi. Put some headphones in the audio-out port and connect it to the power. Wait about 90 seconds for it to fully boot up.

On your computer, point your browser to [speakername].local. In my case it’s theamp.local. If all went well, you should connect into the speaker through the Music Player Daemon (MPD) web interface. If it didn’t, get trouble shooting!

Open the settings menu and configure your services. You generally just need to add login details though for some, like SoundCloud, you’ll need to follow the steps they provide to get an authentication token.

If you are just using the Pi’s audio-out like me, under the Audio menu select Analog for Audio output.

Click Update settings and wait while the Pi restarts.

Reconnect using the web interface and, with the headphones in, play something. After a couple of seconds you should hear your chosen song.

The Pi is now ready so it’s time to set up the speaker.

Step 4: Disassemble the Speaker

Carefully disassemble the speaker. Take your time, take photos of where each screw goes and don’t break anything. The speaker I used was very easy to take apart. I disconnected the speaker from the amp, removed all the screws at the back then, holding the amp securely, unscrewed the top screws.

With all the screws removed, the amp and front plate could be pushed forward.

Step 5: Examine the Electronics

Before doing anything with an unfamiliar circuit, it’s important to work out what it does. It was easy to spot the auxiliary audio input on my amp because the exterior socket was clearly labeled. Yours might be a little harder to find. Originally, I’d planned to connect the Pi through a step-down transformer to the speaker’s mains connection. That wasn’t feasible because of how it was wired.

I decided to run the Pi and amp on separate power circuits. The Pi takes a while to boot up and draws very little power when not in use so I wanted it always on. The amp produces transformer hum when it’s connected to the power and not playing music so I wanted it easy to turn off. Examining the board helped me to make decisions about how to proceed.

Step 6: Connecting to the Input

Take your aux cable, cut off one end and strip a good portion of the remaining outer layer. There should be two cables inside wrapped in copper wire. You need to connect the two wires to the amps input and the copper wire to the metal case for grounding.

On my amp, the input socket had two wires that ran to the amp. I disconnected these wires at the input socket — I just clipped them off — and soldered the aux cable’s wires to them. I sealed the connection with insulation tape though heat shrink would also have worked. If there are two wires of the same colour, connect them together. They’ll usually be red.

I connected the copper wire to the case by making a loop, loosening a case screw, wrapping the wire loop around it and then tightening the screw again.

Step 7: Adding the Pi

It’s now time to add the Pi to the amp.

Run the power cable up through the same hole that the speaker output wires use.

Using a couple of strips of double sided mounting tape, attach the Pi to the amp case. Plug the power cable and aux input into the Pi before sticking it down. It’s easier than trying to connect them later. Position it so that it’s not interfering with any of the amps components or causing any shorts.

Double sided mounting tape is perfect for situations like this. The Pi is never likely to be under significant mechanical load. We just want it to stay where it is. Trying to mount it to a metal case any other way would be far more effort than it’s worth.

Step 8: Shorten the Power Cord

You’re going to add two plug sockets inside the speaker body so the amp doesn’t need a long power cord. Cut the cord down to about 15 or 30 centimetres. Reattach the plug to the now shortened cable. Be careful wiring the plug and follow a local guide.

Step 9: Make and Mount the Extension Cord

Connect the two-plug socket, 2 metres of three-core cable and plug together to form an extension cord. Again, be very careful to attach the correct wires to the correct pins.

Attach the two-plug socket to the side of the speaker casing using mounting tape. Make sure that everything else can be assembled around it.

Step 10: Reassemble the Speaker

Reverse the procedure from step 4. Carefully reassemble the speaker, this time with the Raspberry Pi wired into the amp’s input and housed inside its case.

Plug both the speaker and the Pi power leads into the two power sockets. Use cable ties to tidy up any excess wires.

Plug the extension cord into a mains outlet and wait for the Pi to boot up.

Step 11: Enjoy!

With the speaker plugged in and running, you’re able to control it from the web client. You should download a smartphone client like MPod for iOS or MPRemote for Android.

On iOS devices, the speaker should also appear under the Airplay menu. On Android you can use an app like AllStream Cast to enable it.

If you followed this build please share your results with me in the comments. Or, if you’re having any difficulties let me know.

  1. Kob
    January 5, 2015 at 12:09 pm

    How does the sound quality of the amp compare to a set of speakers with a sub-woofer?
    I have an old set of creative speakers that I want to use for a project like this but I want it to be a single unit. So using an amp would be much more convenient.

    • Harry
      January 20, 2015 at 10:00 am

      It sounds like a guitar amp so any good speakers will sound better, bad ones won't. It's also got a good kick to it! I'd open up your old speakers and see if there's space for a Pi!

  2. Joe Reid
    December 11, 2014 at 9:37 pm

    Nice build! Very neat, I'd like to try something similar in future. That airplay feature is really something! I didn't know that you could get it working via 3rd party apps.

    • Harry
      December 14, 2014 at 4:45 pm

      Thanks Joe!

  3. likefunbutnot
    December 11, 2014 at 3:27 pm

    Or you could, I don't know, buy a $12 bluetooth audio receiver and save yourself a lot of work.

    I have an Rpi with an attached NFC sensor set up so that if I bump my phone a certain on it a certain number of times in a 3-second period, it redirects audio to a different bluetooth output in my house. Ideally, I would rather have something that interactswith RFID so I could just have A/V follow me around, but I haven't gotten that far yet.

    • Harry
      December 14, 2014 at 4:45 pm

      You could but as I explained to Jeremiah the audio quality is lower over Bluetooth especially compared to the RPi streaming directly. Though that's sounds like a really awesome set up! Have you written it up anywhere?

  4. Jeremiah
    December 11, 2014 at 2:44 pm

    Wouldn't be easier to just use a Bluetooth receiver through the aux port with an adapter? O wait were would you put the raspberry pi? Great how to tho!

    • Harry
      December 14, 2014 at 4:43 pm

      Exactly Jeremiah! The Pi fits nicely inside! Also Bluetooth audio quality is lower than Airplay and much lower than using the RPi to stream from Spotify directly.

  5. Vampie
    December 11, 2014 at 12:45 pm

    Can you then actually transform the sound with the available settings from the amp? or is it just power on/off?

    • Harry
      December 11, 2014 at 2:18 pm

      Hey Vampie, all the EQ stuff works, even the overdrive! Gain and input level don't, they get bypassed with the soldering, but that's it.

Leave a Reply

Your email address will not be published. Required fields are marked *