I am trying to get a decidable reading using an Arduino Nano but for some reason the dB reading I am getting is no where near the dB reading I am getting using another device. Can anyone point me in the right direction or tell me what I am doing wrong.
Here is my code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2);
}
void loop()
{
int sensorValue = analogRead(5);
double db = 20.0 * log10(sensorValue / 5.0) ;
lcd.setCursor(0, 0);
lcd.print("dB Measurement");
lcd.setCursor(0, 1);
delay(100);
lcd.print(db);
lcd.print(" dB ");
}
I have attached what my breadboard looks like if anyone has any questions on that. The Sound Detector I am using is this one.