Microphone circuit
bomber
Posts: 297
I am curious if anyon has a circuit (and code) that can hook this microphone to a BS2?
Comments
Ignore the part of the schematic up top for the SX portion (power supply, programming interface, sx). The part you want is the bottom half that shows the pre-conditioning of the mic signal, the op amp, and the ADC. You can read the ADC values which will correspond more-or-less to audio volume.
-Phil
-Phil
-Phil
The first stage is a x100 amplifier to boost the feeble microphone output to something useable. (The LM358 uses a single +5V supply here.) The second stage is a peak detector to sample and hold the high excursions of the audio waveform long enough that they can be measured.
Here's a scope trace showing the input to the peak detector (blue) and the output (yellow):
Some things to tinker with:
1. If you need to measure higher ambient levels than what this circuit accommodates, lower the value of the 1M feedback resistor.
2. There's no bleeder resistor on the 0.1uF output cap. Leakage seems to provide enough of a bleed route that one was not necessary. By the same token, however, if your ADC has a low input impedance, the cap will bleed too quickly. You can substitute a larger cap or use an additional op-amp unity-gain buffer stage after the cap. In this case, you'd want to use a quad op-amp, like the LM324.
-Phil