Silicon Chip – May 2019

(Elliott) #1

98 Silicon chip Australia’s electronics magazine siliconchip.com.au


The low-cost VS1053 MP3 player
shield featured in the July 2017 issue
(siliconchip.com.au/Article/10721
& siliconchip.com.au/Article/10722)
and available from the Silicon chip
Online Shop (Cat SC4315; siliconchip.
com.au/Shop/7/4315) gave me the idea
to make my own internet radio.
All I needed was an Arduino with
WiFi to receive the data; then I could
use the VS1053 to decode and play it.
In the end, this internet radio cost me
less than $20 to build.
The software on the Arduino bare-
ly has to do anything at all; once it’s
receiving the compressed audio data
from the remote radio server, it just
passes it on to the VS1053 audio pro-
cessor on the shield board, and it does
the rest! I found that all I have to do is
deliver streaming data in exactly 32-
byte chunks for this to work.
As I’m familiar with the Ardui-
no-compatible ESP32 processor and
board modules, and they are cheap,
that’s what I decided to use. Once I
took advantage of some helper librar-
ies and headers, the simple version
of my program ended up only being
about 50 lines long.


The hardware is similarly quite sim-
ple. The three main components are
the ESP32 board, VS1053 shield and
optional OLED display.
The ESP32 and VS1053 connect via
a three-wire SPI serial bus, two chip
select lines (XCS and XDCS), a reset
pin (XRST) and interrupt/signal line
(DREG).
The SPI pins of the shield go to the
ESP32’s SPI bus, while the other lines
simply go to available digital I/O pins.
The OLED communicates via I^2 C and
so it is wired to the ESP32’s I^2 C pins
(SDA for data and SCL for clock).
The VS1053 shield I used is similar
to the one described in the July 2017
issue of Silicon chip, but instead of be-
ing an Arduino shield, it is a roughly
square blue board with all the connec-
tions on a SIL header along one side.
This makes it smaller and more con-
venient to wire up to the ESP32 mod-
ule I'm using.
The 3.3V supply is derived from a
3.7V (nominal) LiPo cell by an HT7333
low-dropout 3.3V linear regulator.
The ESP32 and optional OLED
screen run off this regulated rail while
the VS1053 has internal 3.3V and 2.5V

ESP32 Internet Radio Receiver regulators, so the battery voltage is ap-
plied directly to its 5V input, which
feeds directly to the inputs of these
two regulators (see the July 2017 arti-
cle for its circuit details).
Pushbutton switch S1 is connected
between ESP32 pin D13 (reset) and
ground and it used to change radio sta-
tions; each time it is pressed, it resets
the ESP32 and it then tries to connect
to the next internet radio station from
a list stored in flash memory.
When building the unit, keep the
wires between the ESP32 and VS1053
as short as possible. Longer wires can
result in a humming noise at the au-
dio output.
The VS1053 module produces ste-
reo sound which can be fed directly
to headphones or small speakers. For
driving larger speakers, which require
more than a watt or so, you need an
external amplifier.
Once you’ve built the hardware, you
will need to download and install the
latest Arduino integrated development
environment (IDE) if you don’t already
have it on your computer.
You will also need to download
and install the ESP32-specific board
files. This can be done via the built-
in Board Manager.

Free download pdf