Make an Arduino FM Radio! (using TEA5767)
Intro: Make an Arduino FM Radio! (using TEA5767)
Hi guys from Instructables, In this tutorial i'll show you how to make a FM digital Radio easily using arduino uno (or any other arduino board), and the TEA5667 Fm Radio module, and audio amplifier and a LCD 16X2.
Let´s start !
STEP 1: Block Diagram & Connections.
First, the part list of needed electronic components:
-Arduino UNO, or any other similar board friendly with the arduino enviroment.
-TEA5767 FM Radio module
-16X2 LCD
-2 Buttons Normally open (NA) or push buttons
-330 ohms resistor
-2x 10 k ohms reisistor
-Jumper wires
-Switch for to power on the radio
-Led(as a power on indicator).
-A free weekend or day :)
STEP 2: Arduino Program & Libraries
*First you'll need to install the librarys on the arduino IDE and later compile and upload the program*
The code in text is here:
/*+-10--9--8--7--6-+ | +------+ ++ | | | TEA | || | | | 5767 | || | | +------+ ++ | +--1--2--3--4--5-+ 1 ----> Arduino SDA (pin A5 arduino uno) 2 ----> Arduino SCL (pin A4 arduino uno) 3 ----> GND 5 ----> +3.3 V 6 ----> GND 7 ----> Audio out (right channel) 8 ----> Audio out (left channel) 10 ---> Antenna * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * ends to +5V and ground * UP SEARCH (A0) * DOWN SEARCH (A1) * ALL RESISTOR ARE 10K AND PUSH BUTTON IN PULL DOWN MODE */ #include<Wire.h> #include <TEA5767Radio.h> #include <LiquidCrystal.h> TEA5767Radio radio = TEA5767Radio(); LiquidCrystal lcd(12, 11, 5, 4, 3, 2); float frequency = 0; int fUP = A0; int fDOWN = A1; int count = 0; void setup() { delay(1000); Wire.begin(); frequency = 91.1; //starting frequency radio.setFrequency(frequency); lcd.begin(16,2); lcd.clear(); lcd.setCursor(0,0); lcd.print("FM: "); lcd.setCursor(0, 1); lcd.print(frequency); }void loop() { if(digitalRead(fUP)) { count=0; while (digitalRead(fUP)) { count++; if(count > 0 && count <= 6) { frequency += 0.1; frequencyUpdate(); delay(200); } else if (count > 6 && count <= 2) { frequency += 0.1; frequencyUpdate(); delay(80); } else { frequency += 0.1; frequencyUpdate(); delay(5); } }} if(digitalRead(fDOWN)) { count = 0; while (digitalRead(fDOWN)) { count--; if(count < 0 && count >= -6) { frequency -= 0.1; frequencyUpdate(); delay(200); } else if (count < -6 && count >= -12) { frequency -= 0.1; frequencyUpdate(); delay(80); } else { frequency -= 0.1; frequencyUpdate(); delay(5); } } } } void frequencyUpdate() //this function changes the frequency of the station, is called by preset and frequency up/down conditions. { frequency = constrain(frequency, 88.0, 108.0); lcd.setCursor(0,0); lcd.print("ESTACION DE FM:"); lcd.setCursor(0,1); lcd.print(frequency); radio.setFrequency(frequency); }
STEP 3: Final Pictures!
Here some nice pictures and teh radio with the shield totally functional!
ESPECIAL NOTES:
*Remember to use an a good audio amplifier for the output of the TEA5767 FM Radio Module
*Vcc= 3.3 TO 5 Volts maximun for the power of the TEA5767 Radio Module
*To use a good onmidirectional antenna
*The radio doesn't have an automatic searh for the FM stations but it's modifficable by the program
28 Comments
xachapurik51 3 months ago
Where can I get such an adapter for the TEA5767 board or what is it called?
thilinaaa 2 years ago
I am successful with a Nano.
Cheers...!!!
robertcanevy 2 years ago
Thank you
al615ca 3 years ago
Upstander123 5 years ago
Mardav111 4 years ago
RichieC10 4 years ago
dodoykusgan 4 years ago
DjawaD 4 years ago
nima_v 4 years ago
Max _777 4 years ago
MuaazH 5 years ago
#include <radio.h>
#include <Wire.h>
#include <RDA5807M.h>
#include <LiquidCrystal.h>
#define FIX_VOLUME 10
RDA5807M radio = RDA5807M();
//RDA5807M radio;
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
float frequency = 0;
int fUP = A0;
int fDOWN = A1;
int count = 0;
void setup() {
delay(1000);
Wire.begin();
frequency = 87.0; //starting frequency
radio.setFrequency(frequency);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("FM: ");
lcd.setCursor(0, 1);
lcd.print(frequency); lcd.print("Mhz");
}
void loop() {
if (digitalRead(fUP))
{
count = 0;
while (digitalRead(fUP))
{
count++;
if (count > 0 && count <= 6)
{
frequency += 0.1;
frequencyUpdate();
delay(200);
}
else if (count > 6 && count <= 2)
{
frequency += 0.1;
frequencyUpdate();
delay(80);
}
else
{
frequency += 0.1;
frequencyUpdate();
delay(5);
}
}
}
if (digitalRead(fDOWN))
{
count = 0;
while (digitalRead(fDOWN))
{
count--;
if (count < 0 && count >= -6)
{
frequency -= 0.1;
frequencyUpdate();
delay(200);
}
else if (count < -6 && count >= -12) {
frequency -= 0.1;
frequencyUpdate();
delay(80);
}
else {
frequency -= 0.1;
frequencyUpdate();
delay(5);
}
}
}
}
//this function changes the frequency of the station, is called by preset and frequency up/down conditions.
void frequencyUpdate()
{
frequency = constrain(frequency, 87.0, 108.0);
lcd.setCursor(0, 0);
lcd.print("Radio Search:");
lcd.setCursor(0, 1);
lcd.print(frequency); lcd.print("Mhz");
radio.setFrequency(frequency);
}
MatthewH321 5 years ago
Question : What is the pink wire from the lcd board connected to. Thanks
electromanmx 5 years ago
tclayton 7 years ago
electromanmx 5 years ago
you can make a mono amp with stereo output, only yopu have to do is solder a 10 ohm resistor to each output of the TEA5767 and solber both terminals to a single audio mixed output in a mono amp
electromanmx 7 years ago
tclayton 7 years ago
Origionally i could not get this sketch to work but its because i was not using the right pins for sda and scl (i had an ardruino mega). I tried 4 other sketches before i found that out then got other ones to work but ultimately went back to your design and it is by far the best and cleanest signal with your code ! Im working on making an fm radio with aux and bluetooth and also display time and temp/humidity on the lcd (although im not sure how to code in all the screen changes). Thanks for this tutorial !
tanoha 6 years ago
Thks
alai5 7 years ago
What is the language of the code? Thanks