Category Archives: Electronics

Building a Wifi Radio – Part 2, Choosing an Embedded Platform

This is the second part of an ongoing series about building a low cost, open source streaming internet radio.  if you haven’t already, check out part one for some background about the project.

Onward…

In part one, I discussed the merits of streaming internet radio and the motivations for my Wifi Radio project.  Now it’s time to start looking at what hardware can make this project a reality.  Before we get started, let’s review the requirements list from last time.

Requirements:

  • Wireless connectivity through existing Wifi network
  • Audio output (preferably 44kHz, 16 bit stereo)
  • An integrated amplifier and speaker(s)
  • Shoutcast/MP3 streaming audio decode
  • Several builtin station presets
  • A display to indicate the station and currently playing song
  • Simple user interface, using standard radio controls (volume, tune, etc)
  • 110VAC operation

There are two additional requirements that I implied in the first post but forgot to include explicitly:

  • Cheap, priced below a commercial streaming radio – target < $100.
  • Small size so it can be portable (no desktop PC’s allowed!)

Selecting the hardware:

How do these requirements translate into hardware?  Let’s take a stab at what features we’d like in an embedded platform.

  • A wireless interface
  • Audio output
  • Sufficient system resources (CPU, memory, etc.) to decode MP3s
  • Some extra IO for a control panel and display
  • Low cost
  • Small size
  • Ease of development

The size and cost aspects pushed me towards an embedded system instead of a small form factor PC like any of Shuttle’s XPC offerings or a nano-ITX board.  To me, “Ease of development” equals Linux, so I wanted something well supported by Linux and an active open source development community.

There are quite a few embedded Linux platforms out there, with a wide variety of prices and features.  I looked at a few of them, including:

  • The Tin Can Tools Hammer – very impressive ARM9-based board with USB, lots of RAM and flash, lots of IO, and best of all the footprint of a 40-pin DIP package (breadboard compatible!).  No wireless and relatively steep pricetag ($160).


  • TI‘s Beagle Board – Incredible featureset including DVI output and a 600MHz ARM Cortex core.  No wireless and price is stunning for what you get, but overkill for this project ($150).  (Must keep in mind for future projects!)


    ASUS WL-520gU Wireless Router

  • Consumer wireless routers like the Asus WL-500gP v2 and WL-520GU – builtin wireless (yay!), USB, 240MHz Broadcom 5354 core, decent RAM and flash, cheap. Newegg has the WL-520GU for an incredible $26 after rebate (normally $50). The higher end WL-500g has more memory and flash and an integrated USB 2.0 hub (2 external ports).  Newegg has the WL-500g Premium V2 for $50 after rebate (normally $80). Both versions are a steal for what you get.

Tiny, under $50 and with built-in wireless, the Asus WL-520GU is the clear winner for this project.  The downside?  Since this router was never intended to do anything other than, well, route, we’re going to have to crack it open, modify it, and void the warranty.  In addition, there is no tech support and we’re going to have to spend some extra time hacking around to get it to do what we want.

Here it is in all it’s glory:

Asus WL-520GU Wireless Router Asus WL-520GU Wireless Router

Here’s a sneak peak of the inside:

Asus WL-520GU Wireless Router Asus WL-520GU Wireless Router

This router is supported by OpenWRT, an open source Linux distribution for small embedded devices.  Ignore the work-in-progress designation, it works, trust me!

Although the router lacks builtin audio, that is easily solved with an $8 SYBA SD-CM-UAUD USB Stereo Audio Adapter. There have been reports that the WL-520GU only supports USB 1.1 reliably, but USB audio doesn’t require USB 2.0 so it’s not an issue for us.  For full USB 2.0 support, look at the WL-500gP v2 instead.

So far we have $58 into the project ($38 if you are lucky enough to get the rebate) and we have an embedded Linux computer, a wireless interface, and an audio output.  Not bad!

That’s it for part two!  In part three I’ll install a serial port on the router and get ready to reflash the stock firmware with OpenWrt.  At that point we’ll be able to start listening to some tunes!

Update: I posted detailed specs for the WL-520GU and a couple more photos here.

Update 2: I posted some images of the $8 USB-Audio Adapter I am using as well.

Update 3: Part three is now available.

Update 4: There is a new Wifi Radio Discussion Forum, hop over there to ask questions about the project or see what other people are working on!  (4/12/09)

Building a Wifi Radio – Part 1, Introduction

This article is the first of a series that will document the development of a low cost, open source wireless streaming internet radio receiver.  All construction details, including schematics, source code, and even the design process itself will be documented on this blog.

Comments and (constructive) criticism are welcome. Click here to post a comment.

Table of Contents:

  1. Building a Wifi Radio – Part 1, Introduction (you are here)
  2. Building a Wifi Radio – Part 2, Choosing an Embedded Platform
  3. Building a Wifi Radio – Part 3, Hacking the Asus WL-520GU
  4. Building a Wifi Radio – Part 4, Installing OpenWrt
  5. Building a Wifi Radio – Part 5, Let’s Make Some Noise!
  6. Building a Wifi Radio – Part 6, A Conversation with Mpd
  7. Building a Wifi Radio – Part 7, Building an LCD Display
  8. Building a Wifi Radio – Part 8, Adding a Tuning Control
  9. Building a Wifi Radio – Part 9, A Few Odds and Ends
  10. Building a Wifi Radio – Part 10, Building the Box

Some background:

