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?
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?
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:
Mostly analog design, mic, OPA, LM3914/3915/3916, arduino is a manager of bar-graph.
Medium complexity, mic, OPA, arduino doing software rectifier and log() and bar (54 dB);
// 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);
}