Hello everyone,

I am trying to interface a microphone with my Arduino Mega. This microphone can be found here. https://www.robotshop.com/media/files/pdf/sound-sensor-module-arduino-datasheet.pdf

I have my microphone connected as follows.

-DO to Nothing - (+) terminal to 5V - (G) to Ground - A0 to analog input A0

Here is my problem. I would like to display the voltage reading from the register as a dB reading from 48-66dB

The analog to digital converter is 0-1023 so 10 bits. I came up with a little program to simulate this and represent the voltage value in dB. I keep on getting 110 as my answer on the serial monitor when it should be between 48 and 66 dB.

Say for instance we get a reading on the ADC of 80. We would take 80/1023 to get 0.078.

Next we would find where that answer is on the scale using some algebra on a scale from 48 dB to 66dB

48 = 251.18 and 66 = 1995.26. I got these by doing algebra with this 48 = 20log(A1/A0) and 66 = 20log(A1/A0)

next we would do this 0.078*(1995.26 - 251.18) + 251.18 = 387.218 after that we simply put that answer into our formula 20 log (387.218) = 51.75dB

See it works!!! My math is correct. My program does not work however. Here it is.

```
int AnalogReading = A0;
void setup() {
// put your setup code here, to run once:
Serial.begin (9600);
}
void loop() {
// put your main code here, to run repeatedly:
int SensorValue = analogRead (AnalogReading);
float maximundB = pow(10, 3.3);
float minimum = pow(10 , 2.4) ;
float dB = 20 * log( (SensorValue / 1023) *((maximundB) - minimum) + (minimum));
delay (750);
Serial.println ( dB, DEC );
}
```