Smart Classroom Noise Monitor
The Smart Classroom Noise Monitor is a Python-based innovation project that monitors surrounding sound through a computer microphone. It displays the current noise condition using a graphical interface with green, yellow, and red indicators.
The system helps students understand classroom noise levels and encourages them to maintain a suitable learning environment. It also introduces students to audio processing, real-time data visualization, and Python programming.
Supplies
- Pictoblox Software: Download PictoBlox | Windows, MacOS, Linux, Chromebook, Android & iOS
- Laptop/PC
- Inbuilt or External Camera Setup
- Speaker or Headphones
Objectives
- Monitor sound captured by a computer microphone.
- Display a live relative noise-level indicator.
- Classify the environment as Quiet, Moderate Noise, or Too Noisy.
- Provide visual feedback through color-coded messages.
- Store periodic readings in a CSV file for later analysis.
Key Concepts
- Python programming
- Microphone input
- Digital audio signals
- Root-mean-square (RMS) calculation
- Conditional statements
- Real-time graphical user interfaces
- CSV data logging
Programming
Step 1: Install Python
Install Python 3 and verify the installation using the command python --version.
Step 2: Install the Libraries
Open Command Prompt or a terminal and run:
python -m pip install sounddevice numpy
These libraries provide microphone access and numerical calculations.
Step 3: Create the Program
Create a Python file named smart_classroom_noise_monitor.py. Copy the complete project code into the file and save it.
Step 4: Capture Microphone Input
The program uses the sounddevice library to receive audio samples from the microphone. It processes the samples in small blocks instead of recording and storing complete conversations.
Step 5: Calculate the Relative Noise Level
The program calculates the RMS amplitude of each audio block. It converts the amplitude into a relative 0–100 display value for easier visualization.
This value is not a calibrated decibel measurement.
Step 6: Classify the Noise
The program compares the relative level with two configured thresholds.
- Below 35: Quiet
- From 35 to 64: Moderate Noise
- 65 or above: Too Noisy
The thresholds can be adjusted after testing the microphone in the intended environment.
Step 7: Display the Result
The graphical interface shows the current status, a relative-level bar, and a short message.
- Green indicates Quiet.
- Yellow indicates Moderate Noise.
- Red indicates Too Noisy.
Step 8: Save Noise Readings
The program periodically appends a timestamp, relative level, and status to a CSV file named noise_monitor_log.csv.
This file can be opened in a spreadsheet application for further analysis.
Downloads
Test the Project
un the program and click Start Monitoring.
Test the monitor in a quiet environment, during normal conversation, and during a louder group activity. Compare the readings and adjust the thresholds if necessary.
Click Stop Monitoring when testing is complete.
Applications
- School classrooms
- Computer laboratories
- Libraries and reading rooms
- Meeting and training rooms
- Study areas and educational institutions
Conclusion
The Smart Classroom Noise Monitor demonstrates how Python can process microphone input and display real-time sound-level feedback. By combining audio processing, a graphical interface, and data logging, the project provides an engaging introduction to programming and practical problem-solving.