Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Sensors & Modules

MEMS Microphone SPH0645: High Quality I2S Audio Capture with Arduino & Raspberry Pi

MEMS Microphone SPH0645: High Quality I2S Audio Capture with Arduino & Raspberry Pi

March 11, 2026 /Posted byJayesh Jain / 0

The SPH0645LM4H is a MEMS (Micro-Electro-Mechanical Systems) digital microphone module that outputs audio over the I2S (Inter-IC Sound) interface. For makers in India who want to add high-quality audio capture to their Arduino, ESP32, or Raspberry Pi projects — smart speakers, voice command systems, sound level monitors, or audio recorders — the SPH0645 is one of the best digital microphone modules available at an affordable price. This comprehensive tutorial covers everything from understanding I2S protocol to wiring, coding, and practical applications.

Table of Contents

  1. What is a MEMS Microphone?
  2. SPH0645 Module Overview
  3. Understanding I2S Protocol
  4. SPH0645 vs Analog Electret Microphone
  5. Technical Specifications
  6. Wiring to ESP32 (Recommended)
  7. Wiring to Raspberry Pi
  8. ESP32 Arduino Code: I2S Audio Capture
  9. Sound Level Meter Example
  10. Two Microphones: Stereo Setup
  11. Project Ideas
  12. Frequently Asked Questions

What is a MEMS Microphone?

MEMS microphones use micro-fabricated mechanical structures — a movable diaphragm and a fixed backplate — etched from silicon using semiconductor manufacturing processes. Sound waves cause the diaphragm to move, changing the capacitance between the diaphragm and backplate. An integrated ASIC converts this capacitance change to an electrical signal.

The advantages of MEMS microphones over traditional electret condenser microphones (ECM) include:

  • Smaller size: MEMS packages can be as small as 2×3 mm compared to the standard 6mm or 10mm ECM capsules
  • Digital output: Many MEMS mics (including the SPH0645) output digital PCM audio via I2S or PDM, eliminating ADC noise from the signal path
  • Consistent performance: Semiconductor manufacturing gives tight sensitivity tolerances (±1–2 dB vs ±3–6 dB for ECM)
  • Reflow soldering compatible: MEMS mics survive the 260°C peak temperature of standard SMT reflow processes
  • Low power: Typically 0.6–1 mA operating current vs 0.3–0.5 mA for ECM + external ADC combination

SPH0645 Module Overview

The SPH0645LM4H from Knowles Acoustics is one of the most popular MEMS microphone ICs used in hobbyist breakout modules. It combines a MEMS acoustic transducer with a 24-bit audio ADC and an I2S output interface all in a tiny LGA package (3.35×2.50×1.00 mm). The breakout module (most popularly the Adafruit SPH0645 breakout, but also many Indian clones) mounts this tiny IC on a convenient board with a JST header or 0.1-inch pitch pins for breadboard use.

Key highlights: 65 dB SNR, 120 dBSPL AOP (Acoustic Overload Point), −26 dBFS sensitivity, I2S output with selectable left/right channel via SEL pin, and 3.3V operation. The 24-bit output is actually 18-bit significant data left-justified in a 32-bit I2S frame — a quirk you need to handle in software.

Understanding I2S Protocol

I2S (Inter-IC Sound), developed by Philips (now NXP), is a serial bus interface standard for connecting digital audio devices. It uses three signal lines:

  • BCLK (Bit Clock / SCK): Clock signal that clocks each bit of audio data. Frequency = sample rate × bit depth × channels (e.g., 44100 × 32 × 2 = 2.82 MHz for stereo 32-bit 44.1 kHz)
  • LRCLK (Left/Right Clock / WS — Word Select): Toggles at the sample rate frequency. LOW = left channel data, HIGH = right channel data. For a mono mic, your data appears on one channel only.
  • DOUT (Data Out / SD): Serial data line. The microphone drives this line; the host (microcontroller) reads it.

The SPH0645 is a receiver perspective microphone — it drives DOUT with serial audio data, clocked by BCLK, framed by LRCLK. The microcontroller provides BCLK and LRCLK (it is the I2S master); the microphone is the I2S slave transmitter.

SPH0645 Pin I2S Signal Direction Description
SEL Channel Select Input GND = Left channel, VCC = Right channel
LRCLK WS / LRCK Input Left/Right word select clock
BCLK SCK / BCLK Input Bit clock from host
DOUT SD Output Serial audio data out from mic
3V VDD Input 3.3V power supply
GND GND — Ground

