1

I'm experimenting with an electret microphone, specifically this one. I put it on my scope and I see what I expect - a really small voltage, typically under 20mV, that varies appropriately with sound.

However, when I put it into my Arduino (connecting signal pin to A0, V to 5V, and G to GND) and read it using analogRead on the appropriate pin, I end up getting a strange offset. The analog read should read 0 more or less constantly, due to the low voltage coming out of the board. However, I get an offset of around 425 counts on the ADC, implying that the voltage is somewhere around 2.5V.

What's going on? Why would the arduino be reading a voltage when there isn't any?

  • When you test it with a scope, what supply voltage are you using? – AnT May 28 at 15:10
  • 5V, from the Arduino 5V pin – Michael Stachowsky May 28 at 17:09
3

An electret microphone is like a resistor which changes its value according to the sound.

To use it you must form a voltage divider with it, as if it were half of a potentiometer.

Thus you add a resistor to +5V (which is already on the board). This means that when it is silent the voltage you get is the ratio of the resistor and the resistance of the microphone.

If the resistance has been chosen correctly then the output you get should be roughly half the supply voltage when silent. Any sound will cause that output to swing around that "zero" point.

It's just like a potentiometer. When silent the potentiometer is in the central point. When you make noise you're moving the potentiometer in both directions.

To get rough values you should first get the "silent" reading from analogRead. You can then subtract that value from all subsequent readings.

Note that the results will be non-linear. To do it properly you should calculate the resistance of the microphone by using the supply voltage, the "upper" resistor value, and the sampled voltage to calculate the resistance value like you would for any other resistive sensor (such as an LDR or force sensitive resistor).

  • You're right. I think something is wrong with my scope, then, because it showed the output centered around 0V. Looking at it on a multimeter and it's at 2.5V when quiet. – Michael Stachowsky May 28 at 17:14
  • Is your scope set to AC coupling? – Majenko May 28 at 17:29
  • It was set to DC coupling, but I think that something is wrong with that particular mode. There is no difference between AC and DC coupling, leading me to believe that the coupling circuitry is not disengaging, causing my confusion above – Michael Stachowsky May 28 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.