Sie sind auf Seite 1von 3

SMALL CIRCUITSCOLLECTION

Electronic Code Lock 005


and will reset the circuit.
Pressing the Start button switches on transistor
T1, which connects the supply voltage source
to the code lock. This is indicated by the yel-
low LED (D20). Since the logic ICs are now
enabled, the output of IC3f will be High, so T2
also conducts and pulls the base of T1 to
ground. This means that the Start button can be
released without affecting the circuit. However,
C11 can now slowly charge via the high resis-
tance of R12 until the voltage at the inverter
input is high enough to cause its output to go
Low, which interrupts the supply voltage to the
circuit and puts it back into the idle state. The
valid code must therefore be entered during
R. Heimann the time interval determined by this R–C time
constant. Once the supply voltage is disconnected, C11
Nowadays, electronic code locks are usually based on discharges rapidly via D18. This is important, since other-
microcontrollers. However, if you like your electronics dis- wise C11 could retain its charge for a long time. This would
crete, you will enjoy the battery-operated circuit shown make the time allowed for entering the code significantly
here. Since the circuit automatically switches off after the shorter the next time the lock is used.
door has been opened and draws no current in the idle Pressing the Start button also has other consequences. Via
state, three alkaline batteries (mignon, AA or R6 cells) are the Start switch, ground potential arrives at IC2d, where it
good for around 5,000 door openings. The main advantage causes a pulse to be generated that places counter IC1 in a
is that the door opener can also be powered from the bat- defined state (Q0 = 1) prior to the entry of the first code
tery, so it’s not necessary to run any extra cables. numeral.
Figure 1 shows the schematic diagram of the circuit, which The first code numeral can now be entered. If the correct
is split into two parts. The first part is the control panel, button is pressed, the High potential from Q0 passes
which consists of a 12-position keypad and two LEDs. The through the closed switch to reach IC2d–IC2a. This net-
second part is the programming and evaluation logic, work generates a positive pulse at the instant that the but-
which contains only standard logic ICs. The control panel ton is released. This pulse clocks the counter, so that the
is connected to the logic board by a 16-way flat cable. The High level from Q0 moves by one position to Q1. This
keypad circuit is laid out with separate connections to the process repeats itself until all code numerals have been
individual switches, instead of a matrix. The code is pro- entered.
grammed using the two pin connector strips K1 and K2. After the ninth numeral has been entered, the positive volt-
The circuit allows any desired combination of numbers to be age jumps to Q9, where it charges C4 (if jumper JP1 is
used for the code, up to a maximum of 9 positions. Press- installed). While C4 is charging, the output of IC2e goes
ing a particular button, which in principle is random but Low for approximately two seconds, and the output of IC3d
which naturally must be specified in advance, awakens the goes high for the same interval. Power transistor T5 is
circuit from the zero-current idle state. This Start button switched on via R19 and T4 to supply current to the door
cannot be used in the subsequent code sequence. The opener. At the same time, IC3a switches on the green LED
Start button is programmed by connecting a wire bridge (D19) to indicate that the door can be opened. T3 limits the
from the associated pin of K2 to pin 1 of K1. current through the door opener to around 700 mA.
The code sequence is programmed in a similar manner. Once C4 is sufficiently charged, the output of IC2e changes
The first numeral of the code is programmed by connect- to High. Not only does this switch off the door opener, but
ing the associated pin of K2 to pin 2 of K1, the connection the positive edge also generates a pulse in the network
for the second numeral is made to pin 3 of K1, the third to IC2f/IC3c that passes through D14 to reach IC1 as a reset
pin 4 and so on. Numerals that are not used in the code do pulse (D14, D17 D13 and R7 together form a ‘wired-or’
not actually have to be connected. However, if the unused gate). Inverter IC3b also provides the power-up reset to the
buttons are connected to VDD, the code lock will assume counter. The reset signal places the circuit back into its ini-
that an error has occurred if any of these buttons is pressed tial state.

28 Elektor Electronics 12/2001


SMALL CIRCUITSCOLLECTION

What happens if an incorrect button is pushed? In such a to be too short, the value of R8 or C4 can be increased.
case a Low level is passed through in place of the High However, this also increases the amount of power drawn
level from the counter output. This has the same conse- from the battery, especially considering that the door
quence as the Low level from the Start button: the counter opener is by far the biggest power glutton in the circuit. In
is reset. order to integrate the circuit into an existing door opener
Note that you can also modify the circuit to use fewer than or to use it to operate an ac door opener, you should connect
nine numerals for the code. All that is necessary is to con- a relay to K5.
nect C4 via a jumper to another counter output in place of Before assembling the circuit using the printed circuit
Q9 (for example, to Q4 for a four-position code). The diode board shown in Figure 2, you should separate the two sec-
at the selected output of the counter can be replaced by a tions by sawing between K3 and K4. The logic board
wire jumper, and the ‘higher level’ diodes can also be omit- should not be fitted directly behind the pushbuttons for
ted. entering the code. Instead, it is better to separate the entry
The active ‘on’ time of the door opener is 2 s. If this seems pushbuttons, the LEDs and the door opener from the logic

1 R17
D15
100k

T5
R18 1N4148
120Ω

