KY-038 analog value to decibel

Dear community,

I use a Wemos D1 Mini with Tasmota in our basement which is also our bands rehearsal room. I have attached a BME280 to monitor temperature and humidity to check that our gear has a good environment which works great. In addition, I connected a KY-038 sound sensor to monitor sound-level, specifically I want to monitor decibels during the rehearsals.

I randomly set the potentiometer to the analog value of 760 which is equivalent to 50db (just checked with a smartphone app, nothing special). When the noise level rises during the reheasels, the analog value decreases. So from my understanding the louder it is, the lower the analog value. But how can I properly calculate the analog value to (more or less) correct value of decibels?

If found the formula dB = 20*log10(V/V0) from the old thread https://forum.arduino.cc/index.php?topic=560718.0, but unformatunalty without any outcome from the users.

Can you give me a more specific hint how to calculate the analog value to decibel? Am I on a right track in general or do I need another hardware to get this done?

Thanks for your support and best regards,
Markus

The formula you posted is actually for dbV (Deci Bel Volts) where we look at a ratio of a voltage change. If looking at sound pressure is dbA and becomes 10 * Log rather than 20 * Log. Again db is merely used to express a ratio. From the WiKi:

"One decibel (0.1 bel) equals 10 times the common logarithm of the power ratio. Expressed as a formula, the intensity of a sound in decibels is 10 log10 (S1/S2), where S1 and S2 are the intensity of the two sounds; i.e., doubling the intensity of a sound means an increase of a little more than 3 dB".

Since db merely expresses a ratio and the change is logarithmic. 0 decibel is the so-called hearing threshold for the human ear. Obviously that will vary person to person. My threshold is not what it was 50 years ago. :slight_smile: Since a point of reference is needed that is what is used for sound pressure. There are also weighing factors for sound which for now can be left alone.

This is a good read on the subject and why you are seeing what you see I don't know. My best suggestion would be to get a good audio meter. You also want to consider distance from source of sound and how quickly the sound pressure level drops with distance.

Ron

Calibrate with a known good dB(A) meter. A phone may work for this - if your phone itself has been calibrated against a known source or the measurement of a known good dB(A) meter.

Get a few measurements of dB, write down the analog values, and fit the dB(A) curve - which is indeed logarithmic - to this. Knowing the response of your microphone to different volume and frequencies will be helpful as well.

I did it as you suggested, I just compared the analog values to my smart phone app to get some kind of accurate mapping. This is my result:

Analog dB(a)_Calc
760 23
759 30
758 63
757 75
756 77
755 80
754 83
753 86
752 90
751 93
750 96
749 100
748 103
747 106
746 110
745 113
744 116
743 119
742 123
741 126
740 129

739 will be > 130 decibel; 761 will be <20 decibel. This is enough for me to write this in a graph with Grafana using InfluxDb and openHAB 2:

Lets see how the graph will react as soon full-band rehearsals are allowed again in our region.

Thanks for your advices :slight_smile:

740-760 is an awefully small part of the 0-1023 range of the ADC. Also the ADC has an error of +/- 1-2 points, which in your case is >10 dB(A) difference. That makes the measurement seem rather useless.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.