0
\$\begingroup\$

I am trying to get an electret mic to detect sound, which I can then pick up using a Raspberry Pi Pico ADC pin.

My electret has two output pins. One is connected to ground, the other is connected to the Picos ADC pin, and also to the Picos 3.3V reference voltage over a resistor, R1.

The voltage detected by the ADC pin is fixed at a constant regardless of the sound incident on the electret.

I varied R1 over several values between 220 through to 2,000 Ohms, and in each case the voltage is different (dependant on resistance) but remains fixed as before.

I thought that incident sound waves would drive the microphone diaphragm thus generating an AC current. From this I would expect the Pico to be able to read this AC current with the setup I describe above, but it isn't.

I've seen some schematics online showing a capacitor placed between the ADC pin and the mic, which I would assume only introduces a phase offset and removes the DC component. From this I can't see it would solve my issue with the voltage reading.

The specific electret component I have is listed here: https://kitronik.co.uk/products/3310-microphone-insert-pcb-mount-pack-of-5?_pos=1&_sid=3e44071e0&_ss=r

I believe it to have an in-built op-amp on the + pin.

Any help in pointing out where my issue could be would be appreciated. An explanation of why would also be helpful.

\$\endgroup\$
1
  • \$\begingroup\$ Wrt the comment about "some schematics online showing a capacitor", bear in mind that also the datasheet for the component you're using, is showing that capacitor in its diagram. \$\endgroup\$
    – MrGerber
    Aug 15 at 10:59

3 Answers 3

9
\$\begingroup\$

The output amplitude is so low the MCU ADC can't measure anything except the DC bias voltage. Contrary to your assumption, there is no built-in op-amp in the mic capsule.

You will need a suitable amplifier circuit between the electret mic capsule and MCU ADC input. Approximately the amplification needs to be around 40 dB, or even more.

\$\endgroup\$
1
\$\begingroup\$

Your electret's datasheet specifies:

enter image description here

It's been a while, but this is an old way of writing out sensitivity.

One bar is \$10^5\:\text{Pa}\$. So \$1\:\mu\text{bar}\$ is \$100\:\text{mPa}\$.

Today, we usually use one Pascal as the reference, so this means we need to add \$20\:\text{dB}\$ to the written specification for comparison with more common specs today.

\$60\:{\text{dB}_\text{SPL}}\$ is a loud conversational level. \$40\:{\text{dB}_\text{SPL}}\$ is the lower end of conversational levels.

Loud, the output would be \$20\:\mu\text{Pa} \times 10^{^\frac{60\:{\text{dB}_\text{SPL}}-54\:{\text{dB}_\text{SPL}}+20\:{\text{dB}_\text{SPL}}}{20}} \$ or about \$400\:{\mu\text{V}_\text{PK}}\$. It will be about 10 times less, or about \$40\:{\mu\text{V}_\text{PK}}\$ at the lower end of conversational levels.

This assumes, as stated, that \$R_\text{L}=1\:\text{k}\Omega\$. You can use a higher voltage where possible, but this also means a larger \$R_\text{L}\$. In this case, I'd just recommend a standard \$9\:\text{V}\$ alkaline battery as the voltage source. I usually anticipate that the electret will require about \$1.5\:\text{V}\$ itself. And since a standard \$9\:\text{V}\$ alkaline battery is really more like \$8.5\:\text{V}\$, I'd use \$7\:\text{V}\$ as the resistor drop. I also usually expect an electret requires \$500\:\mu\text{A}\$. So this means \$R_{_\text{L}}=\frac{8.5\:\text{V}-1.5\:\text{V}}{500\:\mu\text{A}}=14\:\text{k}\Omega\$.

I'd select \$10\:\text{k}\Omega\$, though. (Some of the electrets can use a little more current.)

Given this resistor value is 10 times the one they specified, you can expect about 10 times the AC output voltage, but obviously now with a source resistance that is also 10 times higher. So between \$400\:{\mu\text{V}_\text{PK}}\$ and \$4\:{\text{mV}_\text{PK}}\$ and with a source impedance of \$10\:\text{k}\Omega\$.

To get that up into the range of \$1\:{\text{V}_\text{RMS}}\$ would require a final voltage gain (after attentuations are accounted) of \$20\cdot\log_{10}\left(\frac{1\:{\text{V}_\text{RMS}}}{4\:{\text{mV}_\text{PK}}\,\cdot\, \frac1{\sqrt{2}}}\right)\approx 51\:\text{dB}\$ (about 350 times.)

But that's where I'd start the design process.

The first stage should be carefully designed to use low-noise transistors. (Sufficiently low-noise opamps are power-hogs, boutique, and otherwise not needed -- so BJT-only.) The voltage gain should be very modest -- perhaps a factor of 3 or 4 (\$+9.5\:\text{dB}\$ to \$+12\:\text{dB}\$.) But no more than about \$+15\:\text{dB}\$. A class-A stage should be fine, but use a current source as the collector load for it. Once that stage is done, then the 2nd stage can be designed to provide the remaining gain of around \$+39\:\text{dB}\$. (And that can be a decent audio amp.)

