ESP32 Bit Pirate home
  • I2S
  • Beginner
  • 5 min
  • Audio

Recipe · Beginner · I2S

How to test an I2S microphone or speaker

I2S mode gives quick audio sanity checks before writing an audio sketch.

I2S audio signal between microphone and speaker.
Start with test commands: they answer “is the wiring alive?” faster than a custom firmware build.

Wiring View

I2S module BP BCLKI2S BCLKLRCK / WSI2S LRCKDATAI2S DATAVCC3.3VGNDGND
Generated from the wiring summary: I2S module to BP.
Step 1

Commands

The first mode entry asks for BCLK, LRCK, DATA and sample settings. Use a mic test for input, speaker test or a short tone for output.

Result

What it means

A moving amplitude and non-zero peak-to-peak value means the microphone is producing samples.

Troubleshooting

  • BCLK and LRCK swapped.
  • Using an analog microphone on an I2S workflow.
  • Wrong DATA direction: mic input versus amplifier output.
  • Audio module powered at the wrong voltage.

Next steps

  • Use record to watch live level changes.
  • Use play 1000 500 as a repeatable speaker check.
  • Write down BCLK, LRCK, DATA, sample rate and bit depth for the final firmware.

I2S microphone and speaker test FAQ

Can one wiring setup test both mic and speaker?

Only if the modules and pins are wired for the correct direction. A microphone sends DATA to the ESP32, while a DAC or amplifier receives DATA from the ESP32.

What does test speaker verify?

It plays known patterns or tones so you can confirm I2S output clocks, data, power and the speaker path before using application audio.

Why should I run reset after input tests?

reset returns the I2S workflow to output mode, which avoids confusing later speaker or tone tests after microphone recording.

Go deeper