R10
K5 BD140
relay
100k

T4
R20
D16 D18
T1
1k5 R11 1N4148
1N4001 560Ω +5V K6
BC337 T3 BC337 IC3.F
700mA T2
BC327 R12 R16
13 12
2M2 1 100k 5V
R21 R22 R23 R24 R19
C9 16 14 14
10k
3Ω3

3Ω3

3Ω3

3Ω3

C6 C8 C7 C11
BC337
IC1 IC2 IC3
330n 8 7 7 47µ
100n 100n 100n 16V

R13 R15 IC2.F IC3.C


C5 D14
1k5

1k5

13 12 5 6
1 1
100n R9 1N4148
D20 D19 +5V
100k

yellow green R14


2M2

IC3.A IC3.D IC2.E IC3.B


D17
S1
2 1 8 9 10 11 3 4
1 1 1 1
R8
+5V C4 C10 1N4148
2M2

S2
1µ 100n
K4 K3
S3
R25
R26
R27
R28
R29

JP1
22k
22k
22k
22k
22k

S4 K2 K1
code
D1 3
S5
setting 0 CTRDIV10/
D2 2 DEC
1
D3 4 IC1
2
S6 D4 7 14
3
D5 10 + & 13
4
D6 1
S7
5 4017
D7 5
6
D8 6
7
S8 D9 9 15
8 CT=0
11
9x 9
1N4148 12
R31
R32
R33
R34
R35
R30

CT≥5
S9
+5V
22k
22k
22k
22k
22k
22k

S10 R6
220k

S11
IC2.D
D12 D13
IC2, IC3 = 4069, 40106 9 8
1
R7
1V2 C3 +5V 1N4148
S12
100k

10n

R4 R5
IC3.E
1M

1M

11 10 IC2.C IC2.B IC2.A


1 D10 D11 C2
5 6 3 4 1 2
1 1 1
R3
1V2 1N4148 C1 10n
220k

100n
014009 - 11

12/2001 Elektor Electronics 29


SMALL CIRCUITSCOLLECTION

2
H1

H2
S10

S7

S4

S1

D20

R13
1-900410

014009-1
S11

S8

S5

S2

D19

R15
S12

S9

S6

S3

H6
H5

K4
K3
H7

H8
K2
12
11
10

4
3
2
9
8
7
6
5

1
K1

R31
R25
R32
R26
D9
D8
D7
D6
D5
D4
D3
D2

D1

R33 R27
1-900410
ROTKELE )C(

014009-1
(C) ELEKTOR
R34 R28
R35 R29
R30
IC1
C6
C1

C2
D11
D10
R3

R5

D14
D17
R4

C10
JP1

R14
C4

T1

IC2 IC3
C8

C7
R7
D13

C3

C11

D18

R10
R19

R16
R12

R11
D12

R6
R8
R9

D15
C5
K5

R20 C9
T2
D16
R24
R23
R22
R21

R18
T3

T4

R17
K6
0
T5

H4

H3

COMPONENTS LIST
R18 = 120Ω Semiconductors: IC2,IC3 = 4069 or 40106
Resistors: R19 = 10k D1-D9,D11,D13,D14,D15,D17,
R1,R2 = not fitted R21-R24 = 3Ω3 D18 = 1N4148 Miscellaneous:
R3 = 220kΩ R25-R35 = 22kΩ D10,D12 = zener diode 1V2 JP1 = jumper
R4,R5 = 1MΩ 0.4W* K1,K2 = 12-way pinheader or
R6 = 220kΩ Capacitors: D16 = 1N4001 wire links
R7,R9,R10,R17 = 100kΩ C1,C6,C7,C8,C10 = 100nF D19 = LED, green K3,K4 = not required (ribbon
R8,R12,R14 = 2MΩ2 C2,C3,C5 = 10nF D20 = LED, yellow cable )
R11 = 560Ω C4 = 1µF T1 = BC327 K5, K6 = 2-way PCB terminal
R13,R15,R20 = 1kΩ5 C9 = 330nF T2,T3,T4 = BC337 block, lead pitch 5mm
R16 = 100kΩ C11 = 47µF 16V radial T5 = BD140 S1-S12 = pushbutton with
IC1 = 4017 make contact

circuit board with a length of cable. Otherwise, a screw- 1N4148 diodes can be used for D10 and D12. The best solu-
driver or a bit of wire connected between the emitter and tion is to use the relatively noise-immune 40106. However,
collector of T5 is all that is needed to outfox the code lock it is then necessary to use Zener diodes for D10 and D12,
and open the door. due to the higher threshold voltage. A 3.3-V type is ideal
Fitting the components to the circuit board should not be with an operating voltage of 15 V. There is one thing you
difficult. The ICs can be mounted in sockets. The author should not overlook: with low-voltage zener diodes, the
used 4049 inverter ICs, but in the Elektor Electronics lab band on the package marks the anode instead of the cath-
prototype we used 4069’s, which are functionally compati- ode, as you would normally expect. At least, this is true in
ble but not pin-compatible, and we also tried a 40106, most cases, but not always…
which has Schmitt-trigger inputs. With a 4069, normal (014009-1)

30 Elektor Electronics 12/2001

Das könnte Ihnen auch gefallen