According to Wikipedia, in 1993 the first internet radio program began distribution.  At that time, radio programs were manually downloaded to be played later on the user’s home computer; the user experience was far from that of listening to a traditional broadcast radio receiver.  It was not until several years later that streaming radio became common, giving birth to internet radio stations that could be listened to much like traditional radio, but with several advantages.  Most notably, internet radio stations were (and still are for the most part) largely devoid of on-air advertising, and stations anywhere on the globe could be received by anyone with access to the internet.  Over time, improvements in audio compression (such as MP3) and larger end user bandwidth improved the fidelity and reliability of internet radio.  The birth of common standards like Shoutcast made it possible to listen to many stations with a single player program, like Winamp.

Today, most music playback software supports streaming radio in some way.  iTunes features thousands of streaming radio stations and even supports Shoutcast streams so that users can easily add additional stations of their own.

The beautiful thing about streaming radio is the huge diversity in programming that is available.  Many college radio stations have a streaming server, like KDVSDigitally Imported hosts many electronic and dance music streams that give the listener the choice to listen to specific genres like ambient or gabber hardcore (whoa).  Broadcast radio usually lumps all electronic dance music into one category, much to the dismay of their listeners (who probably tuned out during the commercial break, anyway).  Gems like Slay Radio specialize in music you would never hear on broadcast FM, like Commodore 64 remixes.

In the past couple years, products have started to appear that mimic the form and function of a traditional radio, but play internet radio instead.  Good examples of these are the Roku SoundbridgeRadio and the ASUS Internet Air.  Remote speaker devices, such as the Apple Airport Express, require a PC to receive and relay streaming radio but achieve a similar end result (but don’t really look much like a radio).

The Wifi Radio project:

I have been wanting to build a streaming radio for some time.  I frequently work in my garage, where I occasionally use my Macbook to play music through a small amplifier and bookshelf speakers.  The problem is that my laptop is not always set up in the garage, and greasy fingers are not a good thing to have around a white laptop, period.  I could simply buy an internet radio, but I couldn’t stomach the $150-$300 price tag on most players for such a luxury.

So I decided to build one instead.

I started the design process by drafting an outline of desired features, and then breaking them down into wants and needs, while trying to keep the project scope under control.

Requirements:

  • Wireless connectivity through existing Wifi network
  • Audio output (preferably 44kHz, 16 bit stereo)
  • An integrated amplifier and speaker(s)
  • Shoutcast/MP3 streaming audio decode
  • Several builtin station presets
  • A display to indicate the station and currently playing song
  • Simple user interface, using standard radio controls (volume, tune, etc)
  • 110VAC operation

Optional features:

  • Line output (to connect to a receiver/amplifier)
  • Web server for configuration/management
  • Ability to play files off a USB stick or iTunes server

Definitely won’t be a feature:

  • Any kind of over-the-air radio tuner
  • Commercials
  • Pledge season
  • Morning DJ’s
  • “Blah, blah, blah.”

Now that we’ve defined the project…  it’s time for a commercial break.  That’s it for part 1 of this series.  Stay tuned for part 2, where I’ll talk about choosing an embedded platform for the design and why Linux is so awesome!

Update: Part two is now available, click here to see it!

Update 2: There is a new Wifi Radio Discussion Forum, hop over there to ask questions about the project or see what other people are working on!  (4/12/09)

Update 3 (6/1/09): I finally added a table of contents to the top of this post to help everyone (including me) navigate the series!

Coil in a can

Coil in a can

Last weekend at the Electronics Flea Market I picked up some very strange items, including this one, pictured above.  It’s a tin can that looks very similar to an ordinary soup can, except that it has the following markings on it:

R16-C-28604-15
COIL
QTY.1

NSC.OAKLAND JULY 1953
PRES METH. 2D

Thus far the only information I have learned from the markings are that NSC.OAKLAND stands for the former Oakland Naval Supply Center, closed a decade ago in 1998.  According to Wikipedia, NSC supplied components to the fleet in the Pacific during WWII.  Beyond this I have not been able to find any information.  Presumably this is a replacement part for some piece of obsolete military hardware.  A “coil” is another name for an inductor, a clue that this may be part of a radio system or other high frequency equipment.

After staring at this mysterious object for almost forever (a week) I decided to open it.  Realizing that the can could be full of cold war era hazardous chemicals, munitions, objects under high compression, or nasty sharp edges, I did this very carefully and documented the entire process of discovering the contents.

First, the obvious – opening the can.  Pretty straightforward.

Coil in a can

What’s inside?

Coil in a can

Weird.  Lots of oiled green paper.  Whatever is inside is packed very well, when the can is shaken nothing moves around.

This is the clump of stuff to come out.

Coil in a can

Packing material?  The precursor to styrofoam peanuts?

Below the packing material…

Coil in a can

What’s this?  Vintage dessicant!!!

The last object left in the can looks interesting.  It’s wrapped in oiled green paper and sealed with tape.

Coil in a can

Inside the paper we find this:

Coil in a can

Not a huge surprise – it’s a coil (inductor).  It has a knob or grabby thing on the top and a funny connector on the bottom.  It looks brand new.

Here are a few more pictures.

Coil in a can Coil in a can Coil in a can Coil in a can

The markings are “ARC” and “7270 239 KC”.  ARC might be American Radio Corporation?  239 might be 239 kHz (kilocycles)?  Hard to say, google didn’t turn up anythign interesting.

An impressive amount of stuff was packed into that can!

Coil in a can

This solves the mystery of what’s in the can, but what is it for?  Does anyone know?  I’d love to find out – leave a comment or contact me directly.