Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Sound Level Meter with LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO Sound Level Meter with LCD Display

Circuit Documentation

Summary

This circuit consists of an Arduino UNO microcontroller, a sound sensor, and an LCD screen (16x2) with I2C interface. The sound sensor detects sound levels and sends the data to the Arduino, which processes the data and displays the sound level and intensity on the LCD screen.

Component List

Arduino UNO

Sound Sensor

LCD Screen 16x2 I2C

Wiring Details

Arduino UNO

Sound Sensor

LCD Screen 16x2 I2C

Code Documentation

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

// Initialize the LCD (I2C address: 0x27, 16 columns, 2 rows)
LiquidCrystal_I2C lcd(0x27, 16, 2);

int num_Measure = 128; // Number of measurements for averaging
int pinSignal = A0;    // Sound sensor signal pin
long Sound_signal;     // Variable to store sound sensor readings
long sum = 0;          // Sum of measurements for averaging
long level = 0;        // Average sound level
int soundlow = 40;     // Threshold for low intensity
int soundmedium = 500; // Threshold for medium intensity

void setup() {
  pinMode(pinSignal, INPUT);  // Set the sound sensor pin as input
  Serial.begin(9600);         // Initialize serial communication
  
  // Initialize the LCD
  lcd.init();
  lcd.backlight();
}

void loop() {
  // Perform 128 readings from the sound sensor
  for (int i = 0; i < num_Measure; i++) {
    Sound_signal = analogRead(pinSignal);
    sum += Sound_signal;
  }

  // Calculate the average sound level
  level = sum / num_Measure;

  // Display the sound level on the LCD
  lcd.setCursor(0, 0);          // Set cursor to the first row
  lcd.print("Sound Level= ");
  lcd.print(level - 33);        // Display the adjusted sound level

  // Display the intensity description
  lcd.setCursor(0, 1);          // Set cursor to the second row
  if (level - 33 < soundlow) {
    lcd.print("Intensity= Low  ");
  } else if (level - 33 >= soundlow && level - 33 < soundmedium) {
    lcd.print("Intensity=Medium");
  } else {
    lcd.print("Intensity= High ");
  }

  // Reset the sum and add a short delay
  sum = 0;
  delay(200);
}

This code initializes the LCD and sound sensor, reads the sound levels, calculates the average sound level, and displays the sound level and intensity on the LCD screen. The sound intensity is categorized into low, medium, and high based on predefined thresholds.