Log in

Building My Own ESP32 Voice Assistant – Part 7: Soldering and the First Sound

B By Bisonar Team · 13 min · 2026-11-10

Building My Own ESP32 Voice Assistant – Part 7: Soldering and the First Sound

This is part 7 of an ongoing series in which I build my own ESP32 voice assistant. I add new parts as the components arrive and the project moves forward.

Türkçe versiyonu

In Part 6 I gave my assistant its own name: "Hello Bex". Bex now hears me on the first try and runs my commands, but it still can't talk. In this part I give it a voice.

The speaker arrived

The first part out of the box was the speaker: a small 4 cm, 4 Ω, 3 W speaker. The label on the back says "XLY, 4Ω 3W, D43".

Back of the speaker: 4Ω 3W

The first thing I did was check that it fits the case. The speaker sits perfectly in its slot in the 3D-printed body:

The speaker in its slot in the case, from above

The speaker in its slot in the case, from the side

With the case closed, there is still plenty of room inside for the magnet and the solder tabs:

Closed case with the speaker inside

The amplifier arrived: MAX98357A

I can't connect the speaker straight to the ESP32. The ESP32 outputs audio digitally over I2S, and it can't supply enough current to drive a speaker. The MAX98357A sits in between: it takes the I2S data, turns it into analog audio and drives the speaker as a small class D amplifier.

The board I got is a MAX98357A module labelled HW-792. The pin header and the screw terminal for the speaker came soldered from the factory, so there was nothing for me to solder on this board. There are seven pins on top: Vin, GND, SD, GAIN, DIN, BCLK, LRC. The speaker's + and − wires are screwed into the green terminal:

MAX98357A module from the front: seven pins and the speaker terminal

The specs are printed on the back: 4–8 Ω, 3 W, supply 2.5–5.5 V, default gain 9 dB, output (L+R)/2, which means mono audio that is the average of the left and right channels. My speaker is 4 Ω and 3 W, so they are a perfect match:

Back of the MAX98357A: 4-8Ω 3W, Vin 2.5-5.5V, 9 dB gain

The GAIN pin sets the volume, and the SD pin turns the amplifier on or off:

GAIN connection Gain
Not connected 9 dB
Straight to GND 12 dB
To GND through 100 kΩ 15 dB

I left SD unconnected. The board has a resistor that keeps this pin on, so the amplifier runs by itself. If SD were connected to GND, the amplifier would turn off. At first I also left GAIN unconnected, which gives 9 dB. The schematic has a 100 kΩ resistor between GAIN and GND, but the resistors I found in my drawer were 1 kΩ, 2.2 kΩ and 320 kΩ. To the amplifier, 1 kΩ and 2.2 kΩ look the same as a direct connection to GND, and 320 kΩ is not a value the datasheet defines. So none of them gives 15 dB.

Soldering

First, removing the pin headers

My ESP32 DevKit came with its pin headers soldered on. That was fine for the breadboard, but there is no room for them inside the case, so the wires have to be soldered straight into the board's holes. The first job was removing the headers. I clamped the board in a helping-hands stand and, under the magnifier, heated each pin with the soldering iron and pulled it out with pliers, one by one:

Removing the ESP32's pin headers: helping hands, magnifier, soldering iron and pliers

This takes patience. If a pin won't come out, you have to stop and let the pad cool down, otherwise the pad lifts. The pins I removed:

The pin headers removed from the board

Microphone: INMP441

The first part I soldered was the microphone. On the breadboard I had used the INMP441 with a pin header, but there is no room for a header inside the case. So I soldered the wires straight to the six pads of the board. The pad names are printed on the board: GND, VDD, SD on the top row and L/R, WS, SCK on the bottom row. The hole in the middle is the microphone's sound inlet, so it must stay uncovered:

The soldered pads of the INMP441: GND, VDD, SD, L/R, WS, SCK

Each of the six pads gets one wire. From the side, the wires and the solder joints look like this:

Wires soldered to the INMP441, from the side

The wires go to the same ESP32 pins as in the ESPHome configuration (mic-test.yaml):

INMP441 ESP32
SCK GPIO25
WS GPIO14 (GPIO26 burned while soldering)
SD GPIO33
VDD 3V3
GND GND
L/R GND (left channel)

There was an accident while soldering: the ESP32's GPIO26 pad got too hot and burned. I soldered the WS wire to the free GPIO14 instead and changed i2s_lrclk_pin to GPIO14 in the ESPHome configuration. The amplifier's LRC shares the same line, so it goes to GPIO14 too. GPIO14 outputs a short signal at boot, but that is not a problem for the I2S line.

