Arduino Stereo FM Radio
Author : Dinesh Kumar Wickramasinghe
Introduction
Arduino is not only for controlling motors or lighting LEDs. It can do many more. If you’ve already read my Arduino Stereo MP3 player project, here is another similar project.
This time we are going to build a stereo FM radio with Arduino.
Not like early days, With the improvement of the technology, a FM radio can be built using a single chip. Early days there were many components inside a FM radio including a huge tuning condenser, some coils and many more.
So in this tutorial, I will use the tiny RDA5807M module with Arduino Uno to build the stereo FM radio.
RDA5807M Chip
The RDA5807M series is the newest generation single-chip broadcast FM stereo radio tuner with fully integrated synthesizer, IF selectivity, RDS/RBDS and MPX decoder. The RDA5807M series support frequency range is from 50MHz to 115MHz.
You can find more information about this chip from the Datasheet.
This module is very cheap. In my country I purchased it for less than a dolar. This tiny module has no soldered headers. So you have to carefully solder some headers.
I could carefully solder a few pins to it and this is how it looks like. Now I can put this on the bread-board easily.
This module has a stereo output and you can connect a stereo headphones through a stereo socket. In my experiment, I used headphones and also tried with the tiny PAM8403 amplifier to power up two external speakers. You can connect any stereo audio amplifier or headphones.
Project Setup
Here is the diagram. Please note that this module needs 3.3V power. Please connect it to arduino 3.3V NOT 5V.
This module also has a separate antenna terminal. You can connect a 1 meter long wire to it as the antenna.
You can connect a stereo socket to the stereo outputs to listen from headphones. Otherwise connect an amplifier to the audio out.
Here are some images of my actual project setup.
Arduino Sketch
I used a small radio library in this project so it was easy to run this with minimum lines of codes.
Here is the GIT repo of this library :
https://github.com/mathertel/Radio
Go to the library manager of the Arduino IDE and search for “RDA5807M”. Then select the “Radio by Matthias Hertel” library and install it.
Here is the basic source code of my experiment. You can investigate more features in the library and more functions. You can connect a LCD display to show the volume, frequency info to make the project better than my one.
#include <Arduino.h>
#include <Wire.h>
#include <radio.h>
#include <RDA5807M.h>
#define FIX_BAND RADIO_BAND_FM
#define FIX_STATION 9890
#define FIX_VOLUME 1
RDA5807M radio;
void setup() {
Serial.begin(9600);
Serial.println("FM Radio");
delay(200);
radio.init();
radio.debugEnable();
radio.setBandFrequency(FIX_BAND, FIX_STATION);
radio.setVolume(FIX_VOLUME);
radio.setMono(false);
radio.setMute(false);
}
void loop() {
char s[12];
radio.formatFrequency(s, sizeof(s));
Serial.print("Station:");
Serial.println(s);
Serial.print("Radio:");
radio.debugRadioInfo();
Serial.print("Audio:");
radio.debugAudioInfo();
delay(3000);
}
Below line set the FM frequency. So 9890 = 98.9 MHz
#define FIX_STATION 9890
You can change the frequency to a different station and check. You have to upload the sketch again.
Conclusion
Hope you enjoyed the project. You can use a potentiometer to set the frequency instead of setting it in the code. Also add a display to show the frequency. I saw on the internet, some people have designed a nice box to look like an actual radio. It's all up to you. Put your questions, ideas as comments. Thank you.