I have been building several sound boxes lately (amps, sequencers), and when i thought of making an internet radio, i found the excellent Esp-radio project using the Arduino IDE to program the ESP8266 WiFi module (ESP-12E version). The documentation is quite complete, and the author Ed is happy to help out via questions on github. I was quite easy to get the prototype working; i spent far more time on putting it into a nice box. It’s a very functional project; the radio can be configured via a web server and i decided to have just 2 buttons on the box: channel up and down.
It uses the ESP8266 to connect to WiFi and select an internet radio station. The MP3 stream is passed on to a sound card (VS1053 chip) via SPI. I already had an Arduino MP3 shield with this exact chip so i used that in my prototype. For the ESP8266 i started with the NodeMCUv1.0 and i thought i would replace it later with a barebones ESP-12E module, but it’s very handy to have the USB connection and voltage regulator on the NodeMCU, and it’s quite cheap these days so i decided to keep the NodeMCU. Below a look into the box and a list of components:
- left: green perf board with NodeMCUv1.0 plugged into 2 rows of female headers, including a voltage divider series read the status of 2 push buttons with the 1 analog input (see Esp-radio doc)
- top left: 2 push buttons going in the voltage divider
- top center: 0.96” OLED screen connected to NodeMCU via SPI (different model from Esp-radio but similar connections)
- top right: double pole switch for the 2 separate power supply lines
- under switch: stereo potentiometer for volume control
- back: 2 speakers 3W 4ohm
- in between the speakers: class D stereo amplifier PAM8403 2x 3W at 4ohm
- front bottom: 2 Lithium ion cells 18650 (recovered from old laptop battery)
- bottom right (not visible): 2 protection/charger PCBs for the Lithium cells
- bottom right (not visible): DC/DC booster PCB for amplifier power supply
- right: blue Arduino MP3 shield with VS1053 chip, later replaced by this VS1053 breakout board
My first prototype was a lot more simple: the NodeMCUv1.0 on a breadboard, powered over USB, with SPI connections to the MP3 shield, powered from the 5V on the NodeMCU. I used the Arduino IDE 1.6.8 because it did not seem to work with 1.6.5. See Esp-radio PDF doc for details on which libraries to install. I figured out you also have to upload the ‘data’ folder into the ESP8266 SPIFFS, that’s a separate operation from the sketch upload. After some configuration (see doc) i got sound over the earphone jack output of my MP3 shield. The Serial output is very helpful for debugging.
Some of the further steps and challenges i encountered:
- i had glitches in my music playback, even with very fast internet access. finally i figured out it was interference from the SD card on my MP3 shield, that is also using SPI. as soon as i removed the SD card from the shield, the problem went away (later on i switched to a VS1053 breakout board without SD card).
- i added an OLED screen, the same cheap one that i always use, with this SSD1306 library. the major difference is that my display requires a RST pin; as we’re a bit short of I/O pins here, i first tried to use the same RST line as the VS1053 (combination with 2 diodes) but that reset does not happen immediately after power up and i wanted my display to switch on immediately. i ended up using GPIO0 for the OLED RST. i know, the screen is small, but it displays the relevant info. i did have to change the code quite a bit to work with my display library. (see below for version with standard 1.8” TFT screen)
- the Esp-radio also includes a web server with a homepage to select the channel, adjust the volume (0-100%) and even basic bass/treble control. also handy for debugging. with the 1 analog pin on the ESP8266 already in use for my 2 buttons, i could not think of an easy way to change this VS1053 volume with a potentiometer, so i just added a stereo potentiometer between the VS1053 output and the input line to the amplifier. the volume shown on screen (VS1053 volume) is the maximum, it can only be changed via a browser.
- adding an amplifier: this is quite straightforward if you power the amplifier from a different power source as the NodeMCU/MP3, but i hoped to use only 1 battery inside. the problem is that the VS1053 audio output is biased to 1.25V which seems common for earphones. so we cannot connect the output jack’s ‘GND’ (which is actually not 0V) to the common GND. this VS1053 doc describes a simple solution to get a line-out signal. however, when using a single power supply, this still had a lot of noise. it seems Class D amplifiers have particular requirements for power supply, so i decided to go for separate power supplies. i soldered 3 wires to the MP3 shield’s jack plug and connected them directly to the volume potentiometer and amp as above.
- i use 2 Lithium ion cells type 18650, recovered from an old laptop battery. they have a nominal voltage of 3.7V, which is too high for the NodeMCUv1.0 via the Vin pin, and the onboard voltage regulator is NOT low-dropout (LDO), it takes around 1V off the input voltage. as far as i could tell, the ESP stopped working at around 2.5V (streaming stopped). my solution was to add a real LDO 3.3V voltage regulator like the MCP1826 (with 220uF on input and 0.1uF on output). the MP3 shield can be connected straight to the battery output via its 5V pin. of course i included a protection/charger PCB for each cell, with the microUSB ports accessible in the side panel.
- the amplifier works at voltages below 5V but with these 4ohm speakers it gives a lot of distortion under 4V, so i included a DC/DC booster PCB to bring the voltage up to 5.45V to get maximum amplification.
The tabbed box is laser cut out of 5mm thick soft wood. I hot glued it together, except for the back panel. I went for an inclined top panel to make it easier to see the (small) screen, and i got a bit bored of my usual rectangular boxes. I glued 4 support blocks to the side panels for the screws that hold the back panel in place.
Here is a closer look at the 2 Lithium cell protection/charger PCBs at the bottom on the right.
And below with the smaller VS1053 breakout board.
I made a second version for a friend, using the standard 1.8” TFT display, with minor modifications to the sketch (1 Feb 2017 version).



