How to Build an ESP32 Internet Radio
Updated

An ESP32 is a Wi-Fi microcontroller that costs a few euros, and with a small audio board it plays internet radio on its own: no computer, no app, on the air a few seconds after you plug it in. It is less capable than a Raspberry Pi internet radio — no web player, no big music library — but it is cheaper, uses very little power and makes a good first electronics project.
What you need
- An ESP32 board with PSRAM. The ESP32-audioI2S library used in Option 2 needs PSRAM and a multi-core chip: an ESP32-S3 board with PSRAM is its main target today, and a basic classic ESP32 board without PSRAM (such as a plain WROOM-32 dev board) will not run that sketch. The finished firmware in Option 1 is more forgiving: yoRadio has a buffer setting for boards without PSRAM, and Ka-Radio32 plays MP3 only over I2S on a board without it (AAC needs PSRAM or a VS1053 decoder).
- An audio board. A MAX98357A I2S amplifier drives a small speaker directly; a PCM5102A I2S DAC gives a line output for an amplifier or powered speakers. Some older projects use a VS1053 decoder board instead.
- A speaker and a USB power supply. Optional extras: a small display for the station name, and a rotary encoder or a few buttons.
Option 1: a finished firmware
- yoRadio — web radio firmware built on the ESP32-audioI2S library. You manage the station list from a web page on your network, and it supports displays, remote controls and MQTT. It can import KaRadio station lists.
- Ka-Radio32 — the ESP32 version of the long-running KaRadio project, also with a web interface.
- ESP32Radio-V2 by Edzelf — the maintained successor of the original ESP32-Radio, with a VS1053 decoder or I2S output.
Each has its own wiring notes and flashing instructions on GitHub; follow the ones for the audio board you bought.
Option 2: a few lines of Arduino code
With the ESP32-audioI2S library, a working radio is short:
#include <WiFi.h>
#include "Audio.h"
Audio audio;
void setup() {
WiFi.begin("your-network", "your-password");
while (WiFi.status() != WL_CONNECTED) delay(500);
audio.setPinout(26, 25, 22); // BCLK, LRC, DOUT: match your wiring
audio.setVolume(12);
audio.connecttohost("https://example.com/stream");
}
void loop() {
audio.loop();
}
Check the library's own examples for the version you install; its details change between releases. The pin numbers above suit a classic ESP32 dev board. On an ESP32-S3, GPIO 22 to 25 do not exist and GPIO 26 to 32 are used by the flash and PSRAM, so choose other free pins, for example 4, 5 and 6 on many S3 dev boards, and pass them in the same BCLK, LRC, DOUT order.
Choosing streams that play well
- MP3 at 128 kbps or less is the safest choice. AAC needs a board with PSRAM (or a VS1053 decoder). HLS addresses ending in
.m3u8depend on the library and firmware, so test one before relying on it. - https costs the chip extra work. If an https stream stutters and the station also offers an http address, try that.
- Getting the addresses: every station page on 72FM has a Stream address panel with a Copy button. For many stations at once, the free M3U playlists by country and genre are plain text files: open one and copy the lines you want into your firmware's station list.
Why build one
A radio you built plays whatever stream addresses you give it. It does not depend on a manufacturer's station directory, which is what left many shop-bought Wi-Fi radios silent — internet radio stopped working tells that story.
Frequently asked questions
Can an ESP32 play internet radio?
Yes. With an I2S audio board such as a MAX98357A amplifier or a PCM5102A DAC, an ESP32 plays MP3 streams on its own, and AAC streams too on a board with PSRAM (or with a VS1053 decoder).
What is the easiest ESP32 radio firmware?
Finished projects such as yoRadio and Ka-Radio32 give you a web page to manage stations, so you only need to wire the board and flash the firmware.
Which radio streams work best on an ESP32?
MP3 streams at 128 kbps or less are the most dependable. HLS streams ending in .m3u8 depend on the library and firmware, so test one before relying on it.
Where do I get radio stream URLs for an ESP32?
Every station page on 72FM shows its stream address with a Copy button, and free M3U playlists by country and genre list thousands of them.