If you don\'t need to scan for stations and want your Arduino radio to always play the same station (e.g., in a workshop), the best solution is a "locked" frequency. The example below shows how to set the TEA5767 module to a fixed frequency for BBC Radio 1 (98.8 MHz).
Required Hardware
- Arduino board (Uno, Nano, or Mega)
- TEA5767 FM radio module
- Antenna (a piece of wire is enough)
Connection (I2C Protocol)
The TEA5767 uses I2C communication, so we connect it to the following pins:
| TEA5767 Pin | Arduino (Uno/Nano) | Description |
|---|---|---|
| VCC | 5V | Power Supply |
| GND | GND | Ground |
| SDA | A4 | Data Line |
| SCL | A5 | Clock Line |
Arduino Code for a Single Frequency
#include <Wire.h> // Library for I2C communication
#include <TEA5767.h> // Library for TEA5767 module
TEA5767 radio; // Create radio object
unsigned char status[5]; // Array for reading status
void setup() {
Serial.begin(9600);
Wire.begin(); // Initialize I2C
radio.init(); // Initialize the module
radio.set_frequency(98.8); // Set BBC Radio 1 (98.8 MHz)
Serial.println("FM radio ready at 98.8 MHz");
}
void loop() {
// Check signal strength every second
if (radio.read_status(status)) {
int signal = radio.signal_level(status); // Signal strength
int isStereo = radio.stereo(status); // Check stereo mode
Serial.print("Signal Strength: ");
Serial.print(signal);
Serial.print(" | Stereo: ");
Serial.println(isStereo ? "Yes" : "No");
}
delay(1000);
}