How to turn a Wi-Fi router into a Wi-Fi radio for good

The project:

Are you hooked on to the concept of Internet radio? As a music lover you must have heard about Desktop Wi-Fi radio which provides you with your favourite radio stations even without that bulky computer. But what worries a customer usually is the price tag that this product is accompanied with. Well, it might be hard to believe but your Wi-Fi router can serve the function and purpose of a Wi-Fi radio. The following Do it yourself project would help you convert your affordable Wi-Fi router into a Wi-Fi radio.

wi fi radio
wi fi radio

Difficulty Level:

Handling your Wi-Fi router and undertaking the project to successfully make it functional as a Wi-Fi radio is a 'moderately challenging' project and might also ask for expertise in certain steps of the project.

Resources Required:

The basic components that you would require to start with the project are an ASUS WL-520gu wireless router, RS232 USB converter and a USB sound device. You might require other components too but these are the basic components to get you going.

Instructions:

Step 1:

The primary step would include counting and getting together all the technological components. As you would have figured out ASUS WL-520gu wireless router would be the main component as it would enable Internet connection and also play music. Secondly, a RS232 USB converter would be required to hack the router. The USB converter should be a 3.3V version. If you have some loose wires lying around then they can be of good use. In case, you cannot get handy of loose wires, you can always buy converter cables.

In case, you are wondering what are we going to do with USB sound device. You can play around with SB0270 external sound card device or you can go around and shop for other inexpensive sound devices.

If you still cannot figure out which one would actually work, don't worry as you have help at hand. Just log on to www.mightyohm.com and spot the list of devices that would be compatible for the same.

hacking the asus router
hacking the asus router

Step 2:

This step would involve taking the control of the radio through an external mpd client. An interface would also be required to access the player while still testing it but that would be undertaken in the next step and should not be much of a rocket science.

As you would have guessed, after installing the program, the next step would be to set up a connection. This is where the the router comes into play. This would be done by adding your router's IP address and port 6600 through the host. Clicking the connect button shall make it possible now to control your radio from your computer.

step2
step2

Step 3:

Now comes building up of interface. This step would be carried out on a veroboard or you can also do with one of your own PCB creations. Just follow these simple steps to successfully build up an interface: start with connecting the LCD to the micro controller. Then proceed by establishing a connection between DS1307 to the micro controller. Further, the micro controller needs to be connected to the rotary encoder. Finally, connect the micro controller to RS232 – the sound device - pins on the router to wrap up this step.

step3
step3

Step 4:

To make the music sound good to your ears, you would need to adjust the baud rate and echo. So, just before starting to communicate to the router, this has to be taken care of. The baud rate of the router measures at 115200. The most suitable level would be 9600. Echo needs to be controlled too as whatever message is sent across to the router would be echoed back. This would troubleshoot the Uart-Buffer and therefore the echo needs to be switched off.

Step 5:

This step involves making communication with the router which may seem difficult to begin with but as we noted before it isn't a rocket science. Initially, there is a need to jot down all the primary functions that you would want your Wi-Fi radio to perform. The basic radio functions well with the simple commands of play,pause, stop and change station. These commands can be read in mpc commands as mpc play for command for play, mpc stop for command to stop, mpc pause for command to pause and finally mpc change station for command to change station.

Step 6:

In case you are wondering about the input part, fix your eyes on the rotary encoder as this would be serving the function of all input in this project. The rotary encoder resembles the mouse wheel we bring into use while working on a computer. The only difference is that the mouse wheel is an optical encoder.

The rotary encoder would be there on channel A and B attached with one common pin which can further be connected to either GND or Vcc. We will carry on by attaching it to GND as we are utilising it with interrupts. The reading of the encoder's movement would happen by reading the patter of Channel A and B. Channel A and B would have fixed patterns while opening and closing. With the addition of one channel and interrupt, it becomes possible to enable read subroutine automatically when the encoder moves.

step6
step6

Step 7:

While we have graphical LCD handy, it is always a good idea to have some graphics working for you while the music is played. There are two ways that lead to this end results, either draw your own graphics or rely on pre made graphics.

In case, you have decided to make your own cool graphics, we have a way out for you. For this you would require Bascom program. Take the first step by drawing up an image of size not exceeding 240*128 and proceed to save it as a monochrome bitmap. Then proceed to the tool-bar and select

Tools > Graphic converter. This would open up a window where you would type in your LCD dimensions, load your image and save it as .bgf format. Do make note of the font you are using. As the conversion part is over, it can be made use of with the code. Though, inclusion of bgf file is a must to make it working.

step7
step7

Frequently asked Questions:

Q: What are the options available in hand to make the sound audible?

Ans: There are two ways out to make the sound audible, the first includes the very obvious use of external amplifier. The second would be making own amplifier or bringing into use internal amplifier. In case of internal amplifier, speakers would be must.

Quick tips:

Looking at the Wi-Fi router, you can impressively come to a conclusion that the maker of the router has not only taken care of the internal components but also the external components. Wi-Fi router can help you save the pocket expenses for Wi-Fi radio by playing the multiple role of Wi-Fi router and radio.

The primary component needed to undertake the project is the Wi-Fi router. Apart from this the making of the case would require a number of 18mm MDF. The make of the front and the back panel is alucobond which can be described as a sheet of polyethylene placed between two aluminium layers measuring 0.8mm

Things to watch out for:

The connections have to be taken care of in order to successfully execute the project. The RX need to be connected to TDX on the micro-controller and simultaneously TX needs to be connected to RDX. The baud-rate and echo of the Wi-Fi should be controlled so that the music quality is improved. Changing of the station is another issue to be looked after. In order to change the station the mpc address needs to be changed. This can be sorted out by pre loading all the stations onto the mpc beforehand only.

You might also like
© 2012, Instamedia. Some rights reserved. Powered by Instapress and Instacheckin.