I'm back...

So yeah, 39.51 & 39.6 is

virtually no difference (it's 0.02dB). Do you have a link to the sensor specs? There are 3 different kinds of sensors. Plus, different sensors will have different sensitivities (they don't always publish the sensitivity).

What are you reading with "silence"? What are your peak readings?

- Make sure you are using

log10(). In C++ log() is the natural log and you'll get the wrong result.

- The formula will give you the dB

difference. If everything is working properly with your 70dB reference, the formula should return a result of +10dB with an 80dB signal.

You might want to experiment with a spreadsheet. In Excel, LOG() is base-10 log so you can use it.

Some "handy" dB numbers to remember:

A voltage/amplitude factor of 2 is 6dB (double the voltage is +6dB, half the voltage is -6dB).

A power factor of 2 is 3dB.

A voltage/amplitude factor of 10 is 20dB.

A power factor of 10 is 10dB.

Note - Real SPL meters are

Weighted so it's difficult to make a good-accurate homemade SPL meter. But, as long as you calibrate with the same "kind" of noise/sound that you'll be measuring, your homemade SPL meter can still be useful. (Just don't rely on it for legal or regulatory purposes.)