if(Vin > 0)
Vout = 0;
else
Vout = Vin * -2.2
The opamp inverts and amplifies the signal. When it’s output swings high, D2 turns on, and charges C1. When the
opamp output is high or not swinging, D2 is turned off, and C1 discharges through R9. Thus, C1 tracks the peaks
of the input signal.
IC1G4 is a buffer amplifier, so external loads on the envelope pin won’t change the C1’s charge/discharge
behavior.
This results in a signal that tracks the peak amplitude of the input signal. A louder sound will result in a higher
voltage on the Envelope pin. As with the audio pin, the envelope can be connected to the ADC of a
microcontroller.
Third Stage
The final stage implements a thresholded switch on the envelope signal.
Schmitt Trigger
The Schmitt trigger watches the envelope signal, and toggles the output when the threshold is exceeded. A
Schmitt trigger is a comparator that adjusts it’s threshold voltage when the output switches, requiring a higher
voltage to switch on than to switch off. This allows it to ignore some ripple in the input signal, like the ripple present
in the output of the envelope follower stage.
The output of the Schmitt trigger is found on the Gate pin. You can connect it to a digital input. We’ll use it to
trigger interrupts in the software example.
Outputs
Each of the three output signals is present on the .1" header at the edge of the board. They are active
simultaneously. If you aren’t using one in your particular application, simply leave that pin disconnected.
Configuration
Care and Feeding Of The Capsule
The heart of the Sound Detector is the electret microphone capsule – without it, we couldn’t convert acoustic
energy into electrical energy. These capsules have a couple of quirks that we need to understand in order to apply
them successfully.
Inside the capsule is the diaphragm, which is actually one plate of a small capacitor. That capacitor forms a
voltage divider with the external bias resistor. The diaphragm moves in response to sound, and the capacitance
changes as the plates get closer together or farther apart, causing the divider to change. Since capacitors are