A Bluetooth player for old speakers, built with an ESP32 and a PCM5102 DAC
I came across a build write-up that shows nicely how a perfectly usable audio system can be made from spare parts. The author, writing on Habr, had kept two 50-watt Yamaha speakers on a shelf for years, and a board with an ESP32 lying in a desk drawer. He decided to combine them and build a Bluetooth player of his own.
The core of the device is an ESP32 WROOM-32 module, which handles Bluetooth and the peripherals, and a GY-PCM5102 DAC that receives audio over the I2S interface. Volume and pause are controlled by a rotary encoder, and an OLED screen shows a spectrum visualisation. He chose the XH-A232 amplifier simply because he already had it. Its peak output is 30 watts per channel against the speakers' nominal 50 watts, but he says that is plenty of volume for a single room.
The most interesting part for me is the small details that are rarely written about. A voltage divider sits between the ESP32 and the DAC, reducing the DAC output from 2.1 V to 0.27 V RMS, because otherwise the amplifier overloads and hisses. The ratio was found by experiment, and he warns that a different amplifier may need a different value.
Another problem was digital noise from powering the DAC and the ESP32 from a common supply. The fix was to power them from separate converters. Keeping the wires between the DAC and the amplifier short and twisted also helped, and two 0.1 µF ceramic capacitors after the DAC made a difference.
The software is built on PlatformIO with the arduino-audio-tools and ESP32-A2DP libraries, so there was no need to write the low-level A2DP audio transfer himself. He has published the code on GitHub. It is a good example of how cheap modules can become something useful, and how you can learn where noise comes from along the way.
Source: Habr
The core of the device is an ESP32 WROOM-32 module, which handles Bluetooth and the peripherals, and a GY-PCM5102 DAC that receives audio over the I2S interface. Volume and pause are controlled by a rotary encoder, and an OLED screen shows a spectrum visualisation. He chose the XH-A232 amplifier simply because he already had it. Its peak output is 30 watts per channel against the speakers' nominal 50 watts, but he says that is plenty of volume for a single room.
The most interesting part for me is the small details that are rarely written about. A voltage divider sits between the ESP32 and the DAC, reducing the DAC output from 2.1 V to 0.27 V RMS, because otherwise the amplifier overloads and hisses. The ratio was found by experiment, and he warns that a different amplifier may need a different value.
Another problem was digital noise from powering the DAC and the ESP32 from a common supply. The fix was to power them from separate converters. Keeping the wires between the DAC and the amplifier short and twisted also helped, and two 0.1 µF ceramic capacitors after the DAC made a difference.
The software is built on PlatformIO with the arduino-audio-tools and ESP32-A2DP libraries, so there was no need to write the low-level A2DP audio transfer himself. He has published the code on GitHub. It is a good example of how cheap modules can become something useful, and how you can learn where noise comes from along the way.
Source: Habr
Comments 0
Leave the first comment, in any language.
Log in to comment