SPH0645 vs Analog Electret Microphone

Parameter SPH0645 (MEMS I2S) Analog Electret + MAX4466
SNR 65 dB 40–55 dB (ADC limited)
Noise Floor 29 dBSPL (A-weighted) 35–45 dBSPL
Frequency Response 100 Hz – 10 kHz (flat) 100 Hz – 8 kHz (depends on capsule)
Sensitivity Tolerance ±1 dB (unit-to-unit) ±3–6 dB
Interface I2S digital Analog (needs ADC)
Board Wiring 3 signal wires + power 1 analog wire + power
Cost (India) ₹400–₹700 (breakout) ₹80–₹200
Microcontroller Support ESP32, Pi, STM32 (not Uno) Any with ADC (Arduino Uno works)

Technical Specifications

  • Sensitivity: −26 dBFS (typ) at 94 dBSPL 1 kHz
  • SNR: 65 dB(A) at 94 dBSPL
  • AOP (Acoustic Overload Point): 120 dBSPL
  • Dynamic Range: 91 dB
  • Frequency response (−3 dB): 50 Hz – 15 kHz
  • Power supply voltage: 1.62V – 3.6V
  • Current consumption: 650 µA typical
  • I2S clock frequency: 1.0 – 4.0 MHz
  • Data format: 18-bit, left-justified in 24-bit I2S frame (with padding)
  • Operating temperature: −40°C to +85°C

Wiring to ESP32 (Recommended)

The ESP32 has built-in I2S peripheral support in its Arduino framework, making it the easiest microcontroller to use with the SPH0645. Unlike Arduino Uno (which has no I2S peripheral), ESP32 handles the bit-perfect I2S protocol in hardware with DMA, leaving the CPU free for audio processing.

ESP32 to SPH0645 connections:

  • ESP32 3.3V → SPH0645 3V
  • ESP32 GND → SPH0645 GND
  • ESP32 GPIO 25 → SPH0645 LRCLK (WS)
  • ESP32 GPIO 32 → SPH0645 BCLK
  • ESP32 GPIO 33 → SPH0645 DOUT
  • SPH0645 SEL → GND (left channel)

Note: The SPH0645 requires 3.3V. Do NOT connect to 5V — this will damage the module. ESP32 GPIO pins are 3.3V native, so no level shifting is needed.

Wiring to Raspberry Pi

Raspberry Pi (any model with 40-pin header) has I2S pins on the GPIO header:

  • Pi 3.3V (Pin 1) → SPH0645 3V
  • Pi GND (Pin 6) → SPH0645 GND
  • Pi GPIO 19 (PCM_FS, Pin 35) → SPH0645 LRCLK
  • Pi GPIO 18 (PCM_CLK, Pin 12) → SPH0645 BCLK
  • Pi GPIO 20 (PCM_DIN, Pin 38) → SPH0645 DOUT
  • SPH0645 SEL → GND

On Raspberry Pi, enable I2S in /boot/config.txt with dtparam=i2s=on and install the rpi-sph0645 or equivalent ALSA driver overlay. Then record audio with arecord.

BMP280 Pressure Sensor

BMP280 Barometric Pressure & Altitude Sensor I2C/SPI

Build a complete environment sensing node — combine MEMS microphone with BMP280 for simultaneous sound level, temperature, and altitude monitoring.

View on Zbotic

ESP32 Arduino Code: I2S Audio Capture

#include <driver/i2s.h>

// I2S pin definitions (adjust to your wiring)
#define I2S_WS   25  // LRCLK
#define I2S_SCK  32  // BCLK
#define I2S_SD   33  // DOUT from SPH0645

#define SAMPLE_RATE     16000
#define SAMPLE_BITS     32
#define BUFFER_SIZE     512

void i2s_install() {
  i2s_config_t i2s_config = {
    .mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX),
    .sample_rate = SAMPLE_RATE,
    .bits_per_sample = I2S_BITS_PER_SAMPLE_32BIT,
    .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, // SEL=GND
    .communication_format = I2S_COMM_FORMAT_STAND_I2S,
    .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
    .dma_buf_count = 4,
    .dma_buf_len = BUFFER_SIZE,
    .use_apll = false,
    .tx_desc_auto_clear = false,
    .fixed_mclk = 0
  };
  i2s_driver_install(I2S_NUM_0, &i2s_config, 0, NULL);
}

