ESP32/IoT B.Tech/Diploma Beginner

Make an Accurate ESP32 Decibel Meter (SPL) with Data Logger

Highly Accurate Decibel Meter using ESP32 & Sound Pressure Level Sensor to measure sound intensity in dB SPL & display on OLED IoT Ubidots

  • Suitable forB.Tech/Diploma ESP32/IoT students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Overview
In this project, we will build an highly accurate Decibel Meter using ESP32 WiFi Module and a special Sound Level Sensor Module. The decibel meter is capable of detecting the sound level between 35 dB to 115 dB. The Decibel Meter is highly accurate and doesn’t require any calibration as its already pre-calibrated.
We can interface the Sound Level Sensor with ESP32 using I2C protocol. The device can mesure detect the sound level and accurately monitor sound level in decibel (dB SPL). The detected sound level can be displayed on 0.96″ OLED Display. Apart from displaying the sound level on OLED, we can send the data to any IoT platform and use the data for graphical visualization and further analysis. In this example we sent the data to Ubidots platform.
You may take a look at a similar project that we build earlier using the Sound Level Sensor. These were not the accurate Decibelmeter but were designed for learning purpose only.
IoT Sound Level Monitor with ESP8266
Decibel Meter using Arduino
IoT Decibelmeter with ESP8266
Bill of Materials
We need following components for this project. You can purchase the components from given links.
S.N.
Components
Quantity
Purchase Link

ESP32 Board

Amazon
AliExpress
SunFounder

Sound Level (SPL) Sensor

PCB Artist

OLED Display

Amazon
AliExpress
SunFounder

Breadboard

Amazon
AliExpress
SunFounder

Connecting Wires

Amazon
AliExpress
SunFounder
What is a Decibel Meter?
A decibel meter, also known as a sound pressure level (SPL) meter, is a device designed to measure sound pressure levels. The instrument uses a microphone to capture sound pressure changes and converts them into an electrical signal, which is then amplified. This amplified signal undergoes frequency and time weightings according to international standards, providing a standardized measurement in decibels (dB).
The decibel meter’s response to sound is comparable to that of the human ear, providing an objective measurement of noise levels in any given environment. The noise level readings, along with other potential acoustic parameters like the equivalent continuous sound level (Leq), are displayed on the device’s screen. You may use the
Decibel Calculator
to calculate the Decibel.
Decibel Sound Level Meter Module
The decibel meter module offered by PCB Artists is a compact, energy-efficient, and precise instrument for measuring sound pressure level in dB SPL. This Decibel Meter module can be easily interfaced with hardware like Arduino, ESP32, Raspberry Pi, or similar devices.
The I2C decibel meter module can be connected to any system with a 3.3V power output and I2C bus for communicating with the sound sensor module. It can detect the sound level from 35 dB to 115 dB with an accuracy of ±2 dB SPL. The sensor also doesn’t require any calibration as its factory calibrated.
Read about the PCB Artists Decibelmeter Here:
I2C Decibel Meter Programming Manual
Features & Specifications
The PCB Artists decibel sound level meter module features
High accuracy of
±2 dB SPL
Measurement range of
35 dB to 115 dB
Frequency Range of
30 Hz to 8 kHz
Easy to use – standard
I2C interface
(I2C Address 0x48)
Low power consumption, only
5mA @ 3.3V
(measurement) and
100uA
(sleep)
Selectable response –
A-weighted
, C-weighted, Z-weighted
Adjustable averaging time in the range of 10ms to 10,000 ms
125ms (fast mode)
and
1,000ms (slow mode)
supported
Threshold
detection and interrupt
100-reading buffer to allow host MCU to sleep
Stick to any surface using peel-off adhesive
Low cost
and
small in size
Pinout
The sound level meter module has 5 pins. The INT (interrupt) pin is optional and may be left open if unused in your application.
3V3
(Power supply input pin):
Source clean 3.3V regulated power supply to this pin. The module typically consumes 5mA at 3.3V.
INT
(Open-drain interrupt pin, active low):
The interrupt function is disabled by default. If enabled, the INT pin goes low when an interrupt is pending.
SCL
(Open-drain I2C SCL pin):
Standard I2C bus SCL line, recommended pull-up is at least 10K.
SDA
(Open-drain I2C SDA pin):
Standard I2C bus SDA line, recommended pull-up is at least 10K
GND
(Ground pin):
Module ground, should be connected directly to the ground of the system power source or battery if possible.
Interfacing Decibel Meter Module with ESP32
Now let us interface the PCB Artists decibel sound level meter module with ESP32 WiFi/BLE Microcontroller. The connection is straight forward.
Connect the VCC, GND, SDA & SCL pin of Decibel Meter Module 3.3V, GND, GP21 & GP22 of ESP32 respectively. You may use a breadboard for assembly and jumper wires for connections.
Sample Code
Here is a sample code that can read sound level data sensed by Sound Level Decibel Meter Module using ESP32. The code initializes I2C communication protocol to read the value of sensor data. The sensor has an I2C Address of 0X48.
Copy the following code and upload it to the ESP32 Board. For uploading select the ESP32 Dev Module and the COM port.

