A long time ago I bought an ESP32 module off of Ebay. I can’t really remember what for, but I did.
These things are dirt cheap, costing something like 4-5€ with shipping and feature a 32 bit dual core processor, plenty of flash and RAM and a wireless module supporting both WiFi and Bluetooth. They also sport a lot of GPIO and there is official Arduino support from the manufacturer ( https://github.com/espressif/arduino-esp32 ), so programming them is very easy. In fact, here is a guide to flashing the module with the Arduino IDE.
So the module arrived a couple of months later, in typical China-to-Greece-by-post fashion. By that time I had literally forgotten what I had bought it for. So it then lay there in a drawer for 4 or 5 years until I randomly came across an article that mentioned that it can output I2S! That was news to me, and obviously interesting.
After a brief google search I came across this project: https://how2electronics.com/simple-esp32-internet-web-radio-with-oled-display/ which then led me to this very cute library: https://github.com/schreibfaul1/ESP32-audioI2S
So I entered my favorite internet radio’s URL, plus my WiFi credentials into the code and loaded it to my ESP32 using the Arduino IDE. Surely enough, I saw in my serial port that the ESP32 connected to my WiFi access point and then opened successfully the streaming radio station. I could see on my oscilloscope that it was indeed outputting I2S. Excellent!
Then I hooked up a tiny DAC board that I had lying around (sporting an ES9023 chip – very practical since the ESP32 does not output an MCLK signal), and the thing worked flawlessly on the first try!
So I thought that I should do a carrier board for the ESP32 that would perform the following:
- Host the ESP32 board,
- Provide regulated power to the ESP32,
- Provide headers for serial port (programming), SD card, extra I/O, and perhaps for an LCD,
- Do galvanic isolation of the I2S signals,
- Provide buffered I2S output for connecting to an outboard DAC board,
- Have an on-board DAC with line level outputs.
Since this device would only stream internet radio (a.k.a. “heavily compressed audio”), the on-board DAC did not have to be anything special. So let’s go with the all time classic ES9023.
Let’s also do a relatively good power supply for the critical component (dac chip) but nothing extreme. The rest of the audio-related components can be powered by well respected LP5907 LDOs, while the actual ESP32 can be powered by a run-of-the-mill LM1117.
So this is what I came up with:
Gerbers were generated ( ESP32_DAC_v1_Gerbers (4550 downloads ) ) and an order was put into a well known Chinese board manufacturer.
A couple of weeks later the boards turned up:
Here is the complete Bill of Materials for this board: ESP32_DAC_v1_BoM (6113 downloads )
A suitable power supply was also implemented and integrated into a proper case:
And here is the completed device in action:
This was a pretty simple and relatively low cost project, an ideal way to keep busy for a couple of winter evenings.
Also it is a good way to listen to high fidelity internet radio without needing to keep an entire PC and DAC powered up. So it’s good for the environment.
It would not be difficult to add an LCD that would display the artist and track that is playing.. perhaps sometime in the future.