Hi
I’m looking at this link (http://www.sengpielaudio.com/calculator-gainloss.htm) to get the formula for converting voltage to dB. I use a sound sensor connected to Arduino (0-1024) and I want to convert this to acoustic energy (dB) (for display, etc).
As I understand this, 1024 values (or 0 to 5V) would equal to 60 decibel units, so if I use the formula -> (20*log10)*V/V0, I will get from 0 to 60 – and then I can offset by an amount if I want to match proper settings (i.e. 0 would then equal approximately 20-30 dB).
As I understand this, 1024 values (or 0 to 5V) would equal to 60 decibel units, so if I use the formula -> (20*log10)*V/V0, I will get from 0 to 60
No. Voltage is RMS value in the formula, your range 0-1023 is peak-to-peak. You have to divide by 2 in the first, and than by sqrt(2). 1024 / 2 * sqrt(2) = 362. Roughly, you can get about 53-54 dB at the best - perfectly centered steady sine wave. Less than 40 dB for normal audio content.
Options: use ADC with more bits, or averaging. http://coolarduino.wordpress.com/2013/01/09/audio-vu-meter/
As I understand this, 1024 values (or 0 to 5V) would equal to 60 decibel units, so if I use the formula -> (20*log10)*V/V0, I will get from 0 to 60
No. Voltage is RMS value in the formula, your range 0-1023 is peak-to-peak. You have to divide by 2 in the first, and than by sqrt(2). 1024 / 2 * sqrt(2) = 362. Roughly, you can get about 53-54 dB at the best - perfectly centered steady sine wave. Less than 40 dB for normal audio content.
Options: use ADC with more bits, or averaging. http://coolarduino.wordpress.com/2013/01/09/audio-vu-meter/
But the smallest signal you can see is 1 count peak-to-peak, not 1 count RMS,
so its 1023 times smaller than the max, ie 60.2dB less.
1 count peak-to-peak, not 1 count RMS,
so its 1023 times smaller than the max, ie 60.2dB less.
I never heard someone would measure DC voltage in dB. For AC there is an offset, and full span is only 512 , it gets to 6.02 * 9 + 1.76 = 55.94
I agree, that 512 is higher than 362, which I counted in integer math term, and basically isn't always the case
So, is there any formula that works to convert the voltage in dB SPL? I have tried many different ways, but I always get false results. There has to be something out there - or if could someone direct me to resources?
Again, I want to convert the voltage in db SPL (sound pressure level), with a minimum value of around 30dB, and a maximum at around 90dB.
Thanks!
So, is there any formula that works to convert the voltage in dB SPL?
No, otherwise it has to include mic sensitivity , amplification coef. and arduino reference voltage. You have to calibrate with a standard device, in special soundproof chamber.
Is your sensor just a microphone? If so, you cannot just convert any single value to dB, you need to know the amplitude of your signal, and possibly filter it for A-weighting if this is for an SPL meter.
I thought it would convert from a voltage range of values to a logarithmic range of decibel values from 50 to 100.
I get negative values (i.e. -13.7) in silence, and inf values with noise...