This is only a preview of the January 1999 issue of Silicon Chip. You can view 34 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "High Voltage Megohm Tester":
Articles in this series:
Items relevant to "Getting Going With BASIC Stamp":
Items relevant to "A LED Bargraph Ammeter For Your Car":
Items relevant to "Keypad Engine Immobiliser":
Articles in this series:
Articles in this series:
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
More protection for your car with the . . .
Keypad
Engine Immobiliser
This project takes the Engine Immobiliser
described last month and adds a keypad.
When you stop your car and turn the engine
off, you hit any key to enable the Immobiliser.
To start the car again, you must enter the
correct 4-digit code, otherwise the car will
stall every time it is started.
By JOHN CLARKE
For good protection against car
thieves the Engine Immobi
liser described last month works well but you
do need a concealed switch to operate
it and this can be a drawback. Using
a keypad to enable the Immobiliser is
much more elegant. The design uses
a standard 12-button keypad, labelled
62 Silicon Chip
from 0 to 9 plus asterisk (*) and crosshatch (#) keys.
Four buttons must be pressed in
the correct sequence before you turn
on the ignition. The car can then be
started in the normal way.
You can program in any 4-digit code,
including the “*” and “#” buttons, by
means of links on the PC board. This
means that you can set the combination to say, #123, 1223 or whatever.
You cannot trick the keypad circuit
into disarming the Immobiliser by
pressing all keys at once, by disconnecting the battery and reconnecting
again or any other jiggery-pokery. The
code must be entered in the correct
sequence. If you enter the wrong
code, you can start again by pressing
any key which is not used in the code
sequence, followed by the correct code
sequence.
The Immobiliser is armed by pressing any key which is not used in the
combination code.
A LED flashes to indicate when the
Immobiliser is active and it goes out
when the correct code is entered.
The keypad can only be used when
the ignition is turned off. It does not
Fig.1: this circuit has two parts. IC2 and diodes D3, D4 & D5 detect when a key is pressed while IC3, IC4 & IC5
detect when the code is entered in the correct sequence to deactivate the Engine Immobiliser via the output at
pin 10 of IC4.
respond to any buttons when the
ignition is switched on. This means
that you can only arm the Immobiliser
once you have switched off the engine.
Similarly, to disable the Immobiliser,
you must enter the correct code before
switching on the ignition.
The reason for this approach is so
that the Immobiliser cannot be activated by the keypad when the car is in
motion; if this happened the car could
possibly be stopped in a dangerous
situation if any of the keypad buttons
was inadvertently touched.
As with the basic Engine Immobiliser described last month, the keypad
version becomes active when power to
the ignition is switched on, provided it
has already been armed. If the ignition
is off, the Immobiliser circuit is off
and the only current drain from the
battery is that drawn by the keypad
Main Features
•
•
•
•
•
•
•
•
Keypad operation to restore normal ignition.
4-digit code entry.
Any of 12 keys can be used for the code.
Any order, sequence or duplication of code is allowed.
LED flashes when ignition is disabled.
LED is off when correct code entered to enable normal ignition.
Keypad disabled when power to ignition is switched on.
Normal ignition cannot be restored by disconnecting and reconnecting
battery supply.
•
System is armed by pressing a key when the ignition is off (which is not
part of the code).
•
Can be used in unarmed mode by not pressing a key.
January 1999 63
Fig.2: this is the
modified circuit of
the Engine
Immobiliser
published last
month. Q4 responds
to the high signal
from the keypad
circuit and disables
IC1.
circuit itself. This draws about 6mA
which should not be a problem for the
car battery.
Circuit details
The keypad circuit is shown in
Fig.1. The keypad itself has 12-keys
which are connected in a matrix of
three columns and four rows. As
shown on the circuit, the columns are
labelled C1, C2 & C3 while the rows
are marked R1, R2, R3 & R4. If, for example we press the “1” key, then there
will be a connection between row R1
and column C1. Similarly, if the “9”
key is pressed, row R3 is connected to
column C3, and so on.
The keypad circuit has two functions. First, it must detect when
buttons are pressed and second, it
must detect if they are pressed in the
correct order.
The first part, detecting when buttons are pressed, is relatively easy
and is accomplished with the 4017
decade counter, IC2. This chip is
clocked at about 100Hz by a Schmitt
trigger oscillator, IC6a, and four of
its outputs are connected to the four
rows of the keypad matrix.
As IC2 is clocked, its outputs cycle
high and low and nothing happens
until a key is pressed. The column
associated with the key is then connected to that key’s row and when that
row goes high, perhaps a millisecond
later, the key column goes high as
well. Each of the three columns is
monitored by a diode and so the
“high” signal is fed via diode D3, D4
or D5 to the “clock enable” line (pin
13) of IC2. This stops IC2 and so the
key just pressed will have its column
and row both high.
IC2 will not start counting again
until the pressed key is released.
Key detection
Four 2-input AND gates, in IC3, are
used for key detection. Why only four,
considering that there are 12 buttons
on the keypad? The reason is that
only four digits are used in the code.
Each 2-input AND gate has one input
connected to a row and one connected
to a column, depending on the “hard
wire” programming.
If we consider IC3a, for example, its
inputs are shown connected to row
R1 and column C2 and so if key “2”
is pressed, both inputs of IC3a will
be pulled high and its output at pin
3 will also go high.
So far then, we have described how
each correct key-press is detected and
the four outputs of IC3 will go high if
the correct keys are pressed. But the
circuit must also detect if the those
keys have been pressed in the correct
sequence. This is where IC4 and IC5
come into the picture.
Sequence detection
Fig.3: this is the modified component layout for the Engine Immobiliser, with Q4
and three resistors added in.
64 Silicon Chip
IC4 is another 4017 decade counter but it is not clocked in the same
way as IC2. It is clocked each time a
correct button in the code sequence is
pressed. Let’s see how this happens.
Say, for example, button 2 is pressed.
This will cause the output of AND
gate IC3a to go high and pull pin 13
of NAND gate IC5a high as well. At
the same time, pin 12 of IC5a will be
high because the “0” output of IC4
(pin 3) is high. This will cause pin
11 of IC5a to go low and pull pin 14
(the clock input) low via diode D6.
But nothing happens until you take
your finger off button 2. This kills the
column signal to IC3a, takes pin 3 of
IC3a low and so pin 11 of IC5a goes
high. It is this “low to high” transition
that causes IC4 to be clocked and its
“1” output, pin 2, goes high.
The next button in our sample
4-bit code is 4. Provided this button
is pressed, pin 4 of IC3b goes high,
as does pin 9 of IC5b. Its pin 8 will
already be high, since it is connected
to pin 2 of IC4 and so pin 10 will go
low, again pulling pin 14 of IC4 low
via diode D7. Again, when button 4
is released, pin 10 goes high and IC4
is clocked by one count, so that its
“2” output, pin 4, goes high.
By now, you should see how the
sequence is going. The next button
in the 4-bit code is 5 and pressing it
causes pin 3 of IC5c to go low and
pull pin 14 of IC4 low via diode D8.
The end of the correct sequence is
when you press button 9 and then
take your finger off the button. This
again causes IC4 to be clocked and its
“4” output, pin 10, goes high. This has
two results. First, its high output is
fed to the Engine Immobiliser board,
to disable its operation. Second, it
disables Schmitt trigger oscillator
IC6d and LED1 stops flashing.
This view shows the Engine Immobiliser PC board with the extra parts added in
the bottom lefthand corner. You have to add one transistor and three resistors,
with the 10kΩ resistor to the left of the IC replacing a wire link.
Invalid keys
So far we have seen what happens
when you press the correct buttons
in sequence. But what happens when
someone else has a go and gets it
wrong?
Previously we noted that each
time a key was pressed, a column is
connected to a row and when the row
output from IC2 went high, one of
the three diodes D3, D4 or D5 would
feed the high signal to the CE pin and
stop the counter while ever the key
was pressed.
That same high signal is also fed via
an RC delay circuit (10kΩ and .01µF)
to the reset pin of IC4 but if a correct
key has been pressed, this reset signal
is suppressed by diode D10 and one
of the four diodes D6-D9.
The RC delay in the reset signal line
ensures that when a “correct” key is
pressed, IC4 is not reset. So if keys
are pressed in the correct sequence,
IC4 is clocked forward with each key
press. On the other hand, if a couple
of correct keys are pressed and then
Fig.4: the component layout for the keypad. The 4-digit code is programmed by
installing links on the board to the left of IC2.
a wrong key, IC4 will be reset and
its “0” output goes high. The correct
sequence must now be entered in full
for the Immobiliser to be deactivated.
Ignition monitoring
Transistor Q5 and gate IC6b monitor the +12V line from the ignition
keyswitch. With the ignition switch
off, Q5 is off and pins 1& 2 of IC6b are
high and so pin 15 of IC2 is held low.
Hence, IC2 is continually clocked by
IC6a and the circuit is waiting for
buttons to be pressed.
When the ignition is turned on, Q5
turns on and pulls pins 1 & 2 of IC6b
low. Thus, pin 15 of IC2 is pulled
high, which is the reset condition.
IC2 is prevented from clocking and
so the circuit cannot respond to any
buttons being pressed.
By the way, we have used the “2”,
“6”, “7” and “3” outputs of IC2 to
drive the keypad switch rows and so
the rows are not scanned in sequence.
The reason for doing this was to
make the layout of the PC board more
convenient.
Power for the circuit is derived
from the car battery and this is decoupled via a 39Ω resistor and a 100µF
electrolytic capacitor. This effectively
filters any hash on the supply line.
The 16V zener diode ZD6 clamps any
voltage above 16V to protect the ICs
from damage.
Immobiliser circuit
The Engine Immobiliser circuit
published last month is modified by
the addition of one transistor to make
it work with the keypad circuit. The
January 1999 65
header for the ribbon cable to
the keypad.
Next, insert the links which
can be made using the tinned
copper wire or component
pigtails. Before you can insert
the links associated with the
keypad, you need to decide
on the 4-digit code.
Have a look at the component overlay diagram in Fig.4.
You will notice that there is
an area on the board to the left
of IC2 which has seven tracks
labelled R1-R4 and C1-C3.
These correspond to the four
rows and three columns of
the keypad.
Each of the four keys to
be programmed has two
link connec
tions, with the
lefthand side link connected
to one of the four rows and the
right-hand connected to one
of the three columns.
In our example code shown
on the circuit, key 2 is
pro
grammed as row 2 and
column 1; key 4 key is
programmed as row 1 and
column 1; key 5 is row 2
and column 2; and key 9 is
The keypad board in the prototype was mounted above the Engine Immobiliser board
row 3 and column 3. Table 1
in a standard plastic case, with the keypad attached to the lid. Alternatively, you can
shows the coding needed for
mount the keypad separately on the dashboard.
all keys.
Having installed all the
modified circuit is shown in Fig.2.
the Immobiliser PC board is shown links to program the 4-digit code, you
The circuit operation is as de- in Fig.3 while the component layout can now install the resistors, followed
scribed last month, since the addi- for the keypad PC board is shown in
by the diodes. Then install the 16V
Fig.4. This board is the same size as zener diode and the transistor.
tional transistor is off at all times
unless a valid 4-digit code has been the Engine Immobiliser board and is
The ICs must be inserted with the
fed into the keypad. When that hap- coded 05401991.
correct polarity as shown and make
pens, the base of Q4 is pulled high
sure that you insert the correct type in
Construction
and it turns on to pull pin 4 of IC1
each position. Finally, the capacitors
low. This causes IC1 to stop oscillatYou can begin construction by
can be installed, taking care that the
ing and its output at pin 3 goes low.
checking the PC board for shorts
electrolytics are oriented with the
This causes all transistors, Q3 to Q1,
between tracks, breaks in the tracks,
correct polarity. The 0.1µF capacitors
to turn off and the Immobiliser circuit or undrilled holes. Fix any defects (if
may be marked as “100n” or “104”
then has no further effect on the car’s
any) and then fit PC stakes into the while the .01µF capacitor may be
ignition system.
holes for the external wiring points marked as “10n” or “103”.
The modified wiring diagram for on both boards. We used a 7-way pin
The assembly procedure for the En-
Resistor Colour Codes
No.
1
1
9
1
1
66 Silicon Chip
Value
220kΩ
100kΩ
10kΩ
2.2kΩ
39Ω
4-Band Code (1%)
red red yellow brown
brown black yellow brown
brown black orange brown
red red red brown
orange white black brown
5-Band Code (1%)
red red black orange brown
brown black black orange brown
brown black black red brown
red red black brown brown
orange white black gold brown
Parts List
1 plastic case, 130 x 67 x 43mm
4 M3 screws x 6mm
2 15mm long tapped spacers
1 1m length of heavy duty black
automotive hookup wire
1 1m length of heavy duty red
automotive hookup wire
1 1m length of light duty red
automotive hookup wire
1 1m length of heavy duty yellow
automotive hookup wire
1 150mm length of hookup wire
Fig.5: actual size artwork for the PC board.
Table 1:
Programming Links
Key
1
2
3
4
5
6
7
8
9
*
0
#
Row
1
1
1
2
2
2
3
3
3
4
4
4
Column
1
2
3
1
2
3
1
2
3
1
2
3
gine Immobiliser board was featured
last month and we expect that most
users will assemble and get it going
on its own before making it work with
the keypad board.
Installation
The two boards can be housed
in several ways. We stacked the PC
boards in a plastic case measuring
130 x 67 x 43mm and mounted the
keypad onto the lid. However, you
could mount both boards underneath
the dash and mount the keypad on
the dash itself. We’ll leave that up
to you.
If you want to take our approach,
the PC boards are stacked on top of
each other using 2 x 15mm spacers.
Note that the integral side ribs in the
case will need to be removed using
a chisel and a hole drilled in the end
of the box for the wiring.
The keypad was secured to the lid
with four small (M2.5) screws or selftappers. Note also that if the keypad
is mounted on the lid as shown in
the photo you will need to cut slots
for its mounting feet in the sides of
the case, so that the lid can later be
placed in position.
Wiring & testing
The boards can be wired up using
automotive hookup wire. We used
light duty wires for all wiring except
for the wires to the ignition coil and
ground.
Connect the circuit boards to a 12V
battery or DC supply. Check that the
LED flashes at a one second rate and
that the LED stops when the 4-digit
code is entered into the keypad.
Press any other key (ie, not one included in the code) and check that the
LED flashes again. The keypad should
now be inoperative. Connect up the
ignition wire to the supply positive.
You can verify that the high voltage
transistor Q1 comes on by measuring
the resistance between its emitter and
collector. The transistor will be on
when the resistance is low.
If the circuit operates properly you
are now ready to install it into your
vehicle. Find a suitable position under the dashboard to mount the unit
and then locate the fused side of the
ignition circuit and the fused side of
the battery supply.
The wiring to these points should
be made using automotive connectors. Also you will need a chassis
point to connect the ground supply
of the circuit to the battery negative
Keypad
1 PC board, code 05401991,
106 x 60mm
1 12-switch keypad with 4-row
and 3-column addressing
1 5mm LED bezel
6 PC stakes
1 7-way pin header
1 60mm length of 7-way rainbow
cable
1 400mm length of 0.8mm
diameter tinned copper wire
Semiconductors
2 4017 decade counters
(IC2,IC4)
1 4081 quad 2-input AND gate
(IC3)
1 4011 quad 2-input NAND gate
(IC5)
1 4093 quad 2-input Schmitt
NAND gate (IC6)
1 BC337 NPN transistor (Q5)
1 16V 1W zener diode (ZD6)
8 1N4148, 1N914 signal diodes
(D3-D10)
1 5mm red LED (LED1)
Capacitors
2 100µF 16VW PC electrolytic
1 10µF 16VW PC electrolytic
1 0.1µF MKT polyester
1 .01µF MKT polyester
Resistors (0.25W, 1%)
1 220kΩ
1 2.2kΩ
1 100kΩ
1 39Ω
9 10kΩ
terminal. This can be an existing
screw in the metalwork or a separate
self-tapping screw which secures
the eyelet terminal for the ground
lead in place. The connection to the
ignition coil should be made with an
eyelet terminal. This wire should be
concealed as much as possible. SC
January 1999 67
|