Arduino-Based Digital Decibel Meter

Decibelmeter

 1. Introduction

A Digital Decibel (dB) Meter is a device used to measure sound intensity. In the automotive world, this is a vital tool for checking if a vehicle's horn stays within the legal noise limits set by the transport department (MVD).

Using an Arduino and a High-Sensitivity Sound Sensor, we can build a portable meter that not only shows real-time sound levels but also captures the Peak (Maximum) Decibels during a horn blast. This project is highly efficient, portable, and perfect for DIY vehicle diagnostics.


2. Components

ComponentQuantityDescription
Arduino Uno / Nano1Microcontroller for signal processing
MAX9814 or LM393 Sound Sensor1Microphone module with Analog Output
16x2 I2C LCD Display1Displays real-time and peak dB levels
Push Button1To reset the Peak (MAX) reading
9V Battery / Power Bank1Portable power source for vehicle testing
Jumper Wires & BreadboardAs requiredFor circuit connections

3. Circuit and Connections

Pinout Diagram of Arduino Uno R3
Pinout Diagram of Arduino Uno

MAX9814 Pinout Diagram
MAX9814 Pinout Diagram

LM393 Sound Sensor Pinout Diagram
LM393 Sound Sensor Pinout Diagram

* Note: Only One Sound Sensor Required


Pinout Diagram of LCD with I2C
Pinout Diagram LCD WITH I2C

KY-004 Push Button Module Pinout Diagram
KY-004 Push Button Module Pinout Diagram

Circuit Overview:

  1. Sound Detection: The sensor detects sound waves and converts them into an analog voltage.

  2. Processing: Arduino reads the analog peaks and calculates the Decibel value using a logarithmic formula.

  3. Display: The LCD shows the current noise level and holds the highest recorded value (Peak).

Pin Connections:

ComponentArduino PinNotes
LCD I2C (SDA)A4Data Line
LCD I2C (SCL)A5Clock Line
Sound Sensor (AO)A0Analog Output of the sensor
Push ButtonD2To reset the Peak (MAX) value
VCC / GND5V / GNDCommon power and ground

Note: For horn testing, the MAX9814 sensor is recommended over the LM393 because it features Auto Gain Control, preventing the signal from "clipping" when exposed to very loud noises (90dB+).


4. Detailed Step by Step Circuit Working

  • Acoustic Sensing: The microphone picks up the sound pressure from the vehicle horn.
  • Peak-to-Peak Detection: The code samples the sound wave for 50ms to find the maximum and minimum voltage levels. This is more accurate than a single reading.
  • Decibel Calculation: Sound is non-linear. The Arduino uses the formula 

                dB = 20 log10 (Voltage)  

           to convert the electrical signal into decibels.

  • Peak Hold: When a horn is pressed, the sound is sudden. The Arduino stores the highest value so the user can read it even after the horn stops.


5. Code

C++
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

const int sampleWindow = 50; 
float maxDB = 0;
const int resetPin = 2;

void setup() {
  pinMode(resetPin, INPUT_PULLUP);
  lcd.init();
  lcd.backlight();
  lcd.print("Horn DB Tester");
  delay(2000);
  lcd.clear();
}

void loop() {
  unsigned long startMillis = millis();
  unsigned int peakToPeak = 0;
  unsigned int signalMax = 0;
  unsigned int signalMin = 1024;

  // Collect data for 50 mS
  while (millis() - startMillis < sampleWindow) {
    int sample = analogRead(A0);
    if (sample < 1024) {
      if (sample > signalMax) signalMax = sample;
      else if (sample < signalMin) signalMin = sample;
    }
  }

  peakToPeak = signalMax - signalMin;
  float volts = (peakToPeak * 5.0) / 1024;
  
  // Calibrated formula for high-intensity sound
  float decibels = (20 * log10(volts / 0.001)) + 40; 

  if (decibels > maxDB) maxDB = decibels;
  
  // Reset MAX reading
  if (digitalRead(resetPin) == LOW) maxDB = 0;

  lcd.setCursor(0, 0);
  lcd.print("Noise: ");
  lcd.print(decibels, 1);
  lcd.print(" dB   ");

  lcd.setCursor(0, 1);
  lcd.print("MAX: ");
  lcd.print(maxDB, 1);
  lcd.print(" dB   ");

  delay(50);
}

6. Detailed Step by Step Code Working

  1. Library & Setup: We use the LiquidCrystal_I2C library for the display. Pin D2 is set as an INPUT_PULLUP for the reset button.

  2. Sampling Window: The while loop collects sound data for 50 milliseconds. This ensures we catch the "peak" of the sound wave.

  3. Voltage Conversion: The raw analog value is converted into a standard voltage (0-5V).

  4. Logarithmic Logic: The log10 function is used to scale the voltage into decibels, matching how humans hear sound.

  5. Peak Logic: The code compares the current decibels to maxDB. If the current sound is louder, it updates the memory.


7. Tips for Accurate Testing

  • Standard Distance: For vehicle testing, hold the meter 1 meter away from the horn at a 45-degree angle.

  • Open Environment: Always test in an open space. Walls and roofs cause reflections that make the horn sound louder than it actually is.

  • Sensitivity Adjustment: Use the small screw (trimpot) on the back of the sensor to adjust the baseline until a quiet room reads about 30-40 dB.

  • Power: Use a battery for testing so that engine electrical noise doesn't interfere with the Arduino's readings.


8. Uses

  • Testing aftermarket car/bike horns for legal compliance.

  • Measuring noise pollution in silent zones (hospitals/schools).

  • Checking the sound insulation of a vehicle cabin.

  • Educational physics experiments regarding sound waves.


9. Conclusion

This Arduino Decibel Meter is a practical and low-cost solution for anyone interested in automotive electronics. By combining simple sensors with mathematical processing, we can turn a basic Arduino into a professional diagnostic tool. Whether you are checking your own vehicle or working on a school project, this meter provides reliable and clear results.

തുടക്കക്കാർക്കായി ഇലക്ട്രോണിക്സ് ലളിതമായി പഠിക്കാം.

Empowering students in Kerala with hands-on technical skills.