Introduction: Digital FM Radio
Daniel Leiva Aragonés and Eric Pedrosa Montiel, students of 'Creative Electronics', a Beng Electronics
Engineering 4th year module at the University of Málaga, School of Telecommunications, we decide to make as final project a FM radio using Arduino Uno development board.
This radio will allow us the reception of FM frequencies that we want to tune, using for that the Si4703 FM receiver of Sparkfun (https://www.sparkfun.com/products/10663). It's going to have an attractive design thanks to José Andrés García, owner of a 3D printer.
Step 1: Materials and Tools
- 1x Breadboard (for prototype if you like)
- 1x Arduino Uno
- 1x Si470 FM receiver module: https://www.sparkfun.com/products/10663
- 1x old headphone (antenna)
- 1x double Jack plug
- 1x Jack connector
- 1x 4 digits 7 segment display
- 4x 330ohm resistors
- 3x linear potenciometers (value doesn't matter)
- 1x 8ohm and 0.5W speaker
- 1x LM386 Low voltage audio power amplifier
- 1x 220uF capacitor
- 1x 47nF capacitor
- 1x 10ohm resistor
- 1x 1k ohm resistor
- 1x 7.5k ohm resistor
- 1x 10k potenciometer (optional)
- 1x 9V battery
- 1x male power connector
- 1x female power connector with insertion detection (like on the images)
- 1x button
- A few meters of coloured cable
- Many single lined pinheaders (about forty)
- 3D printer white plastic compatible with the 3D printer (or other colour if you prefer)
- An 3D printer (or a friend with it)
- 3x trims for the potenciometers
Step 2: Display
We are going to use a common anode display, so we can't use a Max7219 LED Display Driver because it's already prepared for common cathode displays. We must do all the wire direct to Arduino.
Before that we must solder wires and pinheaders to the display pins and 330 ohm resistors on the digit pins. Like you can see on the lower image. The green wires are the upper pins of the display, there is a resistor for each digit pin D1, D2 and D3. The purple wires are the lower pins of the display, in this case we only need a resistor. Don't forget to look at the display image or a datasheet for get clear where's each segment an digit pin.
Finally, we're going to see how to connect the pinheaders to Arduino. See last image. This image correspond to the moment when we put the display in its place. Maybe you want to wait for the case before connect everything.
Note: I'm going to repeat this to much, change what you want. This is only a way to make this, there're many.
Step 3: FM Receiver Module Assembling
In the code we use pins A4 and A5 to communicate Arduino and the FM module. The digital pin 0 is used for RST pin of the module.
Solder male headers on the module carefully, don't create a shortcircuit. Then you can solder easily the wire you need on the male headers or soldering wire to a female header and connect the male and female headers, this last way allow you to change easier the module.
Ensure you that you connect correctly the 3.3V pin of the module on the 3.3V port of Arduino, and the same for GND pin. Later connect SDIO pin of the module on A4 pin of Arduino and SCLK pin on A5. To finish connect RST pin of the module on the digital pin 0 of Arduino.
Note: If you want to modify the code or create your own code you can change this assembling, except the 3.3V and GND unless you use a regulator.
Make a jack connector like on the image for audio output and connect to the amplifier when it's ready. Connect the double jack plug to the module, then connect the audio jack and the headphone jack like on the image. You can see that we cut off the speakers of the headphone, we don't need them, only we use it for antenna because the audio wire is too short and don't have good reception.
Step 4: Amplifier Assembling
Sorry for don't have a clear image of the final amplifier, it can be seen later on "Step X: All in place".
Well, the image is the design of amplifier extract of the LM386 audio amplifier datasheet. Using this image we're goint to explain how to make the amplifier.
Make sure you have all the components ready, you maybe want to test the amplifier on a breadboard before solder. Vin is the audio output from the FM module. See the black wire that connect to the green board. There are the audio signal (red) and ground (black).
First: If you use a 9V battery or 9V external voltage supply you can directly connect to the LM386 like indicate the design. Vs (battery +) on pin 6 and GND (battery -) on pin 4.
Second: Connect pin 2 to ground. Connect Vin to a potenciometer like on the image or, if you want my way, connect Vin to a 7.5k ohm resistor and connect the other end of the resistor on pin 3 of the LM386, then connect an 1k ohm resistor between pin 3 and ground (GND). This ensure that the final volume is loud enough. If you use the potenciometer change it value until you hear the sound well. But before you can hear something you must finnish the amplifier.
Third: You need two capacitors, one of them (220uF) is a electrolytic capacitor and you must connect the positive looking to the pin 5 of the LM386. The other is a ceramic capacitor (47nF). Connect the 47nF capacitor and the 10 ohm resistor like appear on the image. Then connect the 220uF capacitor (be careful with the polarity) on pin 5 of the LM386 and the positive of the speaker. And the negative of the speaker to ground (GND). Optionally you can make a connector for the speaker because it make easier to change the speaker in case it fail or break.
Step 5: Control With the Potenciometers
Solder each potenciometers like appear on the first image. Then solder it between them like in the second image and a male header to each signal (blue) wire. Paint a mark on the header of the potenciometer that will control the volume. The other two potenciometers will control the frequency. The middle one will set the fine frequency control and the other the large frequency control. The distribution will be this:
Left: Large frequency control potenciometer. (A0)
Middle: Fine frequency control potenciometer. (A1)
Right: Volume control potenciometer. (A2)
Finally connect 5V and GND to the respective port on Arduino.
Step 6: Power Supply and Arduino
Is a bit confusing the connection of the power supply. We'll try to explain.
The female power connector that I take on my hand have three legs, two for separate grounds an one for the supply. Identify each one before solder. Then solder the battery negative to the leg that is disconnected when you put a external power supply. Then solder the rest correctly. The positive of the battery will have the same way that the external positive, it's going to pass through the button and end on the male power connector. The male power connector have two wire going out to the amplifier, the positive and ground. The reason of that is that the amplifier needs at least 9V to work properly, otherwise it can't have a good gain. To finnish solder the negative of the female power connector to the male power connector.
Step 7: Software Development
We used open software libraries for the Arduino, for the FM receiver and the 7 segment display:
- SevSeg-master (link)
- Si4703_Breakout (link)
The code you must load is this: (codigo).
You can always improve the code or modify something you like, but be careful, the pins definitions for the 7 segment display it’s intended to work with the actual setup, if you change this then you must change the setup according to your new pins definitions.
Note: the range of frequency is set for the Spanish commercial FM, you may have to change it for your country.
Step 8: Building the Case With a 3D Printer
Not too much to say here. We upload the design on STL format. Download it and print the case. I hope that your result will be better than mine, the print fail on the final stage but we make a quick cover with a cardboard.
Step 9: All in Place
Before of that, make a hole on the top of the case to place later your button or you can modify the case design of the previous step.
Let's place all in the case. I suggest start placing the button. Then place the display and Arduino like on the image.
Later place on the case front holes each potenciometers like on the other image. The left one is the volume.
Then place the battery in one side of the case and the female power connector in your back cover. Connect the male connector to arduino.
Put the FM module on the other side of the case and connect correctly their pins. Connect the double jack plug if you didn't do that before and the antenna.
Stick the amplifier on the wall of the case and the same with the speaker. (See last image). And connect the audio jack to the double jack plug.
Be sure that everything is on his place and correctly connected.
Now push that button and listen some rock!
Step 10: Video Demo
Participated in the
DIY Audio and Music Contest