void i2s_setpin() {
  i2s_pin_config_t pin_config = {
    .bck_io_num = I2S_SCK,
    .ws_io_num = I2S_WS,
    .data_out_num = I2S_PIN_NO_CHANGE,
    .data_in_num = I2S_SD
  };
  i2s_set_pin(I2S_NUM_0, &pin_config);
}

void setup() {
  Serial.begin(115200);
  i2s_install();
  i2s_setpin();
  i2s_start(I2S_NUM_0);
  Serial.println("SPH0645 I2S microphone ready");
}

void loop() {
  int32_t buffer[BUFFER_SIZE];
  size_t bytes_read;
  
  i2s_read(I2S_NUM_0, &buffer, sizeof(buffer), &bytes_read, portMAX_DELAY);
  
  int samples_read = bytes_read / sizeof(int32_t);
  
  // SPH0645 outputs 18-bit data left-justified in 32-bit frame
  // Shift right by 14 bits to get 18-bit signed value
  int32_t sample = buffer[0] >> 14;
  
  Serial.println(sample); // Plot in Serial Plotter for waveform
}

Sound Level Meter Example

// RMS sound level meter
void loop() {
  int32_t buffer[256];
  size_t bytes_read;
  
  i2s_read(I2S_NUM_0, &buffer, sizeof(buffer), &bytes_read, portMAX_DELAY);
  int samples = bytes_read / sizeof(int32_t);
  
  // Compute RMS
  double sum_sq = 0;
  for (int i = 0; i < samples; i++) {
    int32_t s = buffer[i] >> 14; // 18-bit sample
    sum_sq += (double)s * s;
  }
  double rms = sqrt(sum_sq / samples);
  
  // Convert to approximate dB SPL
  // SPH0645 sensitivity: -26 dBFS at 94 dBSPL, full scale = 131072 (18-bit)
  // dBFS = 20*log10(rms / 131072)
  // dBSPL ≈ dBFS + 94 + 26 = dBFS + 120
  double dBFS = 20.0 * log10(rms / 131072.0 + 1e-10);
  double dBSPL = dBFS + 120.0;
  
  Serial.print("Sound level: ");
  Serial.print(dBSPL, 1);
  Serial.println(" dBSPL");
}

Two Microphones: Stereo Setup

The SPH0645 SEL pin controls whether the microphone outputs on the left (SEL=GND) or right (SEL=VCC) I2S channel. By connecting two SPH0645 modules sharing the same BCLK and LRCLK lines but using separate DOUT lines (or the same DOUT if both share a wire-OR output bus — check module schematic), you can achieve stereo recording.

On ESP32: configure I2S_CHANNEL_FMT_RIGHT_LEFT and wire:
— Mic 1: SEL=GND (left channel), DOUT → ESP32 data pin
— Mic 2: SEL=3.3V (right channel), DOUT → same ESP32 data pin (both can share if open-drain; otherwise use two I2S peripherals)

Two-microphone stereo opens the door to directional audio, beamforming, and noise cancellation using simple delay-and-sum algorithms — surprisingly achievable on an ESP32 with a bit of signal processing code.

BME280 Sensor

GY-BME280 3.3V Precision Altimeter Atmospheric Pressure Sensor

Combine with the SPH0645 on I2C for a rich environment node — measure temperature, humidity, pressure, and sound level simultaneously.

View on Zbotic

Project Ideas

  • Voice-controlled smart home: ESP32 + SPH0645 + Google Home SDK or custom wake-word model (e.g., TensorFlow Lite Micro). Trigger lights, fans, or AC units by voice.
  • Industrial noise monitor: Measure factory floor dB levels, log to SD card with timestamps, alert via GSM if noise exceeds OSHA limits.
  • Baby monitor with audio streaming: ESP32 + SPH0645 stream audio over Wi-Fi to a smartphone app. Add PIR sensor to trigger recording only on motion.
  • Bird call recorder: Raspberry Pi Zero + SPH0645 in a weatherproof box in your garden. Record dawn chorus at full quality and identify species using Python + BirdNET AI.
  • Classroom sound level display: ESP32 + SPH0645 + OLED or LED bar graph display showing real-time noise level — great for teaching noise discipline.
  • Bat detector (time expansion): Record ultrasonic frequencies by oversampling — SPH0645’s −3 dB bandwidth extends to about 15 kHz, suitable for detecting high-pitched bat calls when processed digitally.
Benewake LiDAR AD2-S-X3

Benewake AD2-S-X3 Automotive-Grade LiDAR

