siliconchip.com.au Australia’s electronics magazine May 2019 99
The software sketch requires the
open-source ESP32 VS1053 library,
which is included as part of the down-
load package (github.com/Edzelf/Esp-
radio).
Open the sketch in the Arduino IDE
and then modify it so that it contains
your WiFi network SSID and pass-
word. These are defined near the top
of the code.
You should also change the station
list to include your favourite internet
radio stations. You can then upload
the software to the ESP32 in the usual
Arduino way.
Once uploaded, the ESP32 will first
display “Hello” to indicate that the
VS1053 is up and ready. It will then
wait for a couple of seconds while it
connects to your WiFi network.
Progress is shown as a series of
dots on the Serial Terminal output.
Once connected, it then loads the
station and as soon as it’s connected,
you should get audio output from the
VS1053 module.
Press switch S1 once and the next
station will be tuned. It will go through
the connection process again, and this
may take a few seconds.
If you’ve connected the optional
Got an interesting original circuit that you have cleverly devised? We will pay
good money to feature it in Circuit Notebook. We can pay you by electronic
funds transfer, cheque or direct to your PayPal account. Or you can use the
funds to purchase anything from the SILICON CHIP Online Store.
Email your circuit and descriptive text to [email protected]
Circuit Ideas Wanted
The radio was built on a breadboard using flying leads, the size and pin
locations of the modules makes it difficult to lay them out cleanly, but it could
be built into a case.
I^2 C OLED screen, the name of the cur-
rently playing station is shown on that
screen. I had to jump through some
hoops to get this part of the code to
work.
I first tried using the Adafruit
SSD1306 and Adafruit GFX libraries
to drive the display, which I’ve had
success with in the past, but they in-
terfered with the radio streaming and
caused the sound to break up.
I found that I had to instead use a
lightweight SSD1306 library called
esp8266-oled-ssd1306 (also included
in the download) which is designed
specifically for ESP8266-based mod-
ules.
With this library, the I^2 C display
works just fine without any effect on
the sound output.
Note that if you leave the OLED
screen off, you don’t need to change
the software. The I^2 C data will just go
nowhere.
The sketch is named “simple_
esp32_radio_mod3.ino” and a second
file, “helloMp3.h” is also included
which contains a short greeting sound
file that’s played at start-up.
Bera Somnath,
Vindhyanagar, India ($95).