DB meter with Arduino

Hi!!
I am developing a project where I would like to measure real values of decibels (dB) with Arduino.
The problem until know is the lack of good microphones to register the dB levels and convert it to Volts.

Do you have any suggestion to achieve this goal, or a similar project?

Obrigado :wink: :wink:

SFE has a electret mic board, if it's not "good" enough, what is your requirements dB level, dynamic range, freq. response?

Hi, my name is Rúben..I´m also working in the same project with Xaral.
We are just beginning in this world and we want to measure the noise level of a classroom and get values in dBA..do you think we can achieve that goal with the sensor you advised?I think the range measurement should be something like 0 to 80 dBA,isn´t it?

Thanks

The mic should be least of your worry, there is no data at SPE SparkFun Electret Microphone Breakout - BOB-12758 - SparkFun Electronics, but usually electret mic works fine in
commercial meters. Dynamic 0-85 looks quite ambitions, you can't make it with 10-bit arduino ADC ( 54 dB max, 9-bit + sign). Options:

  1. Mostly analog design, mic, OPA, LM3914/3915/3916, arduino is a manager of bar-graph.
  2. Medium complexity, mic, OPA, arduino doing software rectifier and log() and bar (54 dB);
  3. Same as 2 plus weighting filter in software (dBA); Weighting filter - Wikipedia
  4. External ADC, PCM1803 or similar, software filter A and so on , probably w/o arduino ( not fast enough) .
// Define hardware connections
#define PIN_GATE_IN 2
#define IRQ_GATE_IN  0
#define PIN_LED_OUT 13
#define PIN_ANALOG_IN A0

// soundISR()
// This function is installed as an interrupt service routine for the pin
// change interrupt.  When digital input 2 changes state, this routine
// is called.
// It queries the state of that pin, and sets the onboard LED to reflect that 
// pin's state.
void soundISR()
{
  int pin_val;
  
  pin_val = digitalRead(PIN_GATE_IN);
  digitalWrite(PIN_LED_OUT, pin_val);   
}

void setup()
{
  Serial.begin(9600);
  
  //  Configure LED pin as output
  pinMode(PIN_LED_OUT, OUTPUT);
  
  // configure input to interrupt
  pinMode(PIN_GATE_IN, INPUT);
  attachInterrupt(IRQ_GATE_IN, soundISR, CHANGE);

  // Display status
  Serial.println("Initialized");
}

void loop()
{
  int value;
  
  // Check the envelope input
  value = analogRead(PIN_ANALOG_IN);
  
  // Convert envelope value into a message
  Serial.print("Status: ");
  if(value <= 10)
  {
    Serial.println("Quiet.");
  }
  else if( (value > 10) && ( value <= 30) )
  {
    Serial.println("Moderate.");
  }
  else if(value > 30)
  {
    Serial.println("Loud.");
  }
  
  // pause for 1 second
  delay(1000);
}