Friday, June 18, 2010
Simple Combination Lock
On reset, output O0 (pin 3) of IC2 goes high, charging the 330nF capacitor via D2 and the 33kΩ resistor. If switch S2 is now pressed, Q2's emitter will be pulled high and so Q2 conducts, applying a rising positive voltage to one end of the 1MΩ resistor. This resistor and the 33nF capacitor act as a switch "debounce" circuit, delaying the pulse through IC1e by about 33ms. After the delay, the output of IC1e goes low. However, counter IC2 does not increment at this stage, since it needs a positive-going edge at the clock input (pin 14). When the switch is released, Q2 turns off, IC1e’s output goes high after the debounce period and the counter advances to the next state (ie. O0 goes low and O1 goes high).
When output O0 (pin 3) goes low, the 330nF capacitor starts discharging through the 33kΩ and 10MΩ resistors. This allows about 3s for the operator to press the next button. If no button is pressed within this period, IC1b’s output goes low, which pulls Q1’s emitter low and resets the counter via IC1c. Hence the code entry must be restarted. When the second digit of the code is entered (0 in this example), Q2’s emitter is again pulled high. Q2 thus turns on and after the debounce delay, IC1e’s output goes low. When the switch is released, Q2 turns off, IC1e’s output goes high and the counter advances to state 2.
Note that while the switch is pressed, IC1d’s output is high, recharging the 330nF capacitor and therefore resetting the 3s delay. Thus, the operator is allowed another 3s to press the next digit. This process is repeated for each digit in the sequence. If the wrong switch is pressed at any point, IC2 is reset as described above. Conversely, if the correct code is entered, IC1 advances to state 4 (for our 4-digit example) on release of the fourth switch. Output O4 then goes high and turns on Q3 and relay 1. Q3 can handle up to about 300mA of load current. If more current is required, then either a Darlington or power Mosfet can be substituted. D4 is required if the load is inductive (eg, a relay, solenoid, etc).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.