ESP32 Meshed Audio player

This website explains you how to build a meshed audio player. The idea of the project is to build small-scale DIY sound machines that can be used for both artistic installations and activism.
If you build multitrack files with a lot of silence, you could disturb a rather large space with short bursts of sound. I chose to run my speakers with exciters/transducers, as it makes the project way smaller. Furthermore, it allows us to play sounds that make an object vibrate instead of a membrane, which makes it easier to hide the audio players.
The project runs off SD-cards on multiple ESP32's, with a cost per "node" of around 20-30 euros. You can reduce the cost & ecological footprint by using recycled batteries, but this is beyond the scope of this tutoiral.
As a remark before we start: within this tutorial we construct it using a built-in amp that runs off the 5V USB voltage. You could also choose for a line output (like adafruit UDA1334A) and an external amp, but would probably need higher voltage for the amp which makes the project bigger and more bulky.

First of all you will need some parts. Here's a small list of parts. I sourced most from amazon & aliexpress, as it's very hard to source electronics parts elsewhere ლ(╹◡╹ლ)
-ESP32 : AZDelivery that has a 5V out pin for easy voltage for micro SD.
-Adafruit MicroSD Breakout board.
-Micro SD card (32 Gb MAX)
- MAX98357A I2S amp.
-a PCB button
-perfboard, I used these small sized ones as they fit everything perfectly.
-a battery system. The ESP32 can run off a normal powerbank, or you can build your own small battery system using the following and an 18650 cell.
-some wire and some solder
-optionally an LED and a 220 or 270 ohm resistor.

Micro SD Position Micro SD Soldering on Micro SD

We start with soldering the MicroSD card. Solder on the micro SD pins and then place it in the middle of the perfboard on one side. You can solder it on directly. There should be 3 free pins on each side of the perfboard so the micro SD is perfectly centered.

Position ESP32 Position ESP32 Position ESP32

Now we can solder on the ESP32. Take care in how you position it. The USB input should point the other way as the Micro SD breakout. You can't insert the pins fully, as there is not enough space on the perfboard and we want our audip player to stay small.
Go ahead and solder on the pins on the four corners of the ESP32, just to keep it in place.

Position ESP32 Position ESP32

We can now connect the first wire, which will provide the MicroSD board with it's necessary voltage. I do this by first adding some extra solder in the hole just next to the two pins we want to connect. Go ahead and fill hole T11 and B11. This way the wire has some extra structural integrity. Now connect hole T12 with hole A11 using a red wire, so we know it's voltage in.

Position ESP32 Position ESP32

We now solder on the next wire, which connects the micro CLK on the ESP32's GPIO 18. On the underside of the PCB, this means we connect A8 with J2. I added solder in the holes next to it again.
data that is exchanged between the ESP32 and the micro SD card go over a protocol titled SPI. This wire shares a common clock between the two PCB's, so the data is synchronised.

Voorbeeldfoto 2
PAD A7 to I2, PAD A6 to C2 and PAD A5 to K2

We can now solder on the rest of the SPI lines, as indicated in the image above. We are connecting the following:
-MISO (D0): Master input slave output, this sends date from the SD card to ESP32.
-MOSI (D1): Master output slave input, this controls the SD card from ESP32.
-CS: the chip select that tells the SD-card to wake up.

Position I2S AMP Position I2S AMP

We can now solder on the I2S amp. Take care to position it correctly, as we will build direct solder bridges to the pins next to it. Vin should be on F14. This way LRC can be directly bridged to GPIO27. Go ahead and solder on all the legs of the break-out.

Voorbeeldfoto 2
Bridge the power for the I2S AMP

We will now make a power trace to power the I2S amp. Connect B12 to F14 by either building up solder or running a wire. Take care to not bridge the gap with the SD-card voltage in, as it will power our 3.3v pin on the ESP32 with 5v, which might ruin it!

Voorbeeldfoto 2
Bridge the data connections for the I2S amp

We can now bridge the other lines for the I2S amp. These are:
-I2S LRC: the clock, which explains to the amp which part of the data is for the Left or Right channel
-I2S BCLK: the clock signal which synchonises the individual bits, so the data doesn't get jumbled
-I2S data: the actual data which contains the music.

We are now nearing the end and only need to attach the button and I2S ground still.

Position I2S AMP Position I2S AMP Position I2S AMP

Place the button in such a way that it will connect Ground with pin 13. Seeing I didn't have a button, I ended up using a switch. Run the traces so pin 13 is on the input and GND on the other side. I added an extra trace for safety. As soon as the button is connected, you can also run a trace from the GROUND of the I2S amp on PAD G14 to the ground of the button on PAD O14.

You are now finished. The steps below are an extra for connectivity, but the ESP32 should now be able to make sound once we upload the code.
Below the optional LED:

Position I2S AMP Position I2S AMP Position I2S AMP

An LED has two legs. The longest one indicates the positive leg. You can place the long let in PAD M1 and bend it to connect it with PAD M2 or pin 16 on the ESP32. Solder the shorter leg, or the negative one on PAD L1 and bend it towards PAD I1. Insert a 270 ohm resistor in pad I1 and H1 by bending it vertically. Use one leg of the resistor to bridge towards GND on the ESP32 on pad H2. Snip off the other legs.

Position I2S AMP Position I2S AMP

You have now finished soldering and we only need to upload the code. To connect to an ESP32, you have to install Arduino IDE and the proper drivers for your ESP32 type. Below is the code you can upload to the ESP32s, which will make them connect to eachother automatically.
As you can read from the code, the ESP32's LED will blink up onto the point it managed to connect itself with another ESP32, and as soon as they are meshed, pushing the button will start playback after the amount of seconds you specified (standard 5)
After this, you can connect a speaker. I used small exciters for this projecet from the brand Dayton audio. They make 3W ones, which are perfectly compatible with this amp & size.

Loading code…

2025 - ESP32 mesh audio network