#include <Wire.h>
#define PCBARTISTS_DBM 0x48
#define I2C_REG_VERSION 0x00
#define I2C_REG_ID3 0x01
#define I2C_REG_ID2 0x02
#define I2C_REG_ID1 0x03
#define I2C_REG_ID0 0x04
#define I2C_REG_SCRATCH 0x05
#define I2C_REG_CONTROL 0x06
#define I2C_REG_TAVG_HIGH 0x07
#define I2C_REG_TAVG_LOW 0x08
#define I2C_REG_RESET 0x09
#define I2C_REG_DECIBEL 0x0A
#define I2C_REG_MIN 0x0B
#define I2C_REG_MAX 0x0C
#define I2C_REG_THR_MIN 0x0D
#define I2C_REG_THR_MAX 0x0E
#define I2C_REG_HISTORY_0 0x14
#define I2C_REG_HISTORY_99 0x77
void
setup
(
)
{
Serial
begin
(
9600
)
;
Wire
begin
(
)
;
byte
version
=
reg_read
(
PCBARTISTS_DBM
I2C_REG_VERSION
)
;
Serial
(
"dbMeter VERSION = 0x"
)
;
Serial
println
(
version
HEX
)
;
byte
id
[

]
;
id
[

]
=
reg_read
(
PCBARTISTS_DBM
I2C_REG_ID3
)
;
id
[

]
=
reg_read
(
PCBARTISTS_DBM
I2C_REG_ID2
)
;
id
[

]
=
reg_read
(
PCBARTISTS_DBM
I2C_REG_ID1
)
;
id
[

]
=
reg_read
(
PCBARTISTS_DBM
I2C_REG_ID0
)
;
Serial
(
"Unique ID = "
)
;
Serial
(
id
[

]
HEX
)
;
Serial
(
" "
)
;
Serial
(
id
[

]
HEX
)
;
Serial
(
" "
)
;
Serial
(
id
[

]
HEX
)
;
Serial
(
" "
)
;
Serial
println
(
id
[

]
HEX
)
;
}
void
loop
(
)
{
byte
sound_level
=
reg_read
(
PCBARTISTS_DBM
I2C_REG_DECIBEL
)
;
Serial
(
"Sound Level (dB SPL) = "
)
;
Serial
println
(
sound_level
)
;
delay
(
2000
)
;
}
byte
reg_read
(
byte
addr
byte
reg
)
{
Wire
beginTransmission
(
addr
)
;
Wire
write
(
reg
)
;
Wire
endTransmission
(
)
;
Wire
requestFrom
(
addr
(
uint8_t
)

)
;
byte
data
=
Wire
read
(
)
;
return
data
;
}
After uploading the code, open the Serial Monitor. The Serial Monitor will show the Sound Level in dB (SPL).
In a quite room the decibel meter value will be around 35. The decibel values increases on increasing the noise level. You may play music to detect the different level of sound. The is a highly accurate decibel meter as calibration is done at factory level.
Making ESP32 IoT Decibel Meter (SPL) with Data Logger
Now we have tested the Decibel Meter and read the values on Serail monitor, we can further enhance this project. We can use a 0.96″ I2C OLED Display for real-time reading of dB SPL value. We can also send the value to any IoT platform such as Blynk, Thingspeak, Ubidots or any other Server. This is what exctly we will do now. We will use Ubidots for data logging and real time remote analysis.
Circuit & Connections
Here is a simple connection for this part. We have added an extra Display for this project.
Connect the VCC, GND, SDA & SCL of SSD1306 0.96″
OLED

Technologies used

ESP32ESP8266ArduinoRaspberry PiBlynkThingSpeakWiFiBLESSD1306OLEDI2C

Hardware components

  • ESP32
  • ESP8266
  • Arduino
  • Raspberry Pi
  • SSD1306
  • OLED

Software & tools

  • Blynk
  • ThingSpeak

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.