< Home
WiFi music player
I have had this project on the back burner for a quite a while. A while back I had acquired a Netgear media router and discovered that it was possible to install your own software on it. I like having music all round the house, so it seemed like a good plan to convert the router into a portable music player. The device had to be able to fullfill two main chores for me: 1) It needed to wirelessly play music from the internet on demand. 2) It needed to do this automatically at a certain time of day, like an alarm clock radio.
HARDWARE
The router
As I’ve already mentioned, the main part of the hardware is a Netgear WGT634U wireless media router [1]. This one in particular because it has a USB port, is reasonably fast and has a fair amount of memory available. I have a WPA2 encrypted wifi network, so it seemed to make sense that one that supported this in its original form would have the performance to playback MP3 wirelessly.
A USB sound card
We’ll use the USB socket on the router to output the sound. I’ve just got a completely generic USB sound card from EBay [2].
An LCD Display
I already had a basic backlit serial LCD kit which I had purchased from Robot Electronics [3]. I used this during development and testing, but for the final build I wanted something that looked a little better. I eventually settled on an 2×20 character OLED display[4]. With OLED, the individual pixels on the display are each illuminated, rather than the whole back panel behind the pixels of the LCD. This gives us two main advantages: 1) It will use much less power. The device will be on 24/7 so we don’t want lots of heat, or to ruin the environment. 2) It’s much easier to read the OLED in the dark, this is going to be an alarm clock after all.
SOFTWARE
For software i’ve used the OpenWRT project image for the WGT634U, this can be compiled with USB, USB sound card and MP3 playback support (MPD). On top of this i’ve written a bash script that runs as a service once the router is powered up. This script controls comparing the alarm setting with the current time and starting the radio. It also handles output of the current time and alarm setting to the display, together with track information during playback. The playlist and alarm settings are configured using a web page, which the router also accesses to update itself. When playback is started, automatically or manually, the playlist is downloaded as a list of URLs from the web server. The list is then fed into MPD which begins to queue and play the tracks.
HOUSING
To encase the unit I decided to use an old cassette player I had to hand. The wireless aerial has been fitted in place of the original radio aerial on the unit, and the OLED display slotted nicely into where cassettes used to be inserted. It has a speaker built into it already, so I wired a little switch socket into the unit that allows playback through this if headphones are not plugged in.
RESULTS
The alarm clock radio works nicely and the sound quality is quite reasonable. I needed to draw the line somewhere, but it’s plain to me now that there are many more side projects that i’ll be able to work on to improve this initial version. Volume control and a better quality speaker are a couple of the things i’d like to make better. It would also be good to be able to hook up to different kinds of audio source, such a playing music from last.fm or directly off a memory card plugged into the unit.
Acknowledgements, references and notes:
[1] Netgear WGT634U router
http://kbserver.netgear.com/products/WGT634U.asp
[2] USB Sound cards on EBay
http://shop.ebay.co.uk/?_from=R40&_trksid=m38&_nkw=usb+sound+card
[3] LCD Display and driver
http://www.robot-electronics.co.uk/htm/Lcd03tech.htm
[4] OLED Displays as an example (I got mine from EBay as well in the end)
http://www.ledsales.com.au/cart.php?target=product&product_id=208&category_id=6

