IoT Sound Level Monitor with ESP8266 & Sound Module
IoT Based Sound Level & Intensity Monitoring Device using Nodemcu ESP8266 & Sound Module/Sensor. Monitor online decibel on Thingspeak Server & OLED Display.
- Suitable forB.Tech/Diploma ESP8266/IoT students
- Build time1-2 weeks
- LevelBeginner
- Available atAjvika Labs, Kakinada
About this project
In this project we will make IoT Based Sound Level & Intensity Monitoring Device using Nodemcu ESP8266 & Sound Module/Sensor & monitor online on Thingspeak Server.
Overview
A
sound level meter
is used for acoustic (sound that travels through the air) measurements. The best type of
microphone
for sound level meters is the
condenser microphone
, which combines precision with
stability
and
reliability
. The diaphragm of the microphone responds to changes in
air pressure
caused by
sound waves
. That is why the instrument is sometimes referred to as a
Sound Pressure Level (SPL) Meter
Sound level meters are commonly used in
noise pollution
studies for the quantification of different kinds of noise, especially for industrial, environmental, mining and aircraft noise. The reading from a sound level meter does not correlate well to human-perceived
loudness
, which is better measured by a
loudness meter
. Specific loudness is a compressive nonlinearity and varies at certain levels and at certain
frequencies
. These metrics can also be calculated in a number of different ways.
In this
IoT project
, we will make
Sound Level
&
Intensity Meter
. This
DIY project
is very simple and can be made at home for monitoring sound pollution. We will use
Nodemcu ESP8266
Sound Module
&
OLED Display
. The Sound Sensor will detect the sound and convert it into an analog voltage which is read by Nodemcu ESP8266. The Nodemcu connects to wifi and uploads the data to
Thingspeak Server
Before starting, you can check the previous post to get started with Sound Sensor:
Decibel Meter using Sound Module & Arduino with LCD Display
IoT Decibelmeter with Sound Sensor & ESP8266
Components Required
Following are the components required for making this project. All the components can be eaily purchased from Amazon. The componets purchase link is given below.
S.N.
Components Name
Quantity
Purchase Links
NodeMCU ESP8266
Amazon
AliExpress
Sound Sensor
Amazon
AliExpress
OLED Display
Amazon
AliExpress
Connecting Wires
Amazon
AliExpress
Breadboard
Amazon
AliExpress
Microphone Sound Sensor
The microphone sound sensor, as the name says, detects sound. It gives a measurement of how loud a sound is. The sound sensor is a small board that combines a microphone (50Hz-10kHz) and some processing circuitry to convert sound waves into electrical signals. This electrical signal is fed to on-board LM393 High Precision Comparator to digitize it and is made available at OUT pin.
The module has a built-in potentiometer for sensitivity adjustment of the OUT signal. We can set a threshold by using a potentiometer. So that when the amplitude of the sound exceeds the threshold value, the module will output LOW otherwise HIGH.
Apart from this, the module has two LEDs. The Power LED will light up when the module is powered. The Status LED will light up when the digital output goes LOW.
The sound sensor only has three pins: VCC, GND & OUT. VCC pin supplies power for the sensor & works on 3.3V to 5V. OUT pin outputs HIGH when conditions are quiet and goes LOW when sound is detected.
0.96″ I2C OLED Display
This is a 0.96 inch blue OLED display module. The display module can be interfaced with any microcontroller using SPI/IIC protocols. It is having a resolution of 128×64. The package includes display board, display,4 pin male header pre-soldered to board.
OLED (
Organic Light-Emitting Diode
) is a self light-emitting technology composed of a thin, multi-layered organic film placed between an anode and cathode. In contrast to LCD technology, OLED does not require a backlight. OLED possesses high application potential for virtually all types of displays and is regarded as the ultimate technology for the next generation of flat-panel displays.
Circuit: Sound Level Monitor with ESP8266 & Sound Module
The circuit diagram for
Interfacing Sound Sensor with NodeMCU ESP8266 & OLED Display
is given below. The connection is fairly simple.
The sound sensor and OLED display both needs 3.3V power supply. So connect their VCC & GND terminal to 3.3V & GND of NodeMCU respectively. Connect the output pin of sound sensor to Nodemcu A0 pin. Connect the I2C pin, i.e SDA & SCL pin of OLED Display to Nodemcu D2 & D1 pin respectively.
Setting Up Thingspeak
In order to
Monitor the Sensor Data on Thingspeak Server
, you first need to Setup the Thingspeak. To set up the Thingspeak Server, visit
https://thingspeak.com/
. Create an account or simply sign in if you created the account earlier. Then create a new channel with following details.
After filling these details, save the channel. The go-to the
API Key
and copy the API key. This API key will be used in the program.
Source Code/Program
The
source code/program
for
Sound Module with ESP8266
is given below. Copy the code and upload it to the Nodemcu board.
Make sure to do the changes in Wifi SSID, Password and Thingspeak API.
#include <ESP8266WiFi.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306
display
(
SCREEN_WIDTH
SCREEN_HEIGHT
&
Wire
OLED_RESET
)
;
int
num_Measure
=
;
// Set the number of measurements
int
pinSignal
=
A0
;
// pin connected to pin O module sound sensor
long
Sound_signal
;
// Store the value read Sound Sensor
long
sum
=
;
// Store the total value of n measurements
long
level
=
;
// Store the average value
int
soundlow
=
;
int
soundmedium
=
;
int
error
=
;
String
apiKey
=
"14K8UL2QEK8BTHN6"
;
// Enter your Write API key from ThingSpeak
const
char
*
ssid
=
"Alexahome"
;
// replace with your wifi ssid and wpa2 key
const
char
*
pass
=
"12345678"
;
const
char
*
server
=
"api.thingspeak.com"
;
WiFiClient
client
;
void
setup
(
)
{
pinMode
(
pinSignal
INPUT
)
;
// Set the signal pin as input
Serial
begin
(
115200
)
;
display
begin
(
SSD1306_SWITCHCAPVCC
0x3C
)
;
//initialize with the I2C addr 0x3C (128x64)
display
clearDisplay
(
)
;
delay
(
)
;
Serial
println
(
"Connecting to "
)
;
Serial
println
(
ssid
)
;
display
clearDisplay
(
)
;
display
setCursor
(
)
;
display
setTextSize
(
)
;
display
setTextColor
(
WHITE
)
;
display
println
(
"Connecting to "
)
;
display
setTextSize
(
)
;
display
(
ssid
)
;
display
display
(
)
;
WiFi
begin
(
ssid
pass
)
;
while
(
WiFi
status
(
)
!=
WL_CONNECTED
)
{
delay
(
)
;
Serial
(
"."
)
;
}
Serial
println
(
""
)
;
Serial
println
(
"WiFi connected"
)
;
display
clearDisplay
(
)
;
display
setCursor
(
)
;
display
setTextSize
(
)
;
display
setTextColor
(
WHITE
)
;
display
(
"WiFi connected"
)
;
display
display
(
)
;
delay
(
4000
)
;
}
void
loop
(
)
{
// Performs 128 signal readings
for
(
int
i
=
;
i
<
num_Measure
;
i
++
)
{
Sound_signal
=
analogRead
(
pinSignal
)
;
sum
=
sum
+
Sound_signal
;
}
level
=
sum
/
num_Measure
;
// Calculate the average value
Serial
(
"Sound Level: "
)
;
Serial
println
(
level
error
)
;
display
clearDisplay
(
)
;
display
setCursor
(
)
;
//oled display
display
setTextSize
(
)
;
display
setTextColor
(
WHITE
)
;
display
println
(
"--- De
Overview
A
sound level meter
is used for acoustic (sound that travels through the air) measurements. The best type of
microphone
for sound level meters is the
condenser microphone
, which combines precision with
stability
and
reliability
. The diaphragm of the microphone responds to changes in
air pressure
caused by
sound waves
. That is why the instrument is sometimes referred to as a
Sound Pressure Level (SPL) Meter
Sound level meters are commonly used in
noise pollution
studies for the quantification of different kinds of noise, especially for industrial, environmental, mining and aircraft noise. The reading from a sound level meter does not correlate well to human-perceived
loudness
, which is better measured by a
loudness meter
. Specific loudness is a compressive nonlinearity and varies at certain levels and at certain
frequencies
. These metrics can also be calculated in a number of different ways.
In this
IoT project
, we will make
Sound Level
&
Intensity Meter
. This
DIY project
is very simple and can be made at home for monitoring sound pollution. We will use
Nodemcu ESP8266
Sound Module
&
OLED Display
. The Sound Sensor will detect the sound and convert it into an analog voltage which is read by Nodemcu ESP8266. The Nodemcu connects to wifi and uploads the data to
Thingspeak Server
Before starting, you can check the previous post to get started with Sound Sensor:
Decibel Meter using Sound Module & Arduino with LCD Display
IoT Decibelmeter with Sound Sensor & ESP8266
Components Required
Following are the components required for making this project. All the components can be eaily purchased from Amazon. The componets purchase link is given below.
S.N.
Components Name
Quantity
Purchase Links
NodeMCU ESP8266
Amazon
AliExpress
Sound Sensor
Amazon
AliExpress
OLED Display
Amazon
AliExpress
Connecting Wires
Amazon
AliExpress
Breadboard
Amazon
AliExpress
Microphone Sound Sensor
The microphone sound sensor, as the name says, detects sound. It gives a measurement of how loud a sound is. The sound sensor is a small board that combines a microphone (50Hz-10kHz) and some processing circuitry to convert sound waves into electrical signals. This electrical signal is fed to on-board LM393 High Precision Comparator to digitize it and is made available at OUT pin.
The module has a built-in potentiometer for sensitivity adjustment of the OUT signal. We can set a threshold by using a potentiometer. So that when the amplitude of the sound exceeds the threshold value, the module will output LOW otherwise HIGH.
Apart from this, the module has two LEDs. The Power LED will light up when the module is powered. The Status LED will light up when the digital output goes LOW.
The sound sensor only has three pins: VCC, GND & OUT. VCC pin supplies power for the sensor & works on 3.3V to 5V. OUT pin outputs HIGH when conditions are quiet and goes LOW when sound is detected.
0.96″ I2C OLED Display
This is a 0.96 inch blue OLED display module. The display module can be interfaced with any microcontroller using SPI/IIC protocols. It is having a resolution of 128×64. The package includes display board, display,4 pin male header pre-soldered to board.
OLED (
Organic Light-Emitting Diode
) is a self light-emitting technology composed of a thin, multi-layered organic film placed between an anode and cathode. In contrast to LCD technology, OLED does not require a backlight. OLED possesses high application potential for virtually all types of displays and is regarded as the ultimate technology for the next generation of flat-panel displays.
Circuit: Sound Level Monitor with ESP8266 & Sound Module
The circuit diagram for
Interfacing Sound Sensor with NodeMCU ESP8266 & OLED Display
is given below. The connection is fairly simple.
The sound sensor and OLED display both needs 3.3V power supply. So connect their VCC & GND terminal to 3.3V & GND of NodeMCU respectively. Connect the output pin of sound sensor to Nodemcu A0 pin. Connect the I2C pin, i.e SDA & SCL pin of OLED Display to Nodemcu D2 & D1 pin respectively.
Setting Up Thingspeak
In order to
Monitor the Sensor Data on Thingspeak Server
, you first need to Setup the Thingspeak. To set up the Thingspeak Server, visit
https://thingspeak.com/
. Create an account or simply sign in if you created the account earlier. Then create a new channel with following details.
After filling these details, save the channel. The go-to the
API Key
and copy the API key. This API key will be used in the program.
Source Code/Program
The
source code/program
for
Sound Module with ESP8266
is given below. Copy the code and upload it to the Nodemcu board.
Make sure to do the changes in Wifi SSID, Password and Thingspeak API.
#include <ESP8266WiFi.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306
display
(
SCREEN_WIDTH
SCREEN_HEIGHT
&
Wire
OLED_RESET
)
;
int
num_Measure
=
;
// Set the number of measurements
int
pinSignal
=
A0
;
// pin connected to pin O module sound sensor
long
Sound_signal
;
// Store the value read Sound Sensor
long
sum
=
;
// Store the total value of n measurements
long
level
=
;
// Store the average value
int
soundlow
=
;
int
soundmedium
=
;
int
error
=
;
String
apiKey
=
"14K8UL2QEK8BTHN6"
;
// Enter your Write API key from ThingSpeak
const
char
*
ssid
=
"Alexahome"
;
// replace with your wifi ssid and wpa2 key
const
char
*
pass
=
"12345678"
;
const
char
*
server
=
"api.thingspeak.com"
;
WiFiClient
client
;
void
setup
(
)
{
pinMode
(
pinSignal
INPUT
)
;
// Set the signal pin as input
Serial
begin
(
115200
)
;
display
begin
(
SSD1306_SWITCHCAPVCC
0x3C
)
;
//initialize with the I2C addr 0x3C (128x64)
display
clearDisplay
(
)
;
delay
(
)
;
Serial
println
(
"Connecting to "
)
;
Serial
println
(
ssid
)
;
display
clearDisplay
(
)
;
display
setCursor
(
)
;
display
setTextSize
(
)
;
display
setTextColor
(
WHITE
)
;
display
println
(
"Connecting to "
)
;
display
setTextSize
(
)
;
display
(
ssid
)
;
display
display
(
)
;
WiFi
begin
(
ssid
pass
)
;
while
(
WiFi
status
(
)
!=
WL_CONNECTED
)
{
delay
(
)
;
Serial
(
"."
)
;
}
Serial
println
(
""
)
;
Serial
println
(
"WiFi connected"
)
;
display
clearDisplay
(
)
;
display
setCursor
(
)
;
display
setTextSize
(
)
;
display
setTextColor
(
WHITE
)
;
display
(
"WiFi connected"
)
;
display
display
(
)
;
delay
(
4000
)
;
}
void
loop
(
)
{
// Performs 128 signal readings
for
(
int
i
=
;
i
<
num_Measure
;
i
++
)
{
Sound_signal
=
analogRead
(
pinSignal
)
;
sum
=
sum
+
Sound_signal
;
}
level
=
sum
/
num_Measure
;
// Calculate the average value
Serial
(
"Sound Level: "
)
;
Serial
println
(
level
error
)
;
display
clearDisplay
(
)
;
display
setCursor
(
)
;
//oled display
display
setTextSize
(
)
;
display
setTextColor
(
WHITE
)
;
display
println
(
"--- De
Technologies used
Hardware components
- ESP8266
- Arduino
- SSD1306
- OLED
Software & tools
- 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.