Sound Level Meter Build: dB Measurement with Arduino
Building a sound level meter with Arduino that accurately measures sound in decibels (dB) is a rewarding project with real-world applications — workplace noise compliance, home studio monitoring, or city noise pollution mapping. This guide covers the electronics and firmware for a calibrated dB measurement system using an electret microphone module, Arduino, and OLED display. You’ll learn the physics of dB measurement, calibration techniques, and how to meet Indian occupational noise standards (IS 3483 and the Noise Pollution Control Rules, 2000).
Understanding Decibels and Sound Level Physics
The decibel (dB) is a logarithmic unit expressing the ratio of a measured sound pressure to a reference pressure. The reference is 20µPa — the threshold of human hearing. The formula:
// Sound Pressure Level (SPL) formula:
// SPL_dB = 20 × log10(P_measured / P_reference)
// Where P_reference = 20µPa (0.00002 Pa)
//
// Common reference levels:
// 0 dB = Threshold of hearing (20µPa)
// 30 dB = Library, quiet bedroom
// 60 dB = Normal conversation
// 85 dB = Prolonged exposure damage threshold (NIOSH)
// 90 dB = Indian factory floor limit (8-hour TWA, IS 3483)
// 110 dB = Chainsaw, rock concert
// 120 dB = Pain threshold
// 140 dB = Jet engine at 30m
A key insight: every 6dB increase represents a doubling of sound pressure; every 10dB increase sounds roughly twice as loud to human perception. This logarithmic compression is why a whisper (30dB) and a jackhammer (100dB) represent a pressure difference of over 3,000×.
Components and Circuit Design
- Arduino Nano or Uno (₹250-350)
- Electret microphone module with op-amp (MAX4466 preferred for its AGC, or LM393 variant) (₹80-150)
- OLED 128×64 display (I2C, SSD1306) (₹180-250)
- 10-segment LED bar or NeoPixel strip for visual level display (₹50-100)
- 100µF + 10µF + 100nF decoupling capacitors (₹20)
- Optional: SD card module for data logging (₹80-120)
- Optional: RTC DS3231 for timestamped logging (₹120-180)
- Total build cost: ₹700-1200
Recommended Product
Analog Sound Sensor Microphone Module for Arduino
High-sensitivity electret microphone module with adjustable gain — the core input component for your dB sound level meter build. Analog output directly readable by Arduino ADC.
Category: Audio & Sound Modules
Circuit Design Notes
/* Circuit: Arduino Sound Level Meter
*
* Microphone Module:
* VCC → Arduino 3.3V (not 5V for lower noise!)
* GND → Arduino GND
* OUT → Arduino A0
* Gain pot → Adjust for +/-2V swing maximum (avoid clipping)
*
* OLED Display (SSD1306 I2C):
* VCC → Arduino 3.3V or 5V
* GND → Arduino GND
* SCL → Arduino A5 (SCL)
* SDA → Arduino A4 (SDA)
*
* LED Bar Graph (optional visual indicator):
* Pin 2-11 → LED anodes (via 220Ω to GND)
*/
Arduino Sound Level Meter Code
// Arduino Sound Level Meter
// Measures RMS sound pressure and converts to dB SPL
// Requires calibration for accurate absolute dB readings
#include <U8g2lib.h> // OLED library
// Display initialization (I2C OLED)
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
#define MIC_PIN A0
#define SAMPLE_WINDOW 50 // Sample window in ms (50ms = 20 readings/sec)
#define NUM_SAMPLES 2400 // Samples in 50ms at Arduino's ~48kHz ADC speed
// Calibration constants (adjust after calibration against reference meter)
#define DB_OFFSET 48.0 // Offset to match reference SPL meter at 60dB
#define VREF 5.0 // Arduino reference voltage
#define ADC_BITS 1024.0 // Arduino 10-bit ADC
// A-weighting filter coefficients (approximate for 1kHz center)
// Full A-weighting requires IIR filter — simplified version here
float aWeightOffset = 0; // -2dB at 40kHz, +1dB at 1kHz, -6dB at 63Hz approx.
void setup() {
analogReference(DEFAULT); // 5V reference for maximum dynamic range
Serial.begin(115200);
u8g2.begin();
u8g2.setFont(u8g2_font_ncenB14_tr);
Serial.println("dB Sound Level Meter Ready");
Serial.println("WARNING: Uncalibrated - readings are relative");
}
void loop() {
// Step 1: Sample audio for SAMPLE_WINDOW milliseconds
unsigned long startTime = millis();
unsigned long sampleCount = 0;
double sumSquares = 0;
while (millis() - startTime 0.0001) {
db = 20.0 * log10(rms) + DB_OFFSET;
db = max(db, 20.0); // Clamp minimum to 20dB (our noise floor)
db = min(db, 130.0); // Clamp maximum
} else {
db = 20.0; // Noise floor
}
// Step 4: Slow peak hold (decays 0.5dB per cycle)
static double peakDb = 20.0;
if (db >= peakDb) {
peakDb = db;
} else {
peakDb -= 0.5;
peakDb = max(peakDb, db);
}
// Step 5: Leq accumulation (time-averaged dB over 1 minute)
static double sumLinear = 0;
static int leqCount = 0;
static unsigned long leqStart = millis();
sumLinear += pow(10, db / 10.0);
leqCount++;
double leq = 0;
if (leqCount > 0) {
leq = 10.0 * log10(sumLinear / leqCount);
}
// Reset Leq every 60 seconds
if (millis() - leqStart > 60000) {
sumLinear = 0;
leqCount = 0;
leqStart = millis();
}
// Output to Serial
Serial.print("dB: "); Serial.print(db, 1);
Serial.print(" | Peak: "); Serial.print(peakDb, 1);
Serial.print(" | Leq(1min): "); Serial.println(leq, 1);
// Update OLED
updateDisplay(db, peakDb, leq);
}
void updateDisplay(double db, double peak, double leq) {
u8g2.clearBuffer();
// Main dB reading (large)
u8g2.setFont(u8g2_font_logisoso28_tr);
char dbStr[10];
sprintf(dbStr, "%.0f", db);
u8g2.drawStr(0, 35, dbStr);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(60, 35, "dB SPL");
// Bar graph (20-110dB mapped to 128 pixels)
int barWidth = map((int)db, 20, 110, 0, 128);
u8g2.drawBox(0, 40, barWidth, 10);
u8g2.drawFrame(0, 40, 128, 10);
// Peak and Leq
u8g2.setFont(u8g2_font_6x10_tr);
char info[30];
sprintf(info, "Pk:%.0f Leq:%.0f", peak, leq);
u8g2.drawStr(0, 63, info);
u8g2.sendBuffer();
}
Calibration Methods
Without calibration, your meter measures relative loudness, not true dB SPL. Three calibration approaches:
Method 1: Reference Sound Source (Best)
Use a phone app showing calibrated dB (like NIOSH SLM) alongside your Arduino meter. Adjust DB_OFFSET until readings match at 60-70dB. Best accuracy: ±2-3dB.
Method 2: Known Tone at Known Distance
// Calibration using pink noise
// 1. Generate pink noise at 70dB from phone speaker at 30cm
// 2. Note your Arduino's raw dB reading
// 3. DB_OFFSET = 70 - raw_reading
//
// Example: if raw_reading = 22 when reference = 70dB
// DB_OFFSET = 70 - 22 = 48 (as in code above)
Method 3: Commercial SPL Meter
The most reliable approach — borrow a Class 2 SPL meter (available at electronics rental shops, or buy for ₹1500-3000) and cross-calibrate. Calibrate at 3-4 different levels (50, 65, 80, 95dB) for linearity verification.
Recommended Product
INMP441 MEMS Microphone — High Precision SNR
For precision sound level meters, upgrade to MEMS microphone with ±1dB sensitivity tolerance vs ±3-5dB for electret. Higher frequency response and consistent calibration.
Category: Audio & Sound Modules
Indian Noise Standards and Compliance
India’s noise regulations are governed by the Noise Pollution (Regulation and Control) Rules, 2000 under the Environment Protection Act, 1986. Ambient noise standards by zone:
| Zone | Day (6AM-10PM) dB(A) | Night (10PM-6AM) dB(A) |
|---|---|---|
| Industrial | 75 | 70 |
| Commercial | 65 | 55 |
| Residential | 55 | 45 |
| Silence Zone (hospitals/schools) | 50 | 40 |
For occupational noise in factories, IS 3483:1965 (revised) sets the maximum 8-hour TWA at 90dB(A), aligned with ILO standards. Exposures above 115dB(A) are prohibited even for short durations.
Data Logger with SD Card
// Add SD card logging to sound level meter
#include <SD.h>
#include <RTClib.h>
#define SD_CS_PIN 10
RTC_DS3231 rtc;
void initLogger() {
if (!SD.begin(SD_CS_PIN)) {
Serial.println("SD init failed!");
return;
}
if (!rtc.begin()) {
Serial.println("RTC not found!");
return;
}
// Create/open log file with today's date
DateTime now = rtc.now();
char filename[20];
sprintf(filename, "%02d%02d%04d.CSV", now.day(), now.month(), now.year());
File logFile = SD.open(filename, FILE_WRITE);
if (logFile) {
logFile.println("Timestamp,dB_SPL,Peak_dB,Leq");
logFile.close();
}
}
void logReading(double db, double peak, double leq) {
DateTime now = rtc.now();
char filename[20];
sprintf(filename, "%02d%02d%04d.CSV", now.day(), now.month(), now.year());
File logFile = SD.open(filename, FILE_WRITE);
if (logFile) {
char entry[100];
sprintf(entry, "%04d-%02d-%02d %02d:%02d:%02d,%.1f,%.1f,%.1f",
now.year(), now.month(), now.day(),
now.hour(), now.minute(), now.second(),
db, peak, leq);
logFile.println(entry);
logFile.close();
}
}
// Log every 1 second — generates ~86,400 rows/day
// 1GB SD card holds ~3 years of continuous logging
Recommended Product
5V Active Buzzer Module for Arduino
Add an audible alarm to your sound meter — triggers when ambient noise exceeds your set threshold (85dB for hearing protection, or 55dB for residential compliance).
Category: Audio & Sound Modules
Frequently Asked Questions
Q: How accurate is an Arduino-based sound level meter?
A: With calibration, ±3-5dB accuracy is achievable. Professional Class 1 meters are ±1dB, Class 2 are ±1.5dB. For compliance testing in Indian workplaces, only certified Class 1 or 2 meters are legally accepted. Arduino meters are suitable for indicative measurements, personal monitoring, and educational purposes.
Q: What’s the difference between dB and dB(A)?
A: dB is unweighted sound pressure. dB(A) applies A-weighting — a filter that mimics human hearing sensitivity (less sensitive to bass and very high frequencies, most sensitive around 1-4kHz). Indian noise standards use dB(A). Implementing full A-weighting requires an IIR digital filter, which is possible on Arduino but adds complexity.
Q: Can I use MAX9814 microphone module for better accuracy?
A: Yes — the MAX9814 has AGC (Auto Gain Control) that maintains consistent output across a wide dynamic range. However, AGC makes absolute dB calibration tricky because the gain changes automatically. For SLM applications, use MAX4466 with AGC disabled (or a simple electret module) with fixed gain for consistent calibration.
Q: What is Leq and why is it important?
A: Leq (equivalent continuous sound level) is the steady sound level that, over the measurement period, contains the same total energy as the fluctuating noise. It’s the standard metric for workplace noise assessment and environmental noise regulations in India. A 5-minute Leq above 85dB(A) indicates significant noise exposure.
Q: How do I reduce ambient electrical noise in my sound meter readings?
A: Key techniques: (1) Power from batteries instead of USB/mains, (2) Use 3.3V for microphone supply via linear regulator, (3) Add 100µF+100nF bypass caps close to mic module, (4) Shield microphone in metal enclosure connected to ground, (5) Avoid routing mic signal cable near power lines, (6) Use twisted pair wire for microphone signal.
Add comment