My garage is 24' x 24' and has two single doors with remote door openers. My wife's car is on one side and my 54 Pontiac is on the other. I've become a little paranoid about driving away and leaving my garage door open by accident. I've ended up with quite an investment in tools and car parts and would be very upset if I came home and found them missing from my own carelessness.
I thought that it would be nice to have the garage door automatically close after 5 minutes if it is left open by accident. A quick look at the events that happen after a garage door opens resulted in a simple electronic circuit that will close the garage door if it is left open.
How does it work?
The normal operation of the garage door is as follows if the door is left open:
The garage door opener has a built-in 5 minute timer that turns off the light. There are two inputs available to use: the door open and the light. The conditions that we want the garage door to close is when the door is open and the light is off. A truth table can be made that details all combinations of the two inputs and what we want the output to do:
Door State Light State Output Comment Closed Off Do Nothing Normal operation, door is closed and light is off Closed On Do Nothing Normal operation, door is closed and light is on Open Off Close Door Door is open, light is off, forgot to close the door! Open On Do nothing Normal operation, driving the car in or out of the garage.
With a little bit of electronic magic, I can invert the Light State (! indicates that it is inverted), reorder the truth table and come up with a Logical AND truth table:
Door State !Light State Output Comment Closed Off Do Nothing Normal operation, door is closed and light is on Closed On Do Nothing Normal operation, door is closed and light is off Open Off Do nothing Normal operation, driving the car in or out of the garage. Open On Close Door Door is open, light is off, forgot to close the door!
Now that the basic logic is figured out, it's time to look at the actual operation. Now sometimes, I wander down the back alley to talk to the neighbors. I sure would hate to be locked out of the garage, if it automatically closed without any warning. So a 30 seconds audible and visual warning alarm is needed. The 2 input AND gates come 4 to a package, so I have 3 spares to play with. I can use 3 simple RC time delays of 10 seconds each to give the required delay so that I can run back and disable the auto door closer.
The auto door closer can be disabled by simply turning on the garage door opener's light. On my garage door opener, there is a pull string to turn on and off the lights. Turning on the light, changes the truth table so that the output "does nothing".
Electronic Explanations - not for the weak of heart!
Here's an explanation of the electronic portion of the circuit with schematic in Adobe Reader pdf format. The explanations are referenced to the schematic.
The light is detected using a special 120 VAC photocoupler detector MID400. It comes in an 8 pin DIP package and I made a small circuit board about the size of a 25 cent piece that would fit in an old (1960s) style 2 conductor AC plug that had room to place the circuit board in it. The only components on this board are U1 (MID400) and R1 which is a current limiting resistor. Three 24 gauge wires are connected to it: +5V, signal and ground. It is safer to run low voltage signals around the garage then to run 120 VAC lines - besides it stays within UL and CSA specs.
Modified AC 2 conductor plug and AC outlet that screws into receptacle
When the light is off, the signal is pulled high (+5V) by R2. When the light is on, the signal is pulled low (0V) by U1-6 (pin 6 of U1). C1 is used to suppress electrical noise. I used RTV Ultrablack silicon to "pot" the light detector circuit in the AC plug.
Door Position Detector
Burglar alarm style magnetic switch
The position of the door is determined by a SPST magnetic contact switch for closed circuit alarms. It consists of 2 parts: a magnet which you attach to the door and the NO (normally open) switch. When the magnet is next to the switch, the switch SW1 is closed (on) and U2-2 input is a low (0V). When the door is open, the magnet is moved away from the switch and the switch opens. U2-2 input is pulled high (+5V) by R3. C2 is used to suppress electrical noise that may give false inputs.
Guts of the Logic
U2A (first gate of U2) performs the logical AND of the two inputs and decides under which conditions to automatically close the door. The output U2-3 goes to two places: the warning circuit and the time delay. U2 must be a 74HC08 IC, other logic families may or may not work due to the high impedance delay circuitry. Regular TTL logic 7408 will NOT work.
The warning circuitry consists of the NPN transistor Q1 and the audible alarm SPKR1 and the LED string. When U2-3 goes High (+5V), Q1 turns on which turns on the audible alarm and the LED string.
The audible alarm is a piezo audible alarm that operates from 3-28 volts and the one that I chose pulsates. The LED string consists of a Flashing LED that operates from +5V and 4 super bright red LEDs in series. The flashing LED has a built-in flashing circuit and does not require a current limiting circuit. The forward voltage of the super bright LEDs are 1.8V each. So when you add them up, you get 4 x 1.8V + 5V = 12V. Unfortunately, the +10 VDC AC adapter that I'm using is putting out closer to +14V so a 2.3V Zener diode D11 is used in series to "use up" the extra voltage.
30 Second Delay Circuit
The delay circuit consists of 3 identical 10 second delay circuits in series. Add them up and you get the required 30 second delay. Looking at the first delay circuitry consisting of R5, C3 and D6, it can be seen that R5 and C6 make up an RC charging circuit. When U2-3's output goes to +5V, current will flow through R5 and C6 will charge up. The time to reach 90% of full charge (+5V) is determined by
T = R5 x C3 = 1 Mohm x 10 uF = 10 seconds
This means that even though U2-3 is at +5V, it will take roughly 10 seconds for the inputs to U2B to reach a High (+5V). D6 is required to discharge C3 immediately when U2-3 goes Low (0V). Otherwise, it would take another 30 seconds for U2B's inputs to go Low.
Closing the Door
U2-11 is the output of the 30 second delay circuit and it drives transistor Q2 which controls relay K1. Relay K1's SPST NO (normally open) contacts are wired in parallel with the garage door switch.
When U2-11 is Low (0V), Q2 is off and relay K1 is de-energized. The relay contact is open. When U2-11 goes High (+5V), Q2 is turned on, relay K1 is energized and its NO contact is closed. This simulates pressing the garage door switch. The garage door closes.
The power is supplied by a +10Vdc AC wall adapter that I bought at a flea market for $2.00. It's actual output is much higher (+14V) because this circuit requires very little current (less than 50 mA) and doesn't load the adapter down. The reason for using an AC adapter is for UL and CSA approval.
+5V is required by U1 (MID400) and U2 (74HC08). U3 is a 7805 3 terminal +5V voltage regulator. Put anything over +7V in and you get +5V out. I used a TO220 package cause I had one and I don't have to worry about heatsinking it. It doesn't get any warmer than room temperature.
C6 is used to filter out line noise (60 cycle hum) on the input. C7 and C8 are used to prevent U3 from oscillating and high frequency noise suppression. C9 is used to filter out line noise on the output. D10 is used to protect U3 during power off. Any charge (voltage) stored on C9 will drain into the input side of U3 rather than draining back into the output side of U3. U3 could be damaged if current were to flow back into the output (it's not made to do this). D10 is not really required with these circuit values but I always add them just to be on the safe side.
Circuit Board Artwork
I've provided 1 to 1 solderside artwork pdf file that is reversed image and ready to make a board with. I'm not sure how accurate the conversion to PDF is and whether it remains to scale. I've also provided component ID layer 1 to 1 artwork for locating the components and connections.
AC adapter plugged into roof outlet with holding strap, ugly box to hold the electronics.
I've used "junk box" parts (parts that I had lying around) so I didn't pay much attention to exact part numbers. The relay is a standard form SPST +5V PCB mount relay. The audible alarm is something I used with a trip wire to catch the newspaper boy taking a short cut through my garden at 5:00am (he was trampling my flowers!).
NOTE: The component ID layer has an error on it with the polarity of the LEDs. Each LED is backwards. Just place the LEDs in reverse.
Note: I originally built this circuit in 2002, it is now 2012 and it still works great! No problems for 10 years!
If this page has helped you, please consider donating $1.00 to support the cost of hosting this site, thanks.