i2s_audio:
  - id: i2s_in
    i2s_lrclk_pin: GPIO14   # was GPIO26, the pad burned while soldering
    i2s_bclk_pin: GPIO25

This is the microphone wired to the ESP32. The wires are kept short, and the ESP32 is held in the helping hands:

The INMP441 soldered to the ESP32 with its wires

The wires soldered to the ESP32, close up

Up close you can see the burned pad. The hole above the D26 label is empty, and the copper ring around it is damaged. There are also brown heat marks along the edge of the board. The WS wire now goes to D14 (GPIO14), two pins to the left:

The burned GPIO26 pad: the hole above D26 is empty and the ring is damaged

I didn't use anything special for this: an ordinary soldering iron and the thin single-core wire I had at home. I don't recommend that wire. It isn't very flexible and is hard to bend inside the case. If you can, use soft silicone-insulated wire. It fits much more easily in a small case.

Amplifier and ESP32

The amplifier uses the same I2S line as the microphone. The clock signals (BCLK and LRC) are shared, only the data line is separate. The only new pins I soldered on the ESP32 were GPIO27 (audio data) and VIN (5 V):

MAX98357A ESP32 Note
BCLK GPIO25 Shared with the microphone's SCK
LRC GPIO14 Shared with the microphone's WS
DIN GPIO27 New pin
Vin VIN (5 V) New pin, not 3V3
GND GND
SD Not connected
GAIN First not connected (9 dB), then straight to GND (12 dB) Will go to 15 dB with 100 kΩ

I connected Vin to VIN on purpose, not to 3V3. The amplifier also works at 3.3 V, but the current it draws at high volume would strain the ESP32's 3.3 V regulator. As you'll see in a moment, current caused trouble even at 5 V.

The speaker's two wires are screwed into the amplifier's green terminal. With a single speaker, the + and − direction doesn't matter.

I didn't push the amplifier's BCLK and LRC wires into the same holes on the ESP32. Instead I stripped a short section in the middle of the microphone's SCK and WS wires and soldered the amplifier's wires there, making a splice. I covered the bare copper with heat-shrink tubing. That way each hole on the ESP32 takes a single wire, and the pad doesn't get heated a second time.

Microphone test after soldering

I flashed the new configuration over USB and watched the logs. The board booted, connected to Wi-Fi and to Home Assistant, and loaded Hello Bex as the wake word.

The microphone's average sound level (RMS) in a quiet room was between −37 and −48 dB. In the breadboard test the range was −51 to −34 dB. So soldering the wires straight to the pads didn't cost the microphone any sensitivity.

Then the real test: "Hello Bex", followed by "hava temizleyiciyi aç" ("turn on the air purifier"). Bex understood the command and the air purifier turned on. The speaker wasn't connected yet, so I couldn't hear the answer, but the microphone side still works after soldering.

A small mistake: on the first try I flashed the wrong file, the old "Hey Jarvis" configuration (esp32-assist.yaml). I noticed when I saw Wake Word: Hey Jarvis in the logs, and flashed the right file, mic-test.yaml.

The first sound: "Hava temizleyici açıldı"

When I connected the amplifier and powered the board, the speaker only crackled. That was expected: the ESPHome configuration had no speaker yet, and the amplifier's DIN pin was floating, so it played noise. Sound came only after I solved three problems.

1. Adding the speaker to the configuration

The first step was telling ESPHome about the speaker. It uses the same I2S line as the microphone (i2s_in) and outputs audio on GPIO27:

speaker:
  - platform: i2s_audio
    id: hoparlor
    i2s_audio_id: i2s_in
    dac_type: external
    i2s_dout_pin: GPIO27   # MAX98357A DIN
    channel: mono
    bits_per_sample: 32bit
    sample_rate: 16000
    timeout: 2s

voice_assistant:
  id: va
  microphone:
    microphone: mic
  speaker: hoparlor

The crackle stopped. I said "Hello Bex, bugün hava kaç derece" ("what's the temperature today"), and there was no sound.

2. "Parent bus is busy": the microphone won't let go of the line

The logs showed that Home Assistant understood the question and sent the answer audio to the board. But the speaker gave the same error every second:

[E][i2s_audio.speaker.std:427]: Parent bus is busy
[E][i2s_audio.speaker:142]: Driver failed to start; retrying in 1 second

The microphone and the speaker share the same I2S line, but they can't both use it at the same time. In my test configuration the microphone never stopped. Both the wake word listener (stop_after_detection: false) and the sound level sensor from Part 2 (passive: false) kept the microphone running all the time. The speaker never got its turn.

