Ever accidentally left your front door ajar and had a pet escape? Here is a smart solution to this problem. The circuit is fairly simple but a great example of using a tiny circuit to get the job done. All you need is a CD4011 IC plus a handful of components.
In this door ajar alarm/beeper circuit, a bar magnet-reed switch combination is used as the door sensor. When the door is closed, as per mechanical arrangement, the bar magnet near the reed switch close its switch contacts. Now the beeper circuit built around CD4011 (IC1) is disabled by the logic low state at its input terminals (pins 1&12).
When door is opened the beeper is enabled by the logic high state and the speaker starts beeping intermittently at a rate of about 0.5 secs on/0.5 secs off. Frequeny of this gated aural output is near 450 Hz. After assembling, enclose the circuit including the reed switch, in a plastic enclosure and mount it on the door frame.
Next fit the bar magnet in the door exactly in alignment with the reed switch so that when door is closed the bar magnet is at the close vicinity of the reed switch. For powering the circuit, use an alkaline type 9V compact battery.