How Does the Analog Alarm System Work?

This project is based on a 1 kHz square wave oscillator circuit found in the Texas Instruments LM386 audio power amplifier IC's datasheet ( integrated circuit ). This circuit generates the audio signal that is sent to the speaker. We can turn this oscillator on and off using a simple circuit consisting of an NPN transistor, a resistor, and (in my implementation) a diode.



If you look at the circuit in the All About Circuits tutorial, you won't see a diode. The original circuit didn't work for me. In my first attempt, the oscillator was active when the object-detecting switch was open and closed. In other words, the speaker made the sound when the object was removed (the intended function) and when it was in place. An alarm that constantly makes noise is not what I was going for. The sound wasn't as loud when the object was in place, but it still made noise.



I inserted a diode between the transistor base and switch, with the cathode facing the switch. This eliminated the unwanted sound and allowed my circuit to function as intended. I'm not sure exactly why this works, but it appears that the diode's voltage drop causes the BJT bipolar junction transistor to conduct small amounts of current. In this state, it effectively disables the amplifier. The amplifier seems to find an alternate current path when the BJT is cutoff. This is the reality of electronics—sometimes you fix things without knowing exactly why the fix works.