Great job
You could put the Oled display between the speakers as well and mount it on a wedge to get proper viewing angle
I’m waiting on parts from china to give it a go myself. I’m inclined towards an old cigar box for the case
So you connect the VS1053-Boards outputs directly to your amp without any noise issues?
Yes i have the mini jack headphone outputs (L,R, GND) connected directly to my amp and the sound is crystal clear when i use a separate power supply for the amp. I tried powering the ESP8266 and the amp off the same battery but that is a problem because the VS1053 R,L outputs are DC biased to 1.25V, and filtering out that bias gave me noise issues, so i opted for 2 batteries.
Hi
Nice project
I would like to build a similar one
Can you share the schematics of the power parts
Lipo ldo charger and how it powers different parts
Thanks
Hi, sorry for the late reply. I have included a few drawings of the power supply connections, please check.
I built the original version that Ed did, but I can’t find the display he used. Ed’s display used a ILI9163C controller, but the most common available on Ebay uses the ST7735S.
that display you used for your friend looks to be one of them.
I know this is an old article but if you can point me to the wiring, sketch, and any library you used on your friend version, I would be so grateful. If there was a link in this article I didn’t see it.
Hi Clarence, that is a quite common LCD TFT screen; i get them here https://world.tmall.com/item/41269318301.htm?spm=a312a.7700824.w4011-8679163093.35.jEKpad&id=41269318301&rn=e109a68602e7d8cf5641406e1641174e&abbucket=11
The wiring should be clear from Ed’s table. I used his code, with only very minor modifications; his version did also work without any modifications.
Dear Tom!
I put together your second version (ESP 12E + VR1056 +1.8′ TFT LCD), and upload to MCU. On the display its can be seen the connection with router OK, and the IP seen on network for a short time, but the system reboot at every 10 sec, so i cant use it.
Do you have any idee, what cause this problem? I use Edzelf ESP 8266 files.
I ordered ESP32, i going to change to it, but now i must use ESP8266!
maybe a power issue? how are you powering the ESP8266? it can draw a lot of current
Dear Tom,
I’m planning to build your version of the Esp radio.
I also want to use e OLED screen, the same size like yours. It would be very great if you can share the code with me. I’m a noob in programming and want to get deeper into it.
Thank you very much for your help.
Best regards,
Robert
As per email, I would advise to use the more powerful ESP32 at https://github.com/Edzelf/ESP32-Radio
My radio based on ESP8266 works but the stream is often interrupted, i’m sure the ESP32 performs better.
And it supports an OLED out of the box, so should be easy to get going, especially if you’re not experienced.
Hello Tom
Nice project 😉
Can you share void from your code, where you change radio station. I’m doing similar project, but with one button only and without display.
I’m modyfying example where source adress is const char *url. I can’t manage how to change stations by clicking button.
hi, i’d advise you to seek help at the github repo of the original project
Hi, I made an ESP radio with a TFT 1.8 ” screen and 1 button. I tried with 3 buttons but the buttons don’t work. I tried to make some code changes but the buttons still don’t work. I’m wrong somewhere.
I have now found your project with an OLED display and 2 buttons. I like the display on OLED much more than on the TFT screen. I would ask you if you would like to send me the code for the OLED display and the values of the resistors for the buttons.
If it can’t code, I would ask you for the resistor values and the information about what changes in the code should I make in order for the buttons to work.
Thank you in advance,
all the best,
Ivica Kolenko
hi, sorry for the delay. i haven’t worked on this for a long time and i’d suggest to use the ESP32 instead which will work better i think. the same author of the ESP8266 code wrote this https://github.com/Edzelf/ESP32-Radio and it seems to have OLED options.