ESP32-S3-dat no DAC - No Problem! We'll Use PDM
https://www.atomic14.com/2024/01/05/esp32-s3-no-pins
chip
wiring
Unlike standard I2S which requires 3 signal wires (BCLK, WS, DATA), PDM only requires 2 signal wires.
| MSM261DGT003 Pin | ESP32 Pin / Connection | Function |
|---|---|---|
| VDD | 3.3V | Power (1.8V to 3.3V supported) |
| GND | GND | Ground |
| CLK | GPIO (e.g., GPIO 22) | Clock signal generated by ESP32 |
| DATA | GPIO (e.g., GPIO 23) | Digital audio data sent to ESP32 |
| LR | GND or 3.3V | Selection: GND = Left, 3.3V = Right |
2. Why the "WS" Pin is Missing
In PDM microphones like the MSM261DGT003:
- The CLK pin handles the timing.
- The LR pin is a static configuration pin (tied to GND or High).
- The ESP32 knows which channel is which based on whether the data is sampled on the rising edge or falling edge of the clock.
- Because of this, you do not need a Word Select (WS) pin.
3. ESP32 Software Configuration
To use this specific microphone, you must tell the ESP32 to enable its internal PDM-to-PCM decimation filter. If you configure it as "Standard I2S," you will only hear high-pitched digital noise.
Arduino/ESP-IDF Example Configuration:
i2s_config_t i2s_config = {
.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_PDM), // <--- MUST include I2S_MODE_PDM
.sample_rate = 44100,
.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
.communication_format = I2S_COMM_FORMAT_STAND_I2S,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
.dma_buf_count = 8,
.dma_buf_len = 64,
.use_apll = false
};