Saturday, January 30, 2010

Time Delayed Door Alarm

My cat likes to open the front door if we don't latch it properly, which is often. Waking up to a cold house sucks! I designed a time delayed alarm with a couple of 555 timers, if the door is open for roughly 30 seconds it sounds off a piezoelectric speaker until the door is closed again.

Here is the circuit.
(Printer Friendly PDF)

Parts Needed:

- 555 Timer (x2)
- 100k Resistor (x2)
- 10k Resistor (x3)
- 1 Meg-ohm Resistor
- 33uF Electrolytic Capacitor
- 2.2 nF Ceramic Capacitor
- NPN Transistor
- Diode
- Piezoelectric Speaker
- 16 Pin Socket
- 9 Volt Battery Clip
- 9 Volt Battery Holder
- 9 Volt Battery
- Magnetic Contact Switch (found much cheaper at Radio Shack)
- Radio Shack General-Purpose Circuit Board (46.8 x 72.2 mm)

If you don't have any of the resistors it would be cheaper to get a grab bag rather than buy individual resistances in bulk.

Also this circuit is not picky about voltages, you could probably use anywhere from 3 to 16 volts, anything that the 555 will handle.

How it works:

When the door is closed the diode keeps the capacitor (C1) discharged to ground.

When the door opens and the magnetic switch is disconnected the pull up resistor (R2) sets the trigger, on the first 555, high and allows the 33uF capacitor (C1) to charge through the 1 meg-ohm resistor (R1). When the charge reaches 2/3 of the supply voltage the output pin on the 555 is set low. The time it takes for the capacitor (C1) to reach 2/3 of the supply voltage is found by this equation,

Time(sec) = (1.1) x (Resistance) x (Capacitance)

For example if we take the values used in my circuit,

Time = (1.1) x (1,000,000) x (.000033)

The time delay comes out to about 36 seconds. Depending on the quality of the capacitor its not going to be totally precise for such a long delay but its close enough for our purposes. For more precise timing you would want to use a decade counter clocked with a 555.

Anyway, the output on the first 555 is inverted by the transistor, so when the output goes low after 36 seconds R4 pulls the output high, its basically a logic NOT gate. The second 555 is a simple multivibrator circuit which generates a square wave used to drive the Piezoelectric Speaker. The alarm will keep sounding until the door is closed thus resetting the circuit.

If you wanted to cheat you could do away with the second 555 timer and get a Piezoelectric Buzzer which will generate a tone on its own when a DC voltage is applied to it.

Let me know if you bother building one.


mintyBot said...


The Astrogator said...

I love the down to basics(i.e. microcontroller/surface mount free) lego style(meaning quick and easy to build) builds. I think a lot of the fun and passion is lost when builds are overcomplicated and require specialized components to pull off. good work!

JustXtreme said...

This is perfect, i have a alarm on my sliding glass door for the pool entry. it's annoying to push a button every time i open the door. now i can come in and out but still have the alarm if my daughter tries to open the door.

SeionONe said...

Very cool design!
I have one question tho,
if I was to replace the second 555 timer with an Piezoelectric Buzzer, should it be added after R4 or?

BlackCow said...


Yes that's correct, the buzzer would be added after R4.

The first 555 is high when it is waiting, the transistor acts as a logic NOT gate inverting it to low. After the time delay passes the first 555's output goes low which inverts to high thus turning on your buzzer.

Pepsiman said...

I think this could be really useful as a freezer door alarm.

ragecat said...

This is really epic!
Is there anyway that you could post the calculations for the parts here?

BlackCow said...


I did provide the calculation for the timing period, that should be the only calculation you need.

GornDog said...

There's a market for this! Someone please start selling these.

HOGDOG said...

Just built this out of bits in my "junk" box. The oly thing I didn't have was the switch, Just used some sticky backed copper tape. Two bits soldered to the switch wires, and one bit stuck to the door seal. Works very well. At last, no more freezer door left partly open!
Well done for a nice simple circuit.

jam said...

Can you, please, calculate it for 3 or 5 seconds time delay?

BlackCow said...

Glad to see someone else built one! I would love to see a picture of your version.

GornDog said...

The description in an online catalog selling one of these alarms reads:

$35 too much? A design exists, online, for a similar Do-It-Yourself version

And that link points here.

Chris "BlackCow" Handwerker said...


Haha, that made my day. Thanks for sharing that.


Lagarba said...

I'd like to ask, what happens when you accidentally reversed the polarity of the time delay door alarm's 12Vdc Power supply. Which components part must be replaced of will be damaged?

Chris "BlackCow" Handwerker said...


You would probably end up frying your 555 timers. You can put a diode on the power supply for protection though (I probably should have included that in my design)

Jay said...


I think the transistor needs to be a PNP, not NPN as listed in the parts listing. A 2N3906 transistor (PNP) worked for me not a 2N3904 (NPN). Thanks for this circuit. It works like a charm.

Chris "BlackCow" Handwerker said...


It's been a while sense I've looked at this circuit. I am sure that I used an NPN transistor, I think I just have it marked backwards on the schematic. The emitter of the NPN transistor should be connected to ground instead... sorry about that!

jax said...

guten Tag.

I made it three times but each time these circuits beep continuously without any time delayed.
Could you please tell me what the problem is?

Dustin Coleman said...

I need one of these... is this on the market anywhere?

Joe Winett said...

We need this to remind kids to close the front door. Haven't built it yet, but I did print out the parts list and diagram and stick it into my blog. I think I gave proper credit. The Universe is Between Your Ears


KA5UVT (long since expired... I wasn't smart enough to renew it)