Skip to content

ESP32 - IoT sound level monitoring in real-time with cloud connectivity for data logging and analysis through ThingSpeak integration.

License

Notifications You must be signed in to change notification settings

chalonov/iot-esp32-noise-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 IoT Noise Monitor

Version Project Status Platform License

Overview

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.

Features

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

Hardware Requirements

Core Components

  • ESP32 Development Board
  • INMP441 I2S MEMS Microphone
  • SSD1306 OLED Display (128x64)

Pin Configuration

INMP441 Microphone

  • WS (Word Select/LRCLK): GPIO 15
  • SD (Serial Data): GPIO 13
  • SCK (Serial Clock): GPIO 2

OLED Display

  • MOSI: GPIO 23
  • CLK: GPIO 18
  • DC: GPIO 16
  • CS: GPIO 5
  • RESET: GPIO 17

Software Dependencies

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>

Installation

  1. Clone this repository
  2. Install PlatformIO in your development environment
  3. 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"
  1. Configure the project in PlatformIO
  2. Upload the code to your ESP32

Configuration

Audio Sampling Parameters

#define SAMPLE_RATE 44100
#define REFERENCE_LEVEL 8192.0
#define SCALE_FACTOR 2.5
#define DB_THRESHOLD 60.0

Display Settings

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

Operation

The system operates through several key stages:

  1. Initialization

    • Configures I2S interface for audio sampling
    • Initializes OLED display
    • Establishes WiFi connection
    • Sets up ThingSpeak client
  2. Main Operation

    • Samples audio data continuously
    • Calculates real-time dB levels
    • Updates rolling averages
    • Displays current readings and status
    • Uploads data to ThingSpeak
  3. Data Display

    • Current dB level
    • Noise level status (HIGH/LOW)
    • Connection status indicators
    • Rolling averages (1-minute and all-time)

Data Analysis

The system calculates several metrics:

  • Instantaneous dB levels
  • One-minute rolling average
  • Overall average since startup
  • Threshold-based noise level classification

ThingSpeak Integration

Data is uploaded to ThingSpeak for long-term storage and analysis:

  1. Connects to ThingSpeak server
  2. Uploads dB readings every sampling cycle
  3. Provides visual confirmation of successful uploads
  4. Maintains error handling for failed uploads

Troubleshooting

Common issues and solutions:

  1. WiFi Connection Issues

    • Check network credentials
    • Verify network stability
    • Monitor WiFi status indicator on display
  2. Sensor Reading Issues

    • Verify I2S connections
    • Check microphone orientation
    • Ensure proper power supply
  3. Display Problems

    • Verify I2C connections
    • Check display address configuration
    • Monitor serial output for errors

Development

To modify or extend this project:

  1. Fork the repository
  2. Make your changes
  3. Test thoroughly
  4. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Developed by Gonzalo Novoa

Acknowledgments

  • 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.

Publication

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:

Research Article

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:

IEEE Citation Format

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.

About

ESP32 - IoT sound level monitoring in real-time with cloud connectivity for data logging and analysis through ThingSpeak integration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages