FM radio with station names (RDS)
Build it step by step
0 of 7 doneWire the tuner
Reset, I2C and power.
Tune a station
Hear it in headphones.
Add the OLED
Show the frequency.
Add the encoder
Move 0.1 MHz at a time.
Add seek
Press to find the next station.
Read the RDS
Show the station name.
Make a station list
Save favourites.
How do you build an FM radio with station names (RDS)?
A Si4703 tuner decodes RDS, so the radio shows the station name and song text on an OLED. You need ESP32 DevKit V1, Si4703 FM tuner with RDS, SSD1306 OLED Display, Rotary encoder module (KY-040), Headphone jack module 3.5 mm, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 150 minutes.
- Level
- Intermediate
- Time
- About 150 min
- Parts
- 7
Wiring
| From | To | Why |
|---|---|---|
| Si4703 SDIO | ESP32 GPIO21 | I2C data (also the mode select at reset) |
| Si4703 SCLK | ESP32 GPIO22 | I2C clock |
| Si4703 RST | ESP32 GPIO4 | Reset |
| Si4703 VIO and 3.3V | ESP32 3V3 | Power |
| Si4703 GND | ESP32 GND | Ground |
| Si4703 headphone out (L, R, GND) | Headphone jack module | Audio and antenna (the cable is the aerial) |
| OLED SDA and SCL | ESP32 GPIO21 and GPIO22 | Shared I2C bus |
| Encoder CLK, DT, SW | ESP32 GPIO32, GPIO33, GPIO25 | Tuning and seek |
Code
FM broadcasts carry a tiny data stream called RDS alongside the music at a very low rate, which includes the station name. The Si4703 chip receives and decodes it, so the radio can show a name instead of just a number. The headphone cable is the aerial, so keep it plugged in and stretched out, and expect better reception near a window. Station names arrive in pieces about once every few seconds, so the display fills in after tuning; weak stations may never show one. The chip must be reset with its data line held low, which the library handles through the reset and data pins you give it, so keep those wires as shown. The library reads the station name; scrolling song text needs a library that assembles radiotext, which you can add later. Keep the volume modest in headphones, and remember that some countries have few RDS stations. Arduino IDE with the ESP32 boards package 2.0.x, board "ESP32 Dev Module".
Runs on a virtual ESP32 Dev Module in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// FM radio with RDS station names. Libraries: SparkFun Si4703 (SparkFunSi4703.h), Adafruit SSD1306, Adafruit GFX. Board: ESP32 Dev Module.
// Turn the encoder to move 0.1 MHz at a time, press it to seek up to the next station. The station name appears when the RDS data arrives.
#include <Wire.h>
#include <SparkFunSi4703.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
const int RESET_PIN = 4, SDIO_PIN = 21, SCLK_PIN = 22, STC_PIN = 5; // STC_PIN: the library wants a spare pin, leave it unwired
Si4703_Breakout radio(RESET_PIN, SDIO_PIN, SCLK_PIN, STC_PIN);
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const int CLK_PIN = 32, DT_PIN = 33, SW_PIN = 25;
int channel = 947; // 94.7 MHz, written as 947
int volume = 6; // 0 to 15
char station[10] = "";
volatile int delta = 0;
void IRAM_ATTR isr() { delta += (digitalRead(DT_PIN) != digitalRead(CLK_PIN)) ? 1 : -1; }
void show() {
oled.clearDisplay(); oled.setTextSize(2); oled.setCursor(0, 0);
oled.print(channel / 10); oled.print('.'); oled.print(channel % 10); oled.print(" MHz");
oled.setTextSize(1); oled.setCursor(0, 30); oled.print(station[0] ? station : "(no RDS yet)");
oled.setCursor(0, 50); oled.print("Volume "); oled.print(volume);
oled.display();
}
void setup() {
pinMode(CLK_PIN, INPUT_PULLUP); pinMode(DT_PIN, INPUT_PULLUP); pinMode(SW_PIN, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(CLK_PIN), isr, FALLING);
radio.powerOn();
radio.setVolume(volume);
radio.setChannel(channel);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
oled.setTextColor(SSD1306_WHITE);
show();
}
void loop() {
noInterrupts(); int d = delta; delta = 0; interrupts();
if (d != 0) { channel = constrain(channel + d, 875, 1080); radio.setChannel(channel); station[0] = 0; show(); }
if (!digitalRead(SW_PIN)) { channel = radio.seekUp(); station[0] = 0; show(); delay(300); }
char buf[10] = "";
radio.readRDS(buf, 800); // wait up to 0.8 s for the station name
if (buf[0] && strcmp(buf, station) != 0) { strncpy(station, buf, 9); station[9] = 0; show(); }
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Power on | Plays the set frequency |
| Turn the encoder | Frequency changes |
| Press to seek | Jumps to the next station |
| Strong station | Name appears within a few seconds |
If it does not work
No sound
Check the headphone wiring and volume.
No RDS
Station may not send it; try a strong one.
Chip not found
Check the reset wiring before power-up.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the FM radio with station names (RDS)?
ESP32 DevKit V1, Si4703 FM tuner with RDS, SSD1306 OLED Display, Rotary encoder module (KY-040), Headphone jack module 3.5 mm, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the FM radio with station names (RDS) take to build?
About 150 minutes for a intermediate maker, in 7 steps.
How do I know the FM radio with station names (RDS) works?
Power on: Plays the set frequency. Turn the encoder: Frequency changes. Press to seek: Jumps to the next station.
No sound: what should I check?
Check the headphone wiring and volume.
No RDS: what should I check?
Station may not send it; try a strong one.
Chip not found: what should I check?
Check the reset wiring before power-up.
