er. Secure ESP32 Internet Radio with wired Ethernet connection

Many ESP32 Radio builders report hearing white noise while listening to it and some even suggest using battery power for VS1053 module or even audio transformers. But I have to thank my bad luck to have managed to build an internet radio that needs none of these. AMS1117B 1.8 V fixed voltage regulator had broken in an accident, but I replaced it with Texas Instruments TPS7A4701-EP based high precision psu. I also added 2200 µF, 1000 µF and two 3300 µF capacitors to all components (ESP32, LAN8720A Network module V1053 and micro SD card).

The radio uses 3.3 V and 5 V power from Microchip Starter Kit I/O Expansion board that was also at hand, but the board power supply is provided from a relatively 12 V 2 A plug power supply. I guess it could be done with a smaller number of capacitors as well, but I have no intention to test it now, when the radio works perfectly.

Of course, I had to put the hardware somewhere, but I had no suitable plastic case, so I built one from LEGO blocks. Though the case seemed awkward at first, it proved handy when adding openings for additional peripheral components like IR receiver.

The original Internet radio (https://github.com/Edzelf/ESP32-radio) is based on Wi-Fi networks, but an article ESP8266 and ESP32 WiFi hacked on www.Hackady.io webpage specifically addresses the dangers of hacker attacks on ESP32 and ESP8266 modules through Wi-Fi. I therefore come up to an idea of building an ESP32 radio with a much safer wired Ethernet connection to Internet. I started with the original source code and modified it to connect to the Internet through LAN8720A Network module. The module connects to ESP32 through EMAC interface, so VS1053 had to be moved to HSPI bus. A number of GPIOs had been used to connect LAN8720A network module, but there are still pins connect peripherals such as display, rotary encoder and IR receiver. The project also includes a micro SD card, an IR receiver, an OLED display and a rotary encoder. However, I have only tested a version of the radio without the rotary encoder.

Schematic: Click in the picture to enlarge it.

A display and a IR receiver are important additions to an internet radio that require just a little bit more soldering. Schematic version 1.2 adds a 5 V Sharp IR receiver to GPIO35 input and adapts it output to a 0 V to +3.4 V range with a 10 k ohm and a 15 k ohm resistors. It also adds an OLED display with SSD1106 controller on a 5 MHz SPI bus. A rotary encoder with a button and an extra ON/OFF button were also added, but they only required firmware configuration changes to define a new GPIOs settings.

There are no spare GPIOs left on ESP32, now! if you want to connect more preripherals, you may opt for an additional ESP module that connects through programming RS232 port or adding an RS232 port extender. RS232 GPIOs may also be used as digital input and outputs, but this prevents displaying debugging information during the ratio operation. There is also an option of adding more devices in SPI or I2C buses that share the same GPIOs, but this may impair the radio operation.

However, there was much more work that had to be done in the firmware. Sharp GP1UX511QS IR receiver significantly differ from the one used in the original Ed Smallenburg’s Internet radio project. I added irtest command that displays raw data from IR sensor and makes adding a new IR receiver type much easier. SHARP IR receiver has different timings and also seems to be less powerful, but it preforms good enough to control the radio with a number of remotes, anyway.

The original SSD1306 programing library uses I2C bus, but I opted for a faster SPI bus. Quite some changes also had to be made to adapt the library to correctly display the data on OLED with an older SSD1106 controller, as well.

Adding peripherals

Hardware: Click on the photo to enlarge it.

You will find a modified *.ino (ESP32-radio_srv.ino) file on the Downloads section, the rest of the source code and programming libraries are available from https://github.com/Edzelf/ESP32-radio.

NOTE: THIS IS A MODIFIED ESP32 Radio VERSION THAT SUPPORTS A WIRED ETHERNET CONNECTION by PC USB PROJECTS. Firmware updates and ArduinOTA are disabled to prevent updating with a unsuitable firmware from the Internet. Alter SPI.cpp library to comment or remove the last program line, like this: "// SPIClass SPI(HSPI);" to be enable VSPI bus to be replaced by HSPI bus to support LAN8720A Network module (sample path: C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\

hardware\esp32\1.0.4\libraries\SPI\src).

LEGO casing: Click on the photo to enlarge it.

Arduino IDE - adding code for SHARP GP1UX511QS IR receiver: Click on the screenshot to enlarge it.

LEGO casing (updated version): Click on the photo to enlarge it.