Arduino Projects

Arduino FM Radio using TEA5767 and RDA5807M FM Stereo Radio Modules

Arduino FM Radio, Overview:

Arduino FM Radio using TEA5767 and RDA5807M FM Stereo Radio Modules- In this article we will be making two FM Radios using TEA5767 and RDA5807M. We will be controlling both the FM Stereo Radio Modules using the Arduino board. The TEA5767 and RDA5807M FM Stereo Radio modules are quite popular and are easily available in maximum electronics shops. Previously I explained how to use an mp3 player; I used it in RFID based bike access system.


Amazon Links:

TEA5767

RDA5807M

12v Adaptor:

Arduino Uno

Arduino Nano

Nokia 5110 display

Top Radios available on Amazon

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!



TEA5767 FM Stereo Radio Module:

Let’s first start with the TEA5767 Radio Module and learn how to build a stable radio using the TEA5767 radio module with the Arduino. The TEA5767HN is a single-chip electronically tuned FM stereo radio for low-voltage applications with fully integrated Intermediate Frequency (IF) selectivity and demodulation. The radio is completely adjustment-free and only requires a minimum of small and low cost external components. The radio can be tuned to the European, US, and Japanese FM bands.

TEA5767 Features

  • High sensitivity due to integrated low-noise RF input amplifier
  • FM mixer for conversion to IF of the US/Europe (87.5 MHz to 108 MHz) and Japanese
  • (76 MHz to 91 MHz) FM band
  • Preset tuning to receive Japanese TV audio up to 108 MHz
  • RF Automatic Gain Control (AGC) circuit
  • LC tuner oscillator operating with low cost fixed chip inductors
  • FM IF selectivity performed internally
  • No external discriminator needed due to fully integrated FM demodulator
  • Crystal reference frequency oscillator; the oscillator operates with a 32.768 kHz clock
  • crystal or with a 13 MHz crystal and with an externally applied 6.5 MHz referencefrequency
  • Phase-locked loop (PLL) synthesizer tuning system
  • I2C-bus and 3-wire bus, selectable via pin BUSMODE
  • 7-bit IF counter output via the bus
  • 4-bit level information output via the bus
  • Soft mute
  • Signal dependent mono to stereo blend [Stereo Noise Cancelling (SNC)]
  • Signal dependent High Cut Control (HCC)
  • Soft mute, SNC and HCC can be switched off via the bus
  • Adjustment-free stereo decoder
  • Autonomous search tuning function
  • Standby mode
  • Two software programmable ports
  • Bus enable line to switch the bus input and output lines into 3-state mode


Arduino fm radio

So we will connect the TEA5767 module with the Arduino. The module communicates with the Arduino using over I squared C. So the first pin of the radio module is the SDA and the second pin of the radio module SCL and the third pin is the ground and the fourth pin is not needed. So let’s get into the fifth pin which is a VCC pin and it is connecting to the 3.3 volts of the Arduino. The six pin is a ground as well and the seventh and eighth pin is the speakers left and right channel and the nine pin is not needed. The tenth pin is an antenna pin so make sure you have at least one meter length of wire connected to the antenna pin.

Now to interface the TEA5767 with Arduino we will connect the pin 1 of the TEA5767 with A4/SDA and connect the pin of the IC with A5/SCL of the Arduino. Connect the pin 3 of the IC with the ground. Connect the pin 5 of the IC with the 5V. Connect pin 10 which is the antenna pin with the antenna.

Arduino fm radio

Now we will interface speaker so one speaker will be interface with the left channel and the second speaker will be interface with the right channel. So connect the ground of the speaker to the sixth pin of the radio module which is the ground and the seven pin is the right channel is connected with the one speaker and pin number 8 with another speaker.So now we can hear the sound from this speaker.


Arduino Code for TEA5767:

Now we will write the code which is very simple first of all we will include the library of the module the download link is given below.

Download TEA5767 Library:TEA5767

Now to include the library we will click on the sketch and then click on the add zip library

Arduino fm radio

Now we will select the library and open it

Arduino fm radio

After insertion of the library now click on file and select example then we have the t57600 and the example that we are going to write.

Arduino fm radio

So the first line includes the wire library and the second line includes the t5767 module library

#include <Wire.h>
#include <TEA5767Radio.h>

Now we are defining an object for this library as radio

TEA5767Radio radio = TEA5767Radio();

So let’s get into the setup function we begin the wire library and then we set the frequency of this object as 93.0.  radio.setFrequency(93.0); this is where you have to mention your local frequency for it to work.

void setup()
{ 
Wire.begin();
radio.setFrequency(93.0); // pick your own frequency
}


Arduino TEA5767 complete code:

// TEA5767 Example
#include <Wire.h>
#include <TEA5767Radio.h>

TEA5767Radio radio = TEA5767Radio();

void setup()
{ 
  Wire.begin();
  radio.setFrequency(93.0); // pick your own frequency
}

void loop()
{
}

So let’s just upload this code to the Arduino select the arduino board and now we can go ahead and click on upload. So when we will turn on the speaker we will obtain the sound the data from the 93.

RDA5807M FM stereo Radio with Nokia 5110 display: 

Now we will build RDA5870M radio and display the frequency on the Nokia 5110 display. In this project we are using two potentiometer one for the volume control because there is no way to control the volume from the module directly and another for the frequency selection. The RDA5807 module also consists of amplifier IC but it only amplify microphone sound not speaker sound so due to which we will require separate amplifier IC because the audio signal is very weak. For which we will require the following components:

  • Nokia 5110 display
  • Two 10 K potentiometer
  • Three pull up buttons
  • LM386 amplifier
  • speaker
  • Three 10K resistors
  • Arduino Nano
  • RDA5807 module