Regardless, this will require a minimum of two stages of amplification: the pre-amplifier (described above) and an amplifier stage that provides necessary remaining voltage gain and matching up with the ADC input for the MCU. (We've not yet discussed the MCU ADC.) But 3 stages would not be off the table.

Not doing the necessary analysis and then design and construction steps to get from A to B is likely why you may be having troubles.

Example of first stage design

There is a design process for a similar amplifier found here at the EESE site that includes the following schematic:

enter image description here

This is about how I would approach a first stage design using low noise BJTs (like the BC549 and BC559), except that the above design isn't just a first stage, wasn't designed for low noise, and is instead designed to directly drive a speaker.

There's a comment there, from G36, saying that the above design is similar to one by John Linsley Hood, dating back to this 1969 article (now preserved at Elliot's site).

This brings me to the point. There is an excellent pair of articles at Elliot Sound Products:

That 2nd article (see Figure 4 there) provides a design extremely similar to what I was thinking about, above. In fact, it also uses the same \$9\:\text{V}\$ battery and specifies the same \$10\:\text{k}\Omega\$ resistor!

(Once you decide on the battery, the resistor mostly just falls out from that. So we reached the same place likely for similar reasons.)

Elliot's design also selects a current source driven class-A design (which makes more sense that going for class-AB, since accuracy is important and power isn't the issue.)

We are essentially on a similar page, even down to the expected gain region. I would guess that any other good quality design will fit this pattern, too.

I've redrawn it in a way I prefer for understanding it. And I've replaced his output capacitors as this will be feeding into the next stage and I just wanted to test it. Click on the image to make it larger and more readable:

enter image description here

I've also included an electret simulation of my own in the lower left corner, for testing purposes. (And the obvious \$9\:\text{V}\$ battery source simulation, as well.)

The top graph shows the loaded microphone output, which is about \$2.5\:{\text{mV}_\text{RMS}}\$. Unloaded, this would be closer to \$2.8\:{\text{mV}_\text{RMS}}\$. But the amplifier will load it down a little.

The bottom graph shows the unloaded output of the amplifier stage. (I used a \$10\:\text{M}\Omega\$ resistor, which is essentially no load.) This is about \$10.6\:{\text{mV}_\text{RMS}}\$. So the gain is about \$+12.5\:\text{dB}\$.

I'd probably add a \$47\:\text{pF}\$ capacitor between \$Q_4\$'s collector and base to roll off the high end. But that's all I'd probably do.

I think this confirms the advice I gave you, earlier.

You imagined that there was some kind of magic stuff inside of an electret that makes it directly compatible with an MCU ADC. But this just is not the case.

\$\endgroup\$
0
\$\begingroup\$

Your two-pin microphone requires the pull-up resistor to power its internal amplifier, and that contributes a large DC signal in addition to a smaller AC sound signal. There are multiple approaches to keep the DC signal (and power supply noise) from dominating, and the capacitor coupling is one such (but that means there are low-frequency limits in addition to the DC removal... which is a kind of low frequency you WANT to limit).

The microphone probably will have a few millivolts of output in addition to its almost-3300 mV bias, and that implies that the ADC (assuming 8-bit function) will vary by a few least-significant-bits, in a range of 0-255. You probably want an amplifier stage in addition to the DC blocking function, to get the benefit of better granularity.

Either a coupling capacitor, or a transformer, or some kinds of differential amplification, can be employed usefully. As for the pull-up resistor, that microphone draws less than 0.5 mA of current, and requires 1.5V net power, so the 3.3V supply sets an upper limit of 3.6k ohms; 1 k ohms should be good.

\$\endgroup\$
5
  • \$\begingroup\$ This and the previous answer may appear to contradict each other. For clarification, an electret microphone typically has an internal amplifier consisting of a single FET, this may provide an output in the millivolts to hundreds of millivolts. \$\endgroup\$
    – Frog
    Aug 12 at 20:24
  • \$\begingroup\$ @Frog I don't see the contradiction - we both say amplification is required. And if I am not mistaken with the units and math, the mic sensitivity indicates that it will output only a 20mV signal when blasted with ear-deafening signal at 94 dB SPL. That's 24-25 LSB counts with a 12-bit 3.3V ADC. \$\endgroup\$
    – Justme
    Aug 12 at 20:41
  • \$\begingroup\$ @Justme the first answer says that the mic doesn’t have a built-in op amp, while the second speaks of an internal amplifier. Both are correct but I feel that amplifier vs operational amplifier is worthy of explanation. \$\endgroup\$
    – Frog
    Aug 12 at 20:45
  • 3
    \$\begingroup\$ @Frog We are both correct. There is an internal buffer amplifier. It is not an op-amp. It is just a JFET which is typical and common in all such electret capsules. \$\endgroup\$
    – Justme
    Aug 12 at 20:55
  • \$\begingroup\$ @Frog Basic Amplifier: tutorialspoint.com/amplifiers/amplifier_basic.htm Operational Amplifier: tutorialspoint.com/semiconductor_devices/… \$\endgroup\$
    – MrGerber
    Aug 15 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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