ESPHome Sound Level Meter Component - image 1
Integrationintermediate

ESPHome Sound Level Meter Component

Custom ESPHome external component for measuring environmental noise levels (Leq, Lmin, Lmax, Lpeak) with A/C/Z frequency weightings using I2S microphones. Used by the Airlytix ES1 for sound monitoring.

Boards:ESP32
Firmware:ESPHomeHome Assistant
Use Cases:Environmental MonitoringAudio Projects

Overview

An ESPHome external component that turns an ESP32 with an I2S digital microphone into a professional-grade environmental noise level meter. It calculates Leq (equivalent continuous sound level), Lmin, Lmax, and Lpeak values with configurable frequency weightings (A, C, Z) over user-defined time intervals.

Based on Ivan Kostoski's ESP32-I2S-SLM project, this component brings calibrated noise measurement to the ESPHome ecosystem. It is used as a core component in the Airlytix ES1 environment monitor.

Features

  • Multiple measurement types: Leq (average), Lmax (maximum), Lmin (minimum), Lpeak (peak) sound levels
  • Frequency weightings: A-weighting (human hearing), C-weighting (flat response), Z-weighting (unweighted) via configurable SOS (Second-Order Section) IIR filters
  • Microphone calibration: Convert dB FS to dB SPL using mic sensitivity and reference SPL values
  • Flexible sensor groups: Hierarchical group/filter/sensor structure for organizing measurements
  • Configurable intervals: Independent update intervals per sensor (e.g., 1s for real-time, 60s for averages)
  • Low CPU usage: ~67ms per second of audio at 240MHz, ~210ms at 80MHz
  • On/off control: Turn measurement on/off via Home Assistant switch or GPIO button

Usage

Add to your ESPHome YAML:

external_components:
  - source: github://stas-sl/esphome-sound-level-meter

Performance

At 240MHz with 6 SOS filter stages and multiple sensors (Leq, Lpeak, Lmax, Lmin), processing takes ~90ms per second of 48kHz audio — about 9% of a single core.

Compatibility

Tested with ESP32 (Arduino and ESP-IDF frameworks). Can also send data to sensor.community for public noise mapping.

Resources