The ESP32 IoT Noise Monitor is a sophisticated environmental monitoring solution that measures ambient noise levels in real-time. The system provides continuous sound level monitoring with cloud connectivity for data logging and analysis through ThingSpeak integration.
The system provides comprehensive noise monitoring capabilities including:
- Real-time sound level measurement in decibels (dB)
- High-precision audio sampling using INMP441 I2S microphone
- Live data visualization via OLED display
- WiFi connectivity for remote monitoring
- Cloud data logging through ThingSpeak
- Rolling average calculations (1-minute and all-time)
- Visual status indicators for connectivity and operation
- ESP32 Development Board
- INMP441 I2S MEMS Microphone
- SSD1306 OLED Display (128x64)
- WS (Word Select/LRCLK): GPIO 15
- SD (Serial Data): GPIO 13
- SCK (Serial Clock): GPIO 2
- MOSI: GPIO 23
- CLK: GPIO 18
- DC: GPIO 16
- CS: GPIO 5
- RESET: GPIO 17
The project relies on the following libraries:
#include <Arduino.h>
#include <driver/i2s.h>
#include <WiFi.h>
#include "ThingSpeak.h"
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
- Clone this repository
- Install PlatformIO in your development environment
- Create a
secrets.h
file with your credentials:
#define SECRET_WIFI_NAME "your_wifi_ssid"
#define SECRET_WIFI_PASSWORD "your_wifi_password"
#define SECRET_myChannelNumber your_channel_number
#define SECRET_myApiKey "your_api_key"
- Configure the project in PlatformIO
- Upload the code to your ESP32
#define SAMPLE_RATE 44100
#define REFERENCE_LEVEL 8192.0
#define SCALE_FACTOR 2.5
#define DB_THRESHOLD 60.0
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
The system operates through several key stages:
-
Initialization
- Configures I2S interface for audio sampling
- Initializes OLED display
- Establishes WiFi connection
- Sets up ThingSpeak client
-
Main Operation
- Samples audio data continuously
- Calculates real-time dB levels
- Updates rolling averages
- Displays current readings and status
- Uploads data to ThingSpeak
-
Data Display
- Current dB level
- Noise level status (HIGH/LOW)
- Connection status indicators
- Rolling averages (1-minute and all-time)
The system calculates several metrics:
- Instantaneous dB levels
- One-minute rolling average
- Overall average since startup
- Threshold-based noise level classification
Data is uploaded to ThingSpeak for long-term storage and analysis:
- Connects to ThingSpeak server
- Uploads dB readings every sampling cycle
- Provides visual confirmation of successful uploads
- Maintains error handling for failed uploads
Common issues and solutions:
-
WiFi Connection Issues
- Check network credentials
- Verify network stability
- Monitor WiFi status indicator on display
-
Sensor Reading Issues
- Verify I2S connections
- Check microphone orientation
- Ensure proper power supply
-
Display Problems
- Verify I2C connections
- Check display address configuration
- Monitor serial output for errors
To modify or extend this project:
- Fork the repository
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by Gonzalo Novoa
- ThingSpeak for cloud data storage
- Adafruit for display libraries
- ESP32 community for I2S implementation examples
For additional information or support, please open an issue in the repository.
The article presents the development and testing of this ESP32-based IoT device for noise monitoring in non-industrial contexts, demonstrating its effectiveness for environmental sound level measurement and real-time data collection through cloud integration. This IoT noise monitoring device has been documented and validated in a peer-reviewed academic publication:
Title: Prototipo de dispositivo de IoT para monitoreo del ruido en contextos no industriales
Authors: Y. Castro-Cely, G. R. Novoa-Fernández, B. R. Aragón-Rentería, y M. A. Espitia-Pineda
Journal: Salud, Trabajo y Sostenibilidad (Consejo Colombiano de Seguridad)
Publication Details:
- Volume: 2, Issue: 1
- Pages: 43–55
- Date: July 2025
- DOI/URL: https://publicaciones.ccs.org.co/index.php/sts/article/view/16
Y. Castro-Cely, G. R. Novoa-Fernández, B. R. Aragón-Rentería, y M. A. Espitia-Pineda,
«Prototipo de dispositivo de IoT para monitoreo del ruido en contextos no industriales»,
Salud, Trabajo y Sostenibilidad (Consejo Colombiano de Seguridad), vol. 2, n.º 1, pp. 43–55, jul. 2025.