Skip to content

Makerspace-Antwerpen/esp32-klankentapper

Repository files navigation

ESP32-Klankentapper

Accurate dBA measurements with an ESP32 and an I2S MEMS microphone, for citizen science projects.

Windshield

1. About ESP32-Klankentapper

The ESP32-Klankentapper is a sensor which serves to measure ambient noise around your house. You are able to observe this amount of noise around your house on an online dashboard. The sensor includes a microcontroller (ESP32 WROOM) and a custom designed PCB containing a powerfull MEMS microphone. The microcontroller is able to calculate the amount of sound in dBA very precisely. This is the measure of sound tuned to the human hearing.

The ESP32-Klankentapper is a class 2 dBA meter, with a measured ±0.5dBA error at 1kHz, and ±0.7dBA variation between microphones. The noise floor of the sensor is 24.5dBA. The ESP32-Klankentapper can therefore be used as a ‘general grade’ meter. It is ideal for use in noise at work assessments, basic environmental measurements, entertainment noise, industrial hygiene, construction noise, and vehicle noise.

An ESP32-Klankentapper is an open source ambient sound meter, developed by Makerspace Antwerpen for the imec Hackable City of Things initiative, in collaboration with Gents Milieufront and Bewonersgroep Luchtbal Noord, and scientifically supported by imec Waves onderzoeksgroep.

2. What is an ESP32-Klankentapper?

A hardware sensor with software, a manual and cloud components.

Hardware to build an ambient noise meter

This repository includes the hardware design to create an accurate dBA sensor based on a ESP32 and a custom designed PCB with the Infineon IM69D120 microphone. Furthermore, we used off-the-shelf parts, 3D prints and lasercuts as much as possible.

In this repository you can also find the bill of materials, the process of building a Klankentapper, the software setup and our connectivity setup.

Choice of technology

After comparing the ST MP34DT01-M, Knowles SPH0645LM4H, Vesper VM3000 and Infineon IM69D120 microphones, we concluded that the latter can be used with good accuracy (<±1.5dBA) to measure environmental noise. The accuracy of the Infineon IM69D120 microphone and the hardware of the whole sound meter were thoroughly tested in the anechoic chamber of Imec Waves.

PCB

We have created a custom designed PCB for our Infineon IM69D120 microphone. Besides the microphone this PCB also includes an Analog Devices ADAU7002 PDM-to-I2S converter chip. This allows you to read the audio data in both I2S and PDM format. Thanks to the consistency of the microphones among each other, we are able to use them with 1 standard calibration (per batch produced).

Software to analyse ambient noise

This repository includes the software used to correctly read the microphone data into the ESP32, correct it with IIR filters, calibrate it and correctly calculate dBA.

Flow overview

IIR filters

Our microphone, although carefully selected for the flattest possible frequency response, still has a frequency response that isn't completely flat. This is a problem that needs to be sorted before we can use the measurements for anything meaningful.

Frequency response

We also want to apply an A-weighting filter to our signal, so the end values represent a dBA measurement. You can read more about the A-weighting of audio signals on this link.

A-weighting

To achieve both of those things, we use IIR filters. These are a kind of digital filter that can be applied to a digital signal. You can read more about IIR filters on this link. The filter code used in iir-filter.hpp is universal. It is the filter coefficients that dictate the characteristics of the filter. Acquiring these filter coefficients requires some advanced mathematics that go out of scope for this document. You can find the used filter coefficients in the codebase on line 31-34 of dbaMeasure.cpp. Be advised that these values are sample rate specific and can thus be only used with a 48kHz sample rate.

The first filter used flattens the frequency response of the used microphone. The second filter applies the A-weighting to the audio signal before the RMS is calculated.

RMS and dBA calculation

We now have a leveled and then weighted audio signal. The next step is calculating a dBA value from this signal. The time interval over which this value is calculated is important. We chose for the fast standard. See this link for more information. The fast standard measures the sound level over an interval of 1/8th of a second. Therefore, we use 6000 (48000/8) samples for each rms dBA calculation. To calculate the RMS value we use the following formula:
formula
Where:
formula
formula
After this we calculate the dBA value from this RMS value with the following formula:
formula
Where:
formula Correction dB for DC value of mic. 0 In our case.
formula Sound level at which the formula occurs.
formula RMS value that occurs at formula sound level.

The formula and formula values are experimentally acquired.

DBA measurement test results

The quality of the ESP32-Klankentapper was tested in the anechoic chamber of the imec waves research group at the University of Ghent in Belgium.

Anechoic chamber

Below are the test results of a 1kHz tone at different dBA levels. The dBA levels of the calibrated test microphone are on the X-axis, and dBA levels of the ESP32-Klankentapper are on the Y-axis.

1kHz dBA measurements

From these tests, we learned that the ESP32-Klankentapper sound level meter has an error of ±0.5dBA (for measurements above 30dBA) with a noise floor of 24.5dBA. Variations between different ESP32-Klankentappers is ±0.7dBA. Other tests with different spectra (e.g. pink noise) confirmed these error rates beyond 1kHz. These tests show that the ESP32-Klankentapper can be used as a general grade class 2 sound level meter.

Build your own Klankentapper

  1. Bill of materials
  2. Prepare the ESP32
  3. Build the hardware
  4. Wifi and MQTT configuration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •