Music Box With RPI and Volumio
by Schermpje in Circuits > Raspberry Pi
3212 Views, 7 Favorites, 0 Comments
Music Box With RPI and Volumio
This is a small personal victory for me, as I'm only just beginning to tinker with the Raspberry Pi system.
I wanted to start small (literally) and create a small portable but powerful music player.
Of course, I could just BUY one... but where's the fun in that I ask you.
At first I tried Kodi, but that's more for video than music, and played with RuneAudio which didn't see my usb audio card and finally settled on Volumio. Same basics as RuneAudio but Volumio did see and could use my usb audio card.
So... I present to you all.. a.. well... a music box *tadaaaa*
As you can see, it's really quite small, the box is only 17x10x8 cm and made of light solid wood.
I bought it at the local hobby shop for 9.99 (it came with a second even smaller one inside).
What else... a usb cable with a 90 degree angle micro port (otherwise it didn't fit)
The smallest switch I could find and a powerbank.
The speakers where the toughest challenge really. They had to be small but powerful, lightweight but with a full sound range.
I ended up skinning an old and broken laptop which had a JBL speaker system which I always found to sound quite good for a laptop. (I also saved the screen and keypad and some other part for future projects)
So.. that's it really...
Ready?... let's get going! Step one is up first, getting things together.
Step One, Getting the Things You Want (or Need)
First of all (obviously) a Raspberry Pi, I'm using a version 3 b+, I bought mine via a online store 40 euro's with shipping. I'm confident that other version work just as well, probably just need a different image of Volumio and a wifi extension. Also, a SD card for the Volumio image.
Second, a box, or container, lunchbox, candy tin, a piece of folded metal.. anything you like to use a the container for the finished music box.
Third, a power-source. I'm using a Powerbank, it's a nice and compact but powerful one by Xtorm, it gives me 5000mAh at 2A's... plenty to keep the Pi pumping out tunes for a couple of hours!
Forth, a usb cable. I needed one that could fit next to the Pi in the box, finally found one with a 90 degree angle on the micro side. I then cut the thing into smaller pieces and solder a small switch in there so I don't have to remove the cable when it's not in use. (not really a necessity, but I wanted one anyhow)
Fifth, a switch, I suppose any will do, small or big, just the one you want to use really
Sixth, speakers. Now this is a tricky thing. Due to the lack of space you can't really take big powerful speaker and stick them in the box, not if you want to keep it small. After some searching and thinking I took the speakers (with sub :D ) from an old and broken laptop. They are made (so the laptop claims) by JBL and they sound great! Especially for their size!
Seventh, let me see now... oh yes, a proper sound output source. The Pi has a jack audio out, but the quality and volume is nowhere close to what I wanted or needed, it just so happend that I owned a small USB audio card plug and play thingy that Volumio is nice enough to recognize.
Eighth, Optional again, a usb stick with music. I canalized an old 32gb usb stick down to the bear minimum so I can always have a bit of sound when there is no wifi and I can't use Spotify (works with Volumio, you need a Prem account)
Ninth, a soldering kit, patience, internet connection, some basic electronic skills and all the imagination you can muster. I also used a hot glue gun and some sticks to keep the powerbank in place as seen in the picture.
Tenth, well, not really, but I forgot to mention this earlier, an (old) 3.5mm audio jack cable. Like the ones used by headphones and the like. Mine came from jack to tulip audio cable.
Next up... Volumio installation!
Step Two, Volumio Installation
Well, most of you know how to get an image on a sd card an plug it into the Pi, so I'm gonna skip the banter and just give the link for the Volumio site :)
https://volumio.org/get-started
They explain exactly what and when to do what is needed, better than I can.
Next up, wire management
Step Three, Wire Management
As you can guess, wires get in the way of everything, especially in a small box the this one!
So, make em smaller! Cut the buggers down to size. That'll teach em!
But on a more serious note, the audio cable I used was about a mile long.
The usb cable was 2 meters.
Not really useful as you can guess.
So, I googled; how to wire a speaker to an audio jack cable and google presented me with the following link:
https://www.instructables.com/id/How-to-wire-a-spe...
And that worked!, so thank you MazdaSpeedProduction.
I did also watched a few youtube vids, just to be sure :)
I didn't remember to take a picture of the mess of wire I ended up with, sorry about that. But it's really easy, just really fiddly, they are really small wires.
The same goes for the usb cable. Waaaaay to long, needed a trim (and a switch).
So, I asked google how to shorten a usb cable and it gave me a lot of answers. Basically there are 4 wires inside a usb cable, a green, white, black and red one. Green and white are for data (not used), back and red are load and ground.
Cut the cable to the desired length (add a bit just to be sure and give yerself a little wiggle room).
Connect one end of the red wire to one of the poles on your switch (google your switch to know which one) and the other red one to a different pole. TEST the connection and switch functionality before you attack with the soldering iron. Learn from my mistake ;).
Right, solder the bits to the switch.
Solder the black ends together.
Now, the speakers, mine are really nice and small and (luckily) fit perfectly in the box.
Drill a bunch of holes in the side and bottom where you want the speakers to blast their tune out.
Remember not to overdo the holes as this will undo the strength of the wood and it might give way.
This part of the step is really dependent on the type and size of the speakers you are going to use.
I just used a few screws to attach them to the inside of the box and dribbled some hot glue on the sub's sides to keep it in place.
So, see if everything fits nicely in the box, find out the wires are the wrong way around, take it apart and start again.
Or, if you're not me and you think things trough more than me, on to the next step, getting sound out of Pi!
Step Four, Getting Sound Out of a RPi
If everything went according to plan, you should now have a box, a few wired speakers a power source and a box.
On the RPI the image of Volumio does it's thing and via the Web IU we need to tell the PI to suck it!, we're gonna use an usb sound card
Plug in the USB Sound Card. Perhaps an usb stick with some tunes and then let's power this sound beast up!
Open the menu that give access to playback options, select USB: set (or your equivalent that shows) and click save. Volumio will tell you it's successfully switched to the usb sound card and you can now test the sound!
Using the interface, play a song. Or don't, really up to you, but it would be a shame to let the work go to waste...
But hey, I'm not judging!
On to... step five! Finalizing!
Step Five, Finalising
Right... well, that's about it really..
I'm also working on a bigger version (bigger is better right :D ) using a piano 2.1 HAT and a Allo Volt Amp.
I know they work (the sound is really incredible for such small devices) and will perhaps share that one as well... we'll see ^^ (I might forget half way through)
It will at least have 12v power source so I can use it as a (kinda) portable sound chest. Still working some of the logistics out.
Enjoy, paint your box, build another one, break it down and start again... what ever tickles yer fancy (great expression).
Collection of links for some of the products used:
https://www.xtorm.eu/ (powerbank)
https://volumio.org/get-started (ice cream store)
https://www.pipoos.com/ (the hobby store)
https://www.sossolutions.nl/ (my Pi provider)
http://www.radiopiet.nl/ (my supplier of odds and ends)
Hoped you liked my project, it was fun to build, thanks to the other people who post projects on this site, you give me hope and inspiration to build things and fail and have lot's of fun :D
If I forgot something, or you just want me to stop this insisted typing... drop me a line, I'll try to be brief in answer (no promises) (this was my first project btw)
Cheers!