Elise GibneyAndrew YanLily GrayWilson Jeng
Created April 17, 2019

Team SneC Decibel Meter

Our simple and affordable decibel meter will give you a scientific basis for your noise complaints.

22
Team SneC Decibel Meter

Things used in this project

Hardware components

Grove Starter Kit for LaunchPad
Seeed Studio Grove Starter Kit for LaunchPad
We specifically used the Grove Base BoosterPack, 4-Digit Display and Sound Sensor from the kit.
×1
EK-TM4C123GXL TM4C Tiva LaunchPad
Texas Instruments EK-TM4C123GXL TM4C Tiva LaunchPad
×1

Software apps and online services

Energia
Texas Instruments Energia

Story

Read more

Schematics

labeled_photo.jpg

This is what it should look like when you put it together.

Schematic of Decibel Meter

Connections to a generic board

Code

decibel.ino

C/C++
Takes the readings from the sound sensor, converts it to voltage, and then turns the voltage into decibels in a form that can be displayed on the 4-digit display
#include "TM1637.h"
#define CLK 40//pins definitions for TM1637 and can be changed to other ports
#define DIO 39
#define SOUND_SENSOR       24           /* sound sensor pin */          
#define THRESHOLD_VALUE    0.775         /* The threshold to show the reading */

TM1637 tm1637(CLK,DIO);

/* Global Variables */
int sound_value = 0;       /* variable to store the value coming from sound sensor */

void setup() 
{

    
    tm1637.init();
    tm1637.set(BRIGHT_TYPICAL);//BRIGHT_TYPICAL = 2,BRIGHT_DARKEST = 0,BRIGHTEST = 7;
  
}
 
void loop() 
{
    /* read the Sound Sensor value */
    
    sound_value = analogRead(SOUND_SENSOR); 

    /* takes the sound value and converts it to voltage*/
    float voltage = (sound_value * 5)/1024;

    /*checks if the voltage is above the threshold*/
    if (voltage > THRESHOLD_VALUE)
    {
    /* calculates the decibel level from voltage*/
    int decibel = (int) 20 * log(voltage/0.775);
    /* gets each digit of decibel so that it can be displayed*/
    int digit0 = (decibel - (decibel % 1000))/1000;
    int digit1 = ((decibel % 1000) - (decibel % 100))/100;
    int digit2 = ((decibel % 100) - (decibel % 10))/10;
    int digit3 = (decibel % 10);
    /*displaying the decibel's digits on the 4-digit display*/
    tm1637.display(0,digit0);
    tm1637.display(1,digit1);
    tm1637.display(2,digit2);
    tm1637.display(3,digit3);
    /*pause so that the decibel level is readable*/
    delay(175);
    }
    
}

 

Credits

Elise Gibney
1 project • 0 followers
Contact
Andrew Yan
4 projects • 1 follower
Contact
Lily Gray
1 project • 0 followers
Contact
Wilson Jeng
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.