DOOR ALARM
This circuit produces two different effects on the LED. It is best to put a piezo diaphragm on pin 11 to hear the tone (frequency) produced by the circuit.
The circuit is a good example to test your ability to work out what is happening.
When the magnet is near the Hall effect device, the output is LOW and pin 3 must be HIGH (refer to the truth table). This puts a high on pin 2 and the gate remains in this state.
Pin 4 is LOW and pin 10 is HIGH.
Pin 11 can be high or low and if we assume the 100n is not charged, pin 13 will be low and the output will be HIGH. This will charge the 100n and change pin 13 to HIGH to make the output LOW and thus we have an oscillator. The piezo diaphragm will produce a tone but the LED will simply be illuminated.
When the magnet is removed, pin 1 goes HIGH and the output can be high or low. We will assume pin 3 goes LOW as it was previously HIGH and the 10u was fully charged.
Pin 4 goes HIGH and the 10u is "jacked up" by 9v due to pin 4 rising and the about 8v contained in (or on) the 10u puts 17v on the join of the 1M and 100k resistors.
The other end of the 100k is at 0v and this resistor discharges the 10u fully and then starts to charge it in the opposite direction as the negative of the electro will be at 9v and the positive lead has to drop to less than 3v. Pin 2 monitors the voltage via the 1M resistor.
When pin 2 sees less than 3v, the gate changes state with pin 2 going HIGH and the second gate changes state with pin 4 going LOW.
The electro has MINUS 6v across it but the way to see it is this: The electro is "moved down" by 9v and now the join of the 1M and 100k resistors sees a voltage of minus 15v.
The other end of the 100k resistor has 9v on it and this removes the charge from the electro so that it has 0v across it and then it charges in the correct direction until the voltage reaches about 6v.
At this point the gate changes state with pin 3 going LOW and pin 4 going HIGH to create a low frequency oscillator.
Previously pins 4, 8 and 9 were LOW.
When these pins are HIGH, pin 10 is LOW. When this pin is LOW it permanently puts a HIGH on the output of the gate and the LED is turned OFF.
This makes the LED blink when the magnet is removed.