MyAmp RaspberryPi MusicBox

So this is going to be a writeup on how I put a RaspberryPi 2 inside a MyAmp portable speaker.

I’ve had this amp for about a year now and have not really used it that much. It has been sitting on my desk at work collecting dust. So I started thinking that I could get better use out of it by

connecting my RaspberryPi and stream internet radio through it. Then I thought it would look better if I just took apart the speaker and shoved the Pi in, only exposing the necessary ports needed to make it work. I originally planned to have a RaspberryPi Model B run the entire setup, but with the way the SD card stuck out from the Pi and the way the power connector was positioned, it was just a little too big to fit inside the MyAmp case. I also needed room to connect the ethernet extender I was going to make and the audio plug. So I purchased the more up-to-date RaspberryPi 2 Model B. Having the MicroSD slot and the MicroUSB power in a different orientation made it easier for everything to fit. As I started planning on how to get everything to work, I found a nice linux distribution call Pi MusicBox. It does everything I was looking to do with this little speaker. The only issue that came up was how was I going to find out what the IP of the computer was going to be once it booted up. I remembered that a while ago, I purchased a SparkFun Serial Enabled LCD (5V version) to use with my Arduino. After some research, I found code that someone wrote in Python that pretty much does what I was looking to do.

So I installed Pi MusicBox to a MicroSD card and connected the LCD to the RaspberryPi headers and started getting everything to work. I created a fork of the serialLCD code I found on github beause I wanted to show the IP of the Pi and the currently playing song. You can find my fork of the project here. (Maybe I can update this section to better describe what coding changes I had to do on the Pi and the serialLCD code to get everything working.)

Now that I had a working software solution, I had to figure out how to get the Pi inside the case and extend the necessary ports to plug in the power, LCD and ethernet. After unscrewing the MyAmp and taking everything out, I used a dremel to remove the battery casing on the amp. I made sure that I didn’t take too much material off so that I can still use the battery cover. You also will need to remove the USB plug and the plastic extensions used to screw it to the case. (I ended up replacing this with a USB extension I made to be able to plug in USB sticks with music on it.) Also, the speaker had some foam material on the back of it that I had to remove.

Now I needed to plan on where to make some holes in the speaker for the LCD, ethernet port and USB power supply. I drilled a hole in the top of the MyAmp so that I can mount the LCD panel. This was easy to do but it does not look too good. Maybe I will see if I can make the hole bigger and mount the LCD from the inside of the case. I don’t know if it will fit with the way the serial board is mounted to the bottom of the LCD itself. Maybe I will have to separate them. Since it is using the serial board, I only had to connect 3 wires to the Pi. (5V, Ground, and TXD0)

For the ethernet port, I had some extra adapters from when I was wiring my house with cat5 and made a hole in the battery cover and super glued the plug to the battery cover. Then it just took making a very short cable to plug in my extension to the Pi ethernet adapter.

For the power supply cable, I just made cuts in the battery cover so that I could string it through the bottom. Make sure to tie a knot on the cord so that it can stay inside the amp. That way, you could pull the cord and not worry about it coming out of the Pi.

Remember that USB power adapter we removed earlier. Late in putting everything together, I thought it would be cool to connect a USB stick and play music off of this. I ended up making my own USB extension that took up a little less space than the one already in the MyAmp. I also super glued this to the existing hole in the bottom of the case.

The final thing was to wire everything up. I ended up removing the MyAmp input port and replaced it with a 3.5 mm jack so I can just plug that into the Pi audio port. I also wanted the power switch on the front of the MyAmp to turn on/off the Pi. Doing this meant that I needed to cut into the USB power cable and splice in the power switch or power the RaspberryPi via the GPIO headers.

WARNING – Doing this could end up frying your RaspberryPi.

I decided to power via the GPIO headers , using pins 2 and 6, and followed this tutorial to get it working. Then I had to power both the MyAmp and LCD with the one left over 5V pin. (Pin 4) Don’t know if you can do this, but I just made my own pin connector that gave power to both of them. I haven’t had any issues but I can’t guarantee that it won’t mess anything up. Maybe it would be better to get the 3.3V version of the Serial Enabled LCD and wire it up to pin 1 or 17.

Everything seems to work great and I’m pretty happy with it. I made a short video of the finished product. If I had been thinking, I would have taken pictures of the entire process. Maybe when I have time, I can take everything apart and take pictures. Until then, you can enjoy the video at the top of this post.

3 Comments

    1. I didn’t update the WTP plugin to work with jetty9. I switched over to using maven for our web development and now use the jetty maven plugin. Easier to work with than the previous WTP plugin.

Comments are closed.