For advanced sensing projects — combine acoustic sensing (SPH0645) with precision LiDAR ranging for a multi-modal robot perception system.

View on Zbotic

Frequently Asked Questions

Can I use the SPH0645 with a standard Arduino Uno?

Not directly. Arduino Uno has no I2S peripheral hardware. You can implement bit-banged I2S in software but it is unreliable at audio sample rates. Use an Arduino with I2S support — such as the Arduino Zero (SAMD21), Arduino Nano 33 BLE (nRF52840), or better yet, an ESP32 which has dual hardware I2S peripherals.

What is the maximum sample rate of the SPH0645?

The SPH0645 supports BCLK frequencies up to 4 MHz. With 32-bit stereo frames: max sample rate = 4 MHz / (32 bits × 2 channels) = 62,500 Hz. Practically, 44,100 Hz (CD quality) and 16,000 Hz (voice quality) are the most common sample rates used with this microphone.

Why does my SPH0645 output data sound distorted or clipped?

Most commonly, the 18-bit data is not being extracted correctly from the 32-bit I2S frame. The SPH0645 left-justifies 18-bit data in the 32-bit word — the actual audio sample is in bits 31:14 (the top 18 bits). Shift right by 14 bits to get a signed 18-bit integer: sample = raw_32bit >> 14;. Also ensure your I2S mode is set to LEFT (mono) if SEL is connected to GND.

Is the SPH0645 suitable for music recording?

The SPH0645 has an upper frequency limit of about 10–15 kHz (−3 dB at ~15 kHz), which means it will capture voice and most instruments but will roll off high-frequency content like cymbals. For voice recording, speech recognition, and sound monitoring it is excellent. For professional music recording with flat response up to 20 kHz, a studio-grade condenser mic is more appropriate.

Can I use a 5V supply for the SPH0645?

No. The SPH0645 maximum supply voltage is 3.6V. Applying 5V will permanently damage the IC. The Adafruit breakout module includes a 3.3V regulator allowing 5V input on the board VIN pin, but the IC itself always runs at 3.3V. For bare modules without a regulator, use the 3.3V rail from your microcontroller.

How does the SPH0645 compare to the INMP441?

The INMP441 is another popular I2S MEMS microphone module, often cheaper in India. Both are I2S, both output 24-bit data, both are mono with L/R select. The SPH0645 has slightly better SNR (65 dB vs 61 dB) and lower noise floor. The INMP441 is more commonly available on cheap Indian clone boards. For most projects, both work well — the Adafruit/ESP32 I2S library code works for both with minor parameter adjustments.

Explore Audio & Sensor Modules at Zbotic
Build high-quality audio and sensing projects with components from India’s trusted electronics store. Browse the Sensors & Measurement collection at Zbotic.in — fast nationwide delivery, quality guaranteed.
Tags: digital microphone module, I2S audio ESP32, MEMS microphone Arduino, SPH0645 MEMS microphone, SPH0645 tutorial India
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
LiDAR TF-Luna: Short Range Det...
blog lidar tf luna short range detection for robots with arduino 596597
blog ir proximity sensor calibration distance vs voltage curve 596600
IR Proximity Sensor Calibratio...

Related posts

Svg%3E
Read more

Encoder Module: Position and Speed Measurement with Arduino

April 1, 2026 0
A rotary encoder converts the angular position and rotation speed of a shaft into electrical signals that Arduino can count... Continue reading
Svg%3E
Read more

Infrared Obstacle Sensor: Line Follower and Object Detection

April 1, 2026 0
Infrared obstacle sensors are the building blocks of line-following robots, edge detection systems, and proximity triggers. These tiny modules emit... Continue reading
Svg%3E
Read more

Rain Sensor and Raindrop Detection Module: Arduino Guide

April 1, 2026 0
A rain sensor module detects the presence of water droplets on its surface, giving Arduino a simple signal to trigger... Continue reading
Svg%3E
Read more

LiDAR Sensor TFmini: Distance Measurement Beyond Ultrasonic

April 1, 2026 0
When ultrasonic sensors hit their limits — range too short, accuracy too coarse, outdoor sunlight causing interference — LiDAR sensors... Continue reading
Svg%3E
Read more

Pressure Sensor BMP280: Weather Station and Altitude Meter

April 1, 2026 0
The BMP280 barometric pressure sensor by Bosch measures atmospheric pressure with ±1 hPa accuracy and temperature with ±1°C precision. These... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now