The fix was to release the microphone during the answer:

sensor:
  - platform: sound_level
    passive: true             # don't keep the microphone running by itself

micro_wake_word:
  stop_after_detection: true  # stop listening once "Hello Bex" is heard

On my first try I restarted the wake word listener in on_end, when Home Assistant had finished its work. That wasn't enough either. The answer audio comes from Home Assistant in chunks and keeps coming after on_end. The speaker waited for the first chunk, stopped after half a second, and the microphone grabbed the line in the meantime. The right moment is when the audio stream ends (on_tts_stream_end):

  on_tts_stream_end:
    - wait_until:
        not:
          speaker.is_playing: hoparlor
    - micro_wake_word.start:

The speaker's timeout: 2s setting keeps it from stopping between chunks. After this, Bex spoke for the first time: "Hava temizleyici açıldı" ("the air purifier is on"). But it was very quiet. I could only hear it with my ear right next to the speaker.

3. Low current: Bex stops at the start of the sentence

In one of the earlier tries, the board had restarted the moment the speaker began to play. So I had temporarily lowered the volume to 50%, which is why it was so quiet. I made the volume adjustable from Home Assistant, so I don't have to reflash for it:

number:
  - platform: template
    name: "Hoparlör sesi"
    id: hoparlor_sesi
    optimistic: true
    restore_value: true
    min_value: 10
    max_value: 100
    step: 5
    initial_value: 100
    on_value:
      - speaker.volume_set:
          id: hoparlor
          volume: !lambda return x / 100.0;

I turned the volume up to 100%. Bex said "Ha…" and went silent. The logs show the answer arriving, the speaker starting and, right after that, Serial port closed!. The board had reset at the start of the sentence.

The cause was power. The board was plugged into my Mac's USB port, and that port supplies limited current. At high volume the amplifier draws short but large bursts of current, the 5 V line drops and the ESP32 restarts. At 50% the current was enough, at 100% it wasn't.

I plugged the board into an old phone charger I had at home: a Sony CP-AD2 with a 5 V, 2.1 A output. This time Bex finished the sentence at 100% volume, and the board didn't reset.

Label of the Sony CP-AD2 charger: 5 V, 2.1 A output

I placed all the parts in the bottom half of the case: the speaker in the middle, the microphone and the amplifier with the green terminal on the left, and the ESP32 with the USB cable on the right:

The speaker, INMP441, MAX98357A and ESP32 in the bottom half of the case

And the first conversation. In the video I first say "Hello Bex, hava temizleyiciyi kapat" ("turn off the air purifier"), and Bex answers from the speaker: "Hava temizleyici kapatıldı" ("the air purifier is off"). Then I try the same with "aç" ("on"):

▶️ Watch the video with sound

The sound was coming through, but it was still a bit quiet. So I connected the amplifier's GAIN pin straight to GND with a short wire, raising the gain from 9 dB to 12 dB. The sound got noticeably louder.

The next step is to find a 100 kΩ resistor and connect GAIN to GND through it. That will raise the gain to 15 dB. The sound will also get louder once the case is closed, because the closed case works like a small speaker box.

What I learned in this part

  • Remove pins patiently. A pad that gets too hot burns. That's how I lost GPIO26. Luckily the ESP32 has plenty of free pins.
  • If the microphone and the speaker share one I2S line, they can't both run at the same time. The microphone has to be released while the answer plays. That's what the "Parent bus is busy" error is telling you.
  • The answer audio keeps arriving after on_end. Restart the microphone when the audio stream ends (on_tts_stream_end) and the speaker has gone quiet.
  • A computer's USB port may not be enough for an amplifier. If the board resets for no clear reason, check the power supply first. A 2.1 A phone charger solved it.
  • The logs tell you everything. Every answer was in the ESPHome logs: the wrong wake word, the busy line, the USB disconnect.

What's next?

Bex can now hear and talk. Next up: closing the case and turning the volume up a little more with a 100 kΩ resistor. If I come across an LED strip, I'll add it in a separate part.

💻 The full ESPHome configuration from this part is on GitHub: https://github.com/justicemilitia/bisonar-ai/blob/main/esp32-voice-assistant/code/mic-test.yaml

🛠️ Step-by-step guide on Instructables: https://www.instructables.com/DIY-ESP32-Voice-Assistant-for-Home-Assistant-With-/

Parts of the series


Case design: ImpatientMaker (a remix of JakeB's "Voice Assist Puck"), CC BY-NC 4.0. ESPHome code: impatientmaker/esphome-voice-assist (MIT). Full credits in Part 1.

AI Automationn8nBusiness
Share:
← Back to Blog