The SPH0645 MEMS microphone is a compact digital audio sensor designed for voice recognition, sound detection, and audio recording applications. Featuring an I2S digital output interface, it allows microcontrollers such as the ESP32 and computers such as the Raspberry Pi to capture sound without requiring an external ADC. In this guide, we will explore the SPH0645LM4H module overview, technical specifications, differences from analog electret microphones, wiring connections, ESP32 Arduino code, and comparison with the INMP441 to help you integrate digital audio capture into your next electronics project.
1. SPH0645 MEMS Module Overview
2. SPH0645 vs Analog Electret Microphone
3. SPH0645LM4H Module Technical Specifications
6. ESP32 Arduino Code: I2S Audio Capture

The SPH0645 is a digital MEMS microphone designed to capture sound and deliver audio data directly to a microcontroller or single-board computer. Unlike traditional analog microphones, which produce a small analog voltage that usually requires amplification and analog-to-digital conversion, this module integrates signal conditioning and an ADC to provide digital audio output through an I2S interface.
A microphone converts sound waves into electrical signals. When sound reaches the MEMS sensing element, the resulting changes are processed by the internal circuitry and converted into digital samples. These samples can then be read by a compatible processor for audio recording, voice detection, sound analysis, and speech-processing applications.
The SPH0645LM4H uses three main digital signals: Bit Clock (BCLK), Word Select (WS or LRCLK), and Data Output (DOUT). The connected processor supplies the clock signals and receives the audio stream. This digital interface helps reduce the analog noise problems associated with long signal paths and eliminates the need for a separate external ADC.
The microphone is compact, lightweight, and suitable for embedded systems where space and power consumption matter. Its typical audio frequency range is approximately 50 Hz to 15 kHz, making it suitable for general-purpose voice capture and basic audio recording. However, it is not a calibrated sound-level meter, so additional processing and calibration are required if the goal is to measure sound pressure levels accurately.
Because the SPH0645LM4H is a digital-only microphone, it is best suited to microcontrollers with I2S hardware, such as the ESP32, and computers such as the Raspberry Pi that support compatible digital audio interfaces.
Both SPH0645 MEMS microphones and traditional electret microphones convert sound into electrical signals, but they differ in their output format, internal circuitry, and integration requirements.
The SPH0645LM4H integrates a MEMS sensing element, signal-processing circuitry, and an analog-to-digital converter. It sends digital audio data directly to a compatible host through I2S. An analog electret microphone, by comparison, produces an analog signal that generally requires a bias circuit, amplification, and an ADC before a microcontroller can process the audio digitally.
The digital output of the SPH0645 reduces the need for external analog circuitry and can help limit noise introduced along analog signal paths. It is particularly useful for embedded voice interfaces, smart devices, and systems that already support I2S. Analog electret microphones remain useful for simple circuits, low-cost audio projects, and microcontrollers that have analog inputs but lack I2S support.
Parameter | SPH0645 MEMS Microphone | Analog Electret Microphone |
Output type | Digital I2S | Analog voltage |
Conversion | Integrated ADC | External ADC or analog input required |
External circuitry | Relatively simple | Often needs biasing and amplification |
Noise considerations | Avoids many analog signal-path noise issues | More susceptible to analog interference |
Interface | BCLK, WS, DOUT | Analog signal output |
Microcontroller compatibility | Requires compatible digital audio interface | Works with suitable analog input circuitry |
Typical applications | Voice interfaces, digital audio capture, embedded systems | Basic sound detection, analog recording, simple audio circuits |
For projects using the ESP32 or Raspberry Pi, the SPH0645 is a practical choice when prefer direct digital audio capture. For basic sound detection with an Arduino Uno, an analog microphone module is usually easier to integrate.

