Skip to content

Connecting an INMP441 to the WLED Controller#

With a digital I2S microphone, WLED reacts to music and sound in the room. This guide covers connecting an INMP441 to the cod.m WLED Controller V0.10.

No modification of the circuit is needed: the back of the board carries solder pads giving access to free GPIOs as well as 3.3 V and GND. They are labelled there with their GPIO number.

Back of the cod.m WLED Controller V0.10 with the labelled solder pads
Back of the controller – the row of labelled solder pads on the right

Requirements

  • cod.m WLED Controller V0.10 (ESP32)
  • INMP441 breakout module – available in packs of three for €5 to €7
  • WLED 0.15 or newer – the official builds already include the AudioReactive usermod
  • Soldering iron with a fine tip, thin stranded wire (e.g. 0.14 mm²), a steady hand

Why the INMP441#

The INMP441 is a digital I2S microphone with an integrated analog-to-digital converter. It delivers a clean digital signal and is clearly superior to analog microphones such as the MAX4466 – the ESP32's own ADC is only partly suited to audio and is sensitive to noise from the power supply.

For background, see the WLED documentation on Audio Reactive.

Solder pads on the back#

Five of the solder pads are needed:

Solder pads for the INMP441 on the back of the cod.m WLED Controller V0.10
Position of the required solder pads, viewed from the back
Pad INMP441 Function
3V3 VDD 3.3 V supply
GND GND Ground
IO27 SCK Bit clock
IO26 WS Word select (L/R clock)
IO25 SD Data output of the microphone

The pads are labelled on the board. The same row also carries IO12 and IO14, which are not needed here.

Connections on the microphone#

The microphone module carries its labels on the side with the sound port. The upper row is printed upside down there – worth a second look when wiring.

Pinout of the INMP441 and how it maps to the controller's solder pads
Labelled side of the INMP441 with the mapping to the controller pads

L/R is not run to the controller but bridged to GND directly on the module. WLED evaluates the left channel only; without that link the signal stays silent.

The sound port is on the labelled side

The INMP441 is a bottom-port microphone: sound enters through the small hole next to the microphone symbol, not through the component on the opposite side. That side later faces outwards – so solder the wires on the component side, where they will not be in the way when gluing.

Do not use IO12

GPIO 12 selects the flash voltage when the ESP32 boots. If it is held high at power-up, the controller may fail to start. Use IO27, IO26 and IO25 for the microphone instead.

Wiring#

  1. Disconnect the controller from power and take it out of its enclosure.
  2. Cut five wires to length, depending on where the microphone will sit – as short as possible, 5 to 10 cm is usually plenty. The longer the wires, the more interference you pick up.
  3. Solder them to the microphone module: VDD, GND, SCK, WS, SD, plus the link from L/R to GND.
  4. Solder the wires to the pads on the back of the controller. The pads are small and 1.8 mm apart – use little solder and check for bridges between neighbouring pads afterwards.
  5. Check your connections with a multimeter before switching on, especially between 3.3 V and GND.

Mounting in the enclosure#

A microphone sealed inside the case barely hears anything – sound has to reach the INMP441's port from outside. What works well is drilling a hole in the back of the enclosure and gluing the module to the inside so that its port sits right behind it.

  1. Find the position. Hold the module against the inside of the enclosure with its labelled side – the one carrying the sound port – facing out, and mark the spot.
  2. Drill. 2 to 3 mm is plenty. Drill slowly and back the enclosure with a piece of scrap, otherwise the plastic tears out on the exit side. Deburr by hand with a larger bit.
  3. Align and glue. Position the module so that the sound port is centred over the hole. Apply adhesive only at the corners or along the edge of the board – never over the port.
  4. Let it cure before reassembling the controller.

Tips from practice

  • Adhesive: Hot glue or double-sided foam tape both work well and can be removed again. Avoid cyanoacrylate – the fumes settle on the microphone membrane and damp it permanently.
  • Sealed, not blocked: A thin bead of adhesive around the port stops sound from leaking past the microphone sideways. It noticeably improves directionality.
  • Distance from the electronics: Keep it as far as possible from the switching regulator (towards the connector) and the LED data line. Both radiate, and a couple of centimetres make an audible difference.
  • Test first: Fix it temporarily, set the levels and listen to whether the response is right. Glue afterwards.

Configuration in WLED#

  1. Open the web interface, go to Config → Usermods and scroll to the Digitalmic block within the AudioReactive section.
  2. Set Type to Generic I2S.
  3. Enter the pins:

    • Pin I2S SD to 25
    • Pin I2S WS to 26
    • Pin I2S SCK to 27
  4. Leave Pin I2S MCLK at unused. The master clock is only needed for line-in adapters, not for the INMP441.

  5. Save.
  6. Perform a hard reset – either with the RST button on the board or by disconnecting power. The I2S driver is only set up at boot; without a restart the old configuration stays active. WLED points this out with requires reboot! next to the field.
WLED AudioReactive settings for the INMP441
The Digitalmic block with the settings for the INMP441

Setting the levels#

After the restart the LEDs should react to sound. This procedure has proven reliable for dialling it in:

  1. Select the Gravimeter effect and leave its sliders at their defaults.
  2. Under Config → Usermods → AudioReactive set Gain high (around 200), Squelch to 1 and turn AGC off. Save.
  3. The LEDs now react to almost anything, including ambient noise.
  4. In a quiet room, raise Squelch step by step, saving each time, until the LEDs stop moving in silence. For digital microphones the value is usually between 1 and 20.
  5. Lower Gain to around 40, play music at normal volume and adjust until the response feels right.
  6. Optionally set AGC to Normal – the gain is then adjusted automatically as the volume changes.

If it does not work#

No reaction at all. First check that a hardware reset really happened after changing the pins. Then check the link from L/R to GND.

The controller no longer boots. Check whether GPIO 12 was used by mistake, or whether there is a solder bridge between neighbouring pads.

LEDs flicker in silence. Raise Squelch. If that does not settle it, the wires are too long or run too close to the LED data line.

Only one controller should carry the microphone. WLED can distribute the audio data over the network: set one device to Send and all others to Receive. See the WLED documentation for details.