RDA5807 Module Interfacing with Arduino:

Arduino fm radio

  • Connect the SLC pin of the TEA5767 with the analog pin A5 of the Arduino
  • Connect the SDA pin of the TEA5767 with analog pin A4 of the Arduino
  • Now the middle pin of the potentiometer will be connected with the analog pin A0 of the Arduino which will be used for the selection of the frequency and connect the left side pin with the ground and right side pin with the VCC
  • Now connect the audio jack at the output of the amplifier of the TEA567 module which will consists of two wires ground and audio signal wire
  • Connect the ground wire with the ground of the Arduino and audio signal wire with at the input of the potentiometer and the other end of the potentiometer will be connected with the amplifier module and the third pin will be connected with the ground
  • Connect RST pin of the Nokia display with the D8 pin of the Arduino Nano
  • Connect CE pin of the Nokia display with the D7 pin of the Arduino Nano
  • Connect DC pin of the Nokia display with the D6 of the Arduino
  • Connect DIN pin of the Nokia display with the D5 pin of the Arduino
  • Connect the clk pin of the Nokia display with the D4 pin of the Arduino
  • Connect the VCC of the Nokia display with the 3V of the Arduino
  • Connect the ground of the display with the ground of the Arduino

First of all you will need to include the library for the LCD5110.

Download LCD5110_Graph library:LCD5110_Graph


TEA5767 Arduino Complete code:

#include <TEA5767N.h> 
#include <LCD5110_Graph.h> 

LCD5110 lcd(8,9,10,12,11);
TEA5767N radio = TEA5767N();

extern unsigned char BigNumbers[];
extern unsigned char TinyFont[];

extern uint8_t splash[];
extern uint8_t signal5[];
extern uint8_t signal4[];
extern uint8_t signal3[];
extern uint8_t signal2[];
extern uint8_t signal1[];

int analogPin = 0;
int val = 0; 
int frequencyInt = 0;
float frequency = 0;
float previousFrequency = 0;
int signalStrength = 0;

void setup() 
{
  radio.setMonoReception();
  radio.setStereoNoiseCancellingOn();
  initScreen();
  showSplashScreen();
  Serial.begin(9600);
}
 
void loop() {
  
  for(int i;i<30;i++)
  {
     val = val + analogRead(analogPin); 
     delay(1);
  }
  
  val = val/30;
  frequencyInt = map(val, 2, 1014, 8700, 10700); //Analog value to frequency from 87.0 MHz to 107.00 MHz 
  float frequency = frequencyInt/100.0f;

  if(frequency - previousFrequency >= 0.1f || previousFrequency - frequency >= 0.1f)
  {
    lcd.clrScr();
    radio.selectFrequency(frequency);
    printSignalStrength();
    printStereo();
    printFrequency(frequency);
    previousFrequency = frequency;    
  }
  
  lcd.clrScr();
  printSignalStrength();
  printStereo();
  printFrequency(frequency);
  delay(50); 
  val = 0;  
}

void initScreen()
{
  lcd.InitLCD();
  lcd.setFont(BigNumbers);
  lcd.clrScr();
}

void showSplashScreen()
{
  lcd.drawBitmap(0, 0, splash, 84, 48);
  lcd.update();  
  delay(3000);
  lcd.clrScr();
  lcd.update();
}

void printFrequency(float frequency)
{
  String frequencyString = String(frequency,1);
  if(frequencyString.length() == 4)
  {
    lcd.setFont(BigNumbers);
    lcd.print(frequencyString,14,12);
    lcd.update();
  }
  else
  {
    lcd.setFont(BigNumbers);
    lcd.print(frequencyString,0,12);
    lcd.update();
  }
}
void printStereo()
{
    boolean isStereo = radio.isStereo();
     if(isStereo)
    {
      lcd.setFont(TinyFont);
      lcd.print("STEREO",55,2);
    }
}

void printSignalStrength()
{
  signalStrength = radio.getSignalLevel();
  String signalStrenthString = String(signalStrength);
  if(signalStrength >=15)
  {
    lcd.drawBitmap(1, 1, signal5, 17 , 6);
  }else if(signalStrength >=11 && signalStrength <15)
  {
    lcd.drawBitmap(1, 1, signal4, 17 , 6);
  }
  else if(signalStrength >=9 && signalStrength <11)
  {
    lcd.drawBitmap(1, 1, signal3, 17 , 6);
  }
   else if(signalStrength >=7 && signalStrength <9)
  {
    lcd.drawBitmap(1, 1, signal2, 17 , 6);
  }
   else if(signalStrength <7)
  {
    lcd.drawBitmap(1, 1, signal1, 17 , 6);
  }
}

After uploading the code to the Arduino you will see the frequency on the display and by adjusting the potentiometer the frequency will change and we will hear the sound on the speaker.

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

2 Comments

  1. Thanks so much for this publication, it helped to influence my decision to undertake a similar project for my college work, i will appreciate it much and may be many others if you can give some explanation of the various parks of the sketch/code for TEA5767 FM receiver.

  2. Hi Fahard
    Realy great project but im having trouble with the upload of the code to the arduino
    it stops at

    TEA5767N radio = TEA5767N();
    with the error
    “TEA5767Nradio” deos not name a type
    any ideas on this as i have tried everything

    Regards
    Richard

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button