The SPH0645LM4H is a bottom-ported digital MEMS microphone with an I2S interface. It is designed to connect directly to compatible processors without requiring a separate analog microphone amplifier or external ADC. Its small form factor makes it suitable for compact audio-input designs.
Parameter | Specification |
Microphone type | MEMS digital microphone |
Model | SPH0645LM4H |
Output interface | I2S |
Audio frequency range | Approximately 50 Hz~15 kHz |
Output format | Digital audio data |
Audio channels | Mono microphone element |
Channel selection | Left or right using SEL |
Supply voltage | 1.6V~3.6V |
Recommended logic voltage | 3.3V |
Main signals | BCLK, WS/LRCLK, DOUT |
Port configuration | Bottom port |
External ADC | Not required |
Typical applications | Voice capture, sound detection, embedded audio |
Main Features
Digital I2S output: The microphone transmits digital audio samples through the I2S interface. The host reads the audio stream using compatible hardware, reducing the need for external analog conversion circuitry.
Compact MEMS design: Its small size and thin profile make it suitable for space-constrained electronics, portable devices, and embedded voice interfaces.
Selectable audio channel: The SEL pin determines whether the microphone transmits on the left or right I2S channel. Connecting SEL to GND selects the left channel in the wiring examples below; connecting it to the appropriate logic-high supply selects the right channel.
Low-voltage operation: The device operates from a supply within 1.6V~3.6V. A 3.3V supply is suitable for common ESP32 and Raspberry Pi setups, but a 5V supply must not be connected directly to the microphone's power pin.
Bottom-port sound pickup: The acoustic opening is located on the underside of the microphone. The board should mount so that this opening can receive sound through an unobstructed hole in the enclosure or mounting surface.
The ESP32 is a suitable platform for the SPH0645LM4H because it supports I2S audio input. The microphone sends digital audio samples to the ESP32, which can process them for voice recording, speech recognition, sound analysis, or transmission to another device.
The following connection uses GPIO 25 for the word-select clock, GPIO 32 for the bit clock, and GPIO 33 for audio data input.
ESP32 to SPH0645 connections
ESP32 pin | SPH0645 pin | Function |
3.3V | 3V | Power supply |
GND | GND | Ground |
GPIO 25 | LRCLK / WS | Word-select clock |
GPIO 32 | BCLK | Bit clock |
GPIO 33 | DOUT | Digital audio output |
— | SEL → GND | Select left channel |
Wiring Instructions
1. Connect the ESP32 3.3V pin to the microphone's 3V pin and connect both grounds.
2. Connect GPIO 25 to LRCLK/WS and GPIO 32 to BCLK.
3. Connect DOUT to GPIO 33 so the ESP32 can receive the audio stream.
4. Connect SEL to GND to select the left audio channel.
5. Make sure the microphone's bottom acoustic port is exposed to the sound source.
After wiring, configure the ESP32's I2S peripheral as a master receiver. It generates BCLK and WS and reads the digital audio samples from DOUT. The selected channel and sample format must match the microphone's output.
Important: The microphone uses 3.3V-compatible signals, not 5V logic. The code below uses the legacy ESP32 I2S driver available in Arduino-ESP32 2.x. If you use Arduino-ESP32 3.x, the I2S API has changed and the code needs to be adapted.
The Raspberry Pi can also receive digital audio from the SPH0645 using its PCM/I2S hardware interface. This connection is useful for voice-controlled applications, audio recording, sound classification, and other projects that benefit from Linux-based audio processing.
Raspberry Pi to SPH0645 connections
Raspberry Pi pin | GPIO / signal | SPH0645 pin |
Pin 1 | 3.3V | 3V |
Pin 6 | GND | GND |
Pin 35 | GPIO 19 / PCM_FS | LRCLK / WS |
Pin 12 | GPIO 18 / PCM_CLK | BCLK |
Pin 38 | GPIO 20 / PCM_DIN | DOUT |
— | GND | SEL |
Raspberry Pi Setup
Connect the microphone according to the table, making sure that all ground connections are secure. The Raspberry Pi supplies the clock signals and receives the audio data through its PCM interface.
The hardware wiring alone does not guarantee that audio capture will work. You must also configure the Raspberry Pi's audio interface and software to support the microphone. Depending on the Raspberry Pi model and operating-system version, this may involve enabling an I2S/PCM interface, configuring a device-tree overlay or audio driver, and selecting the appropriate capture device.
Once configured, audio can be recorded using compatible ALSA tools or applications. If no audio is captured, check the interface configuration, channel selection, clock signals, and device permissions before troubleshooting the microphone itself.
The following example configures the ESP32 to receive audio samples from the SPH0645 and prints sample values to the Serial Monitor. It uses the legacy driver/i2s.h API for Arduino-ESP32 2.x.
#include <Arduino.h>
#include "driver/i2s.h"
#define I2S_PORT I2S_NUM_0
#define I2S_BCLK 32
#define I2S_WS 25
#define I2S_DOUT 33
void setup() {
Serial.begin(115200);
i2s_config_t i2s_config = {
.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX),
.sample_rate = 16000,
.bits_per_sample = I2S_BITS_PER_SAMPLE_32BIT,
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
.communication_format = I2S_COMM_FORMAT_STAND_I2S,
.intr_alloc_flags = 0,
.dma_buf_count = 8,
.dma_buf_len = 128,
.use_apll = false,
.tx_desc_auto_clear = false,
.fixed_mclk = 0
};
i2s_pin_config_t pin_config = {
.bck_io_num = I2S_BCLK,
.ws_io_num = I2S_WS,
.data_out_num = I2S_PIN_NO_CHANGE,
.data_in_num = I2S_DOUT
};
esp_err_t err = i2s_driver_install(
I2S_PORT, &i2s_config, 0, NULL
);
if (err != ESP_OK) {
Serial.println("I2S driver installation failed");
while (true) {
delay(1000);
}
}
err = i2s_set_pin(I2S_PORT, &pin_config);
if (err != ESP_OK) {
Serial.println("I2S pin configuration failed");
while (true) {
delay(1000);
}
}
i2s_zero_dma_buffer(I2S_PORT);
Serial.println("SPH0645 audio capture started");
}
void loop() {
int32_t samples[128];
size_t bytes_read = 0;
esp_err_t err = i2s_read(
I2S_PORT,
samples,
sizeof(samples),
&bytes_read,
portMAX_DELAY
);
if (err == ESP_OK && bytes_read > 0) {
int count = bytes_read / sizeof(int32_t);
for (int i = 0; i < count; i++) {
// Approximate scaling for serial inspection.
int32_t audio_sample = samples[i] >> 14;
Serial.println(audio_sample);
}
}
}
How the Code Works
The code initializes the serial connection and configures I2S in master-receive mode. The ESP32 generates a 16 kHz sample clock and uses 32-bit receive slots to collect microphone data.
The i2s_read() function retrieves audio samples from the DMA buffer. The program then shifts each sample and prints its value to the Serial Monitor. This is intended for basic inspection of the incoming waveform, not for producing a calibrated audio signal.
The >> 14 operation is an approximate scaling choice for inspecting the data. Depending on the microphone's data alignment and the driver configuration, you may need to adjust the shift, extract the valid sample bits, and handle the channel format correctly. Confirm the actual sample alignment before using the output for audio playback or quantitative analysis.
For recording or speech recognition, avoid printing every sample over Serial because text output can limit the effective processing rate. Instead, store the samples in a buffer and pass them to a WAV recorder, streaming routine, or audio-processing library. Also ensure that the selected channel matches the SEL connection.
The INMP441 and SPH0645 are digital MEMS microphones that use I2S to transfer audio data directly to compatible microcontrollers. Both are suitable for embedded audio capture, voice interfaces, and sound-processing projects. They reduce the need for external analog circuitry, but should consider their acoustic specifications and implementation details when selecting a microphone.
The INMP441 has a specified signal-to-noise ratio of 61 dBA, sensitivity of -26 dBFS, and frequency response of 60 Hz to 15 kHz. Its typical operating current is 1.4 mA, and its supply voltage ranges from 1.8V to 3.3V. These specifications make it a practical option for low-power voice recording and near-field speech capture.
The SPH0645 also provides digital I2S output and supports left- or right-channel selection through its SEL pin. Its approximate frequency range of 50 Hz to 15 kHz makes it suitable for general audio capture. When comparing the two, check the manufacturer's specifications for noise performance, sensitivity, clock compatibility, and data alignment rather than assuming their performance is identical.
Parameter | INMP441 | SPH0645LM4H |
Microphone type | Digital MEMS | Digital MEMS |
Output interface | I2S | I2S |
Frequency response | 60 Hz~15 kHz | Approximately 50 Hz~15 kHz |
Signal-to-noise ratio | 61 dBA | Verify datasheet |
Sensitivity | -26 dBFS | Verify datasheet |
Operating current | 1.4 mA | Check device datasheet |
Supply voltage | 1.8V~3.3V | 1.6V~3.6V |
Channel selection | Model-specific configuration | SEL pin |
Suitable applications | Voice capture, embedded audio | Voice capture, embedded audio |
Which should you choose? The INMP441 is a good choice when its published sensitivity and noise specifications meet your requirements. The SPH0645 is also suitable for I2S audio projects, particularly when its electrical interface and physical layout fit the design. For either microphone, confirm software compatibility and sample alignment before integrating it into a recording system.
The standard Arduino Uno is not an ideal choice for the SPH0645 because it lacks a dedicated I2S peripheral. Although external hardware and software workarounds are possible, they add complexity and may limit audio performance. An ESP32, Arduino Zero, or another microcontroller with suitable I2S support is generally a better option.
The maximum supported sample rate depends on the microphone's datasheet specifications and the required I2S clock timing. A 16 kHz sample rate is suitable for basic speech capture, while higher rates may support broader audio applications. Always verify the permitted clock frequencies and configure the microcontroller accordingly before recording.
Distorted audio can result from incorrect I2S timing, mismatched channel selection, improper sample alignment, or incorrect conversion of received samples. Excessive digital gain can also cause clipping during later processing. Check the clock configuration, verify the SEL connection, inspect raw sample values, and confirm the valid audio bits before applying gain.
The SPH0645 can capture music and other general audio signals within its operating frequency range. However, its frequency response, noise characteristics, and overall recording quality may not satisfy demanding studio applications. It is more appropriate for embedded recording, interactive devices, and basic audio experiments than for professional music production.
No. The SPH0645LM4H operates within a supply range of 1.6V to 3.6V, so a 5V supply must not be connected directly to its power pin. Use a regulated 3.3V supply when connecting it to a compatible ESP32 or Raspberry Pi. Also verify signal-voltage compatibility to prevent damage.
Both microphones provide digital I2S audio output and can work with compatible ESP32-based systems. The INMP441 has specified sensitivity of -26 dBFS and an SNR of 61 dBA, while the SPH0645 has an approximate frequency range of 50 Hz to 15 kHz. Compare verified datasheet specifications and software compatibility before choosing either device.
The SPH0645 MEMS microphone provides a compact solution for adding digital audio input to embedded electronics. Its I2S interface simplifies integration with compatible processors, including the ESP32 and Raspberry Pi, while its channel-selection feature supports flexible audio configurations.
For successful implementation, use a suitable 3.3V supply, connect BCLK, WS, and DOUT correctly, and configure the host's I2S peripheral to match the microphone. Whether you are building a voice-controlled device, a sound-detection system, or a simple audio recorder, understanding the microphone's electrical requirements and digital data format will help you achieve reliable audio capture.
1. SPS30 Sensor: Complete Guide with Arduino, Specifications
2. RFM95W LoRa RF Transceiver Module 868 915 MHZ: Guide
3. BPW34 Photodiode: Datasheet, Pinout, and Alternative
2026-01-23
2025-12-14
2025-05-29
2025-06-30
2025-09-04
2025-07-28
2025-05-06
2025-09-05
2025-06-05
2026-03-26