This is only a preview of the April 2000 issue of Silicon Chip. You can view 33 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 "A Digital Tachometer For Your Car":
Items relevant to "RoomGuard: A Low-Cost Intruder Alarm":
Articles in this series:
|
readout
* Digital
plus bargraph
be used as
* Can
a gearchange
indicator
drive a rev
* Can
limiter
auto* Display
dims at night
Keep tabs on engine revs with this:
Digital Tacho
This versatile Digital Tachometer has a
4-digit LED display plus an analog style
bargraph to indicate engine rpm. The
displays automatically dim at night and
there’s even a limiter output, so that you
can limit engine revs.
By JOHN CLARKE
Tachometers are a “must have”
item for driving enthusiasts. If you
prefer a manual car, a tacho lets you
know when to change gear and can
help you keep engine rpm within
the best operating range. An accurate
tachometer is also a vital tuning aid
if you have an old car and you prefer
to do the engine tune-ups yourself.
14 Silicon Chip
Traditionally, analog tachometers
have been circular in shape with a
needle (or pointer) which sweeps in
a clockwise direction as the engine
speed (rpm) rises. The scale behind
the needle is usually marked in 100s
of rpm and there’s also often a colour
scale to indicate the normal rpm range
(green), a high rpm range (orange) and
an “over-the-limit” range (red).
In recent years, digital tachometers have also become quite popular
with car enthusiasts. These directly
show the engine speed on 7-segment
LED displays or on an LCD but they
do have one disadvantage – the
forbidden red zone, where you can
do serious engine damage due to
over-revving, isn’t indicated on the
display. Instead, it’s up to the driver
to remember the where the redline is
and drive accordingly.
This design overcomes that problem by including a bargraph display.
This display operates in conjunction
with the digital display and has 10
LEDs – seven green and three red.
As the engine speed rises, the seven
green LEDs progressively light and
then the three red LEDs all light
together.
In effect, the bargraph has eight
steps – seven for the green (normal)
range and one for the redline. These
eight steps can be programmed to
operate at any value within a 0-9900
rpm range, so the new Digital Tachometer can be used with virtually any
engine (provided its redline is less
than 9900 rpm).
By the way, a reading of 9900 is also
the limit for the digital readout but
that should be more than enough for
any normal engine. Beyond 9900rpm,
the 7-segment LED displays show a
value of “-00” to indicate the over
range.
Basic features
The Digital Tachometer is a compact unit which is much smaller than
any of our previous tachometers. In
fact, it is about as small as you could
expect, considering that there are
four 7-segment displays and a 10-LED
bargraph housed in the case. That’s
all been made possible by basing the
design on a PIC16F84 microcontroller – the same device as used in the
Speed Alarm (November 1999) and
the Digital Voltmeter (February 2000).
In fact, this circuit completes a
trilogy of car project designs based
on the PIC16F84 microcontroller. As
before, the PIC controller has allowed
us to dramatically reduce the required
parts count and this in turn makes the
unit easy to build. Even the circuits
are quite similar – we’ve “simply”
made a few hardware changes and
rewritten the software that’s programmed into the microcontroller, so
that it now functions as a tachometer.
The new Digital Tachometer is also
very easy to install and calibrate. It
connects to the ignition supply and
ground for power and obtains its
signal from the ignition coil or from
an engine management computer. It
shows the engine rpm in 100 rpm
increments on the 4-digit LED display,
while the bargraph indicates engine
rpm in an analog format.
One nice feature is that the display
brightness varies according to the ambient light. In bright light, the display
is at its maximum brilliance so that
it can be easily seen. However, as the
ambient light falls (eg, at night time),
the display automatically dims so that
it won’t be too bright.
Before using the tachometer, you
have to select the calibration profile
for your particular engine and adjust
Main Features
•
4-digit LED display showing up to 9900 rpm; 10-LED bargraph with
redline indication.
•
•
100 rpm display resolution.
•
LEDs 8-10 (red) in bargraph display light up together for redline indication.
•
LED rpm indication thresholds in bargraph can be individually set (eg,
to allow the unit to be used as a gearchange indicator).
•
Automatic calculation and setting of the LEDs 1-7 rpm thresholds
when the LEDs 8-10 rpm threshold is set.
•
•
Optional dot or bargraph display.
•
•
Adjustable rpm hysteresis for limiter output and bargraph display.
•
•
Automatic display dimming during low light conditions.
Works with 4-stroke engines with up to 12 cylinders and 2-stroke engines with up to 6 cylinders.
Rev limiter output signal (can drive the SILICON CHIP Rev Limiter
switcher board described April 1999).
Three switches for setting calibration, bargraph and hysteresis values
(Mode, Up and Down).
Rpm sensing directly from ignition coil or via low voltage signal from
engine management computer.
the bargraph display range. We have
made this process very easy to do
using just three pushbutton switches.
These switches are located on the
circuit board just below the bargraph
display but are not accessible when
the lid is on since calibration is normally a “set and forget” function.
The first time you apply power to
the unit, the unit will be ready to display the engine rpm. In addition, the
internal program loads a number of
default values for the calibration, bargraph display and hysteresis. Initially,
the unit is calibrated for a 4-cylinder
4-stroke engine, the redline is set at
4000 rpm and the hysteresis is set at
100 rpm. The first LED in the bargraph
lights at 0 rpm but you can change
this and the other green LEDs to light
at what values ever you like (eg, to
indicate gear change-down points).
Note that the default values remain
in place unless changed by pressing
the calibration switches. We’ll tell
you how to do this later in the article.
Dot or bargraph display
In case you’re wondering, the
style of the bargraph display can be
changed from bar to dot mode – hey,
we are using a microcontroller after
all! The major difference here is that
in the dot mode, only one LED from
LEDs 1-7 will light at a time. However,
LEDs 8-10 always light together so
that aspect remains the same.
The Dot mode is selected by holding down the Mode switch while power is applied to the unit (ie, when the
ignition is switched on). The display
will then show a “d” to indicate dot
mode. Similarly, the bargraph mode
can be reactivated by again pressing
the Mode switch during power up.
This time, the display will show a
“b” to indicate that the unit is now in
bar mode. Note that the adjacent digit
will also show a “0”, so the display
actually shows “d0” or “b0”.
The dot mode can be used to provide some unique display results.
For example, if you program more
than one LED to light at the same
rpm value, then only the LED that’s
on the right will light. You can use
this feature to set up the tachometer
to provide gearchange indication,
whereby a series of three LEDs light
in sequence to indicate when to
April 2000 15
Fig.1: (left): a PIC microcontroller
does most of the work in the Digital
Tacho. It accepts input pulses from
the coil (via a pulse conditioning
circuit) or from the tacho output of
an engine management computer
and drives the LED displays.
change up. The lower four LEDs can
be blanked out by programming their
rpm settings to the same value as for
LED 5.
The hysteresis for the LED bargraph
display in dot or bar mode can also
be selected to give the best bargraph
display and limiter results. The
hysteresis sets the rpm difference
between when a LED first turns on
and when it is switched off.
If the hysteresis is set at 0, then
each LED and the limiter output will
switch on at the preset rpm and also
switch off at this same rpm value. This
means that a LED will continually
flicker on and off if the rpm remains
fairly constant. Adding hysteresis
(eg, 100 rpm) ensures that the engine
rpm must fall by a preset amount before the LED extinguishes after first
switching on. This prevents display
flicker which can be distracting.
Hysteresis is also useful for the
limiter output. This must stay low
for a certain length of time to give
the ignition limiting circuit a chance
to work.
The hysteresis is initially preset
to 100 rpm and this value should be
suitable for most applications. However, if your engine doesn’t maintain a
constant rpm value at a given throttle
setting, a greater hysteresis value may
be required. In practice, you can set
it to any value from 0-900 rpm in 100
rpm steps.
One feature that is fixed in the
software is the display update time.
This is nominally set at the count
period for the ignition coil pulses
and is 0.3 seconds for a 4-cylinder
4-stroke engine. However, engines
with more sparks per revolution will
have a calibration which gives a faster
count period and this would cause
the display to become a blur as the
digits rapidly changed, particularly
the 100 rpm digit.
The software compensates for this
problem by only changing the display
reading at a maximum of once every
0.3s regardless of the count period
set by the calibration value. The
16 Silicon Chip
bargraph display update time is also
fixed at 0.3s.
The accompanying calibration
table (Table 1) shows the correlation
between the number sparks per revolution, the count period and the
display update time. Note how the
count period becomes very short for
6-12 cylinder 4-stroke engines.
Circuit details
Refer now to Fig.1 for the complete
circuit details. It’s dominated by IC1
which is the programmed PIC16F84P
microcontroller. This device accepts
inputs from the ignition coil (via a
pulse conditioning circuit) or from
the tacho output of an engine management computer and drives the
LED displays.
OK, let’s start with the pulse conditioning circuit. First, the voltage
pulses from the ignition coil are
attenuated by a factor of three using
a voltage divider based on 22kΩ and
10kΩ resistors. The attenuated signal
is then filtered by a .056µF capacitor
which shunts signals above about
400Hz to ground and then AC-coupled via a 2.2µF capacitor to diode
D1 and zener diode ZD2.
ZD2 limits the peak signal level
to 20V, while D1 allows only positive-going pulses to be fed to the
inverting input (pin 2) of IC2a. A
10kΩ resistor between this input and
ground holds the voltage low in the
absence of any signal via D1.
Alternatively, an ignition signal
which swings from ground up to a
maximum of 20V can be applied to
the low input if this type of signal
is available on your vehicle (eg, the
tacho output of the engine management computer).
IC2a functions as an inverting
comparator with hysteresis. Each
time a positive-going pulse is applied
to pin 2, the output at pin 1 swings
low. Alternatively, when no signal is
present, pin 1 of IC2a swings high to
almost 12V.
Pin 3 of IC2a is nominally biased to
about 1.6V by a voltage divider consisting of 4.7kΩ and 2.2kΩ resistors,
while the 47kΩ positive feedback
resistor provides the hysteresis. This
sets the high-going threshold for the
comparator to 1.7V and the low-going
threshold to 1.5V and prevents false
triggering due to noise.
IC2a’s output drives pin 6 (RB0)
of IC1 via a 2.2kΩ limiting resistor.
Specifications
•
•
•
RPM accuracy typically 0.5% plus 100 rpm.
•
Bargraph rpm LED threshold values and limiter output rpm level can be
set at any value from 0-9900 rpm.
•
Bargraph and limiter output hysteresis (rpm on to rpm off) adjustable
from 0-900 rpm in 100 rpm steps.
•
Limiter output time set at a minimum of 0.3s.
Linearity and repeatability within 100 rpm.
Tachometer display update time: 0.6s for 2-cylinder 4-stroke calibration,
0.3s for 4-12-cylinder 4-stroke calibration settings.
This resistor limits the current flow
from IC2a when its output swings
to a nominal 12V, while the internal
clamp diodes at RB0 limit the voltage
on this pin to about 5.6V (ie, 0.6V
above the supply).
Pin 6 (RB0) of IC1 is set as an interrupt and the internal software responds whenever this input goes low.
on and applies power to the common
anode connection of DISP3. Any low
outputs on RB1-RB7 will thus light
the corresponding segments of that
display.
After this display has been on
for a short time, the RA2 output is
taken high and DISP3 turns off. The
7-segment data on RB1-RB7 is then
updated, after which RA1 is brought
low to drive Q2 and display DISP4.
Finally, after a short time, RA0 is
taken low to drive Q3 and LEDs1-7
of the bargraph.
Note that displays DIPS1 and DISP2
always show “00”. These displays
have their a-f segments commoned
and connected to ground via 150Ω
resistors. DISP1 is switched by transistor Q2 and so it lights when DISP4
lights. Similarly, DISP2 is switched
by transistor Q1 and lights when
DISP3 lights.
But why multiplex DISP2 and
DISP1 if they always show “00”?
Why not just leave them on all the
time? The answer is that we multiplex
them so that they will have the same
brightness as the other displays. This
LED displays
The 7-segment LED displays and
the LEDs1-7 of the bargraph are driven
directly from the RB1-RB7 outputs
of IC1 via 150Ω current limiting
resistors. As shown, the corresponding segments of displays DISP3 and
DISP4 are connected together, as are
the segments for DISP1 and DISP2.
In addition, the cathodes of the first
seven LEDs in the bargraph (LEDs17) are each tied to a DISP3/4 display
segment.
The displays are driven in multiplex fashion, with IC1 switching
its RA0, RA1 and RA2 lines low in
sequence to control switching transistors Q1-Q3. For example, when RA2
is switched low, transistor Q1 turns
Table
Table 1:
1: Calibration
Calibration Data/Update
Data/Update Times
Tim es
N o. Of Cyls.
(4-stroke)
1
N o. Of Cyls.
(2-stroke)
2
1
3
4
2
5
Pulses/Rev
Count Period
Update Time
0.5
1.2
1.2
1
0.6
0.6
1.5
0.4
0.4
2
0.3
0.3
2.5
0.24
0.3
6
3
3
0.2
0.3
8
4
4
0.150
0.3
10
5
5
.06
0.3
12
6
6
.05
0.3
April 2000 17
limiting resistors when the reline has
been reached. Second, it provides the
limiter output signal. This output is
normally at +5V but goes low to drive
an external limit circuit whenever the
redline is reached.
Switch inputs
Fig.2: install the parts on the PC boards as shown here. Note that
switches S1-S3 on the display board must be installed with their
terminals oriented as shown, while the electrolytic capacitors must
all be mounted parallel to the board surface (see photo).
is particularly important when the
displays are dimmed. Multiplexing
them also means that we only need
six 150Ω current limiting resistors
for the two displays rather than the
12 that would be needed if they were
not multiplexed.
The output at RA3 performs two
functions. First, it switches low and
drives LEDs 8-10 via 470Ω current
Switches S1, S2 & S3 are all monitored at the RA4 input. The other
sides of the Mode, Down and Up
switches connect to the RA0, RA1 &
RA2 outputs respectively. Normally,
the RA4 input is held high via a 47kΩ
resistor which connects to the +5V
supply rail. However, when a switch
is closed (pressed), the RA4 input is
regularly taken low by one (and only
one) of the RA0-RA2 outputs.
The microcontroller then determines which switch has been closed
by checking to see which one of the
RA0, RA1 & RA2 outputs is low when
RA4 is low. For example, if RA4 is low
when RA0 is low, then it’s the Mode
switch that’s been pressed.
Similarly, if RA4 is low when RA1
is low it’s the Down switch that’s
pressed and if RA2 must be low then
it’s the Up switch.
The 1kΩ resistors in series with
the Mode and Up switches are there
to ensure that the RA0, RA1 & RA2
outputs can not be shorted if more
Capacitor Codes
Value
IEC Code EIA Code
0.1µF 100n
104
0.056µF 56n
563
15pF 15p 15
Resistor Colour Codes
No.
1
1
1
2
1
2
2
1
3
2
13
1
18 Silicon Chip
Value
47kΩ
22kΩ
22kΩ
10kΩ
4.7kΩ
2.2kΩ
1kΩ
680Ω
470Ω
220Ω
150Ω
10Ω
4-Band Code (1%)
yellow violet orange brown
red red orange brown
red red orange brown
brown black orange brown
yellow violet red brown
red red red brown
brown black red brown
blue grey brown brown
yellow violet brown brown
red red brown brown
brown green brown brown
brown black black brown
5-Band Code (1%)
yellow violet black red brown
red red black red brown
red red black red brown
brown black black red brown
yellow violet black brown brown
red red black brown brown
brown black black brown brown
blue grey black black brown
yellow violet black black brown
red red black black brown
brown green black black brown
brown black black gold brown
than one switch is pressed at the same
time. This could otherwise produce
strange display results.
Dimming
IC2b is used to control the display
brightness. This op amp is connected
as a voltage follower and drives buffer
transistor Q4 which is inside the negative feedback loop. Light dependent
resistor LDR1 controls the voltage on
the pin 5 input of IC2b according to
the ambient light level. IC2b in turn
controls Q4 and thus the voltage applied to the emitters of display drivers
Q1-Q3 and to the commoned anodes
of the red LEDs in the bargraph.
The circuit works like this. When
the ambient light is high, LDR1 has
low resistance and so the voltage on
pin 5 of IC2b will be close to +5V.
This means that the voltage at Q4’s
emitter will also be close to +5V and
so the LED displays will operate at
full brightness.
Conversely, in low light conditions,
the resistance of the LDR will be higher and so the voltage on pin 5 of IC2b
is lower than before. In fact, when it’s
completely dark, the voltage on pin 5
is determined by VR1 which sets the
minimum brightness level. As before,
the voltage on pin 5 appears at Q4’s
emitter and so the displays are driven
at reduced brightness.
Note that, in practice, VR1 is adjusted to give the requisite display
brightness at night.
Clock signals
Clock signals for IC1 are provided
by an internal oscillator circuit which
operates in conjunction with 4MHz
crystal X1 and two 15pF capacitors.
The two capacitors are there to provide the correct loading and to ensure
that the oscillator starts reliably.
The crystal frequency is divided
down internally to produce separate
clock signals for the microcontroller
operation and for display multi
plexing. The crystal frequency is also
used to give a precise time period over
which to count the incoming ignition
pulse signals at RB0. The number of
pulses counted in a given time indicates the engine rpm.
Power
Power for the circuit is derived
from the vehicle’s battery rail via the
ignition switch. A 10Ω 1W resistor
and 47µF capacitor decouple this
The display board (in case at top) plugs directly into the pin header sockets on
the processor board (above), eliminating wiring connections between the two.
Notice how the electrolytic capacitors on the processor board are bent over, so
that they lie across the regulator leads and across ZD2.
12V supply rail, while zener diode
ZD1 protects the circuit from transient voltage spikes above 16V. The
decoupled supply rail is then fed to
REG1 to derive a +5V rail and this in
turn is filtered by the 47µF and 0.1µF
capacitors.
The +5V supply rail is used to
power all the circuitry except for IC2
which is powered directly from the
decoupled 12V ignition supply.
OK, so much for the electronic
hardware which is fairly straightforward. As you’ve probably gathered
by now, most of the complicated stuff
takes place inside the microcontroller
under software control. We’ll describe
how this software works next month.
Construction
Fortunately, you don’t have to
understand how the software works
to build this circuit. Instead, it’s all
programmed into the PIC chip. You
just buy the preprogrammed chip
and “plug” it into the socket on the
circuit board.
All the parts for the Digital Tacho
meter are mounted on two PC boards:
a processor board coded 05104001
April 2000 19
The pin headers are installed on the track side of the display board using a finetipped soldering iron. Note that it will be necessary to slide the plastic spacers
along the leads to allow room for soldering.
This view shows how the two boards are stacked together in “piggyback”
fashion to make a compact assembly. Make sure that none of the parts on the
processor board contact the back of the display board.
and a display board coded 05104002.
Both boards measure 78 x 50mm.
They are stacked together and the
connections between them automatically made using pin headers and
cut-down IC sockets.
Fig.2 shows the assembly details.
Begin the construction by checking
both boards for shorts between tracks,
open circuit tracks and undrilled
holes. This done, you can install all
the parts on the processor board as
shown in Fig.2.
First, install all the wire links,
then install the resistors using the
accompanying resistor colour code
table as a guide to selecting the correct
values. It’s also a good idea to use a
digital multimeter to measure each
20 Silicon Chip
one, just to make sure. Note that the
150Ω resistors on the processor PC
board are mounted end on.
The horizontal trimpot (VR1) can
go in next, followed by a socket to
accept IC1 – but don’t install the IC
yet. IC2 is soldered directly to the
board and can go in now. Make sure
that both IC2 and the socket for IC1
are correctly oriented.
Next, install diode D1 and zener
diodes ZD1 & ZD2, followed by transistors Q1-Q4. Be careful here – Q4 is
a BC338 NPN type while Q1-Q3 are
BC328 PNP types, so don’t get them
mixed up.
Now for regulator REG1 – this is
installed with its metal tab flat against
the PC board and with its leads bent
at rightangles to pass through their respective mounting holes in the board.
Make sure that the hole in the metal
tab lines up with its corresponding
hole in the PC board.
The capacitors can now be installed, making sure that the electrolytic types are correctly oriented.
Note that the electrolytics must all
be mounted so that they lie parallel
with the PC board, as shown in the
photograph. The two 47µF capacitors
at bottom right are bent over so that
they lie across the regulator’s leads,
while the 2.2µF capacitor below diode
D1 lies across ZD1.
Crystal X1 also mounts horizontally on the PC board. It is secured
by soldering a short length of tinned
copper wire between one end of its
metal case and a PC pad immediately
to the right of Q1.
The three 7-way in-line sockets can
now be fitted. These are made by cutting two 14-pin IC sockets into single
in-line strips using a sharp knife or
a fine-toothed hacksaw. Clean up the
rough edges with a file before installing them on the PC board.
Finally, install PC stakes at the five
external wiring positions (near the
bottom edge of the board and adjacent
to D1). Once they’re in, trim these
stakes on the component side of the
board to prevent them from shorting
against the display PC board later on.
Also, the coil input PC stake needs to
be shortened to prevent it from arcing
to adjacent tracks on the display board
due to its high voltage.
Display board assembly
Now for the display board. Install
the wire links and the resistors first,
including the six 150Ω resistors that
sit beneath DISP1 and DISP2. The four
7-segment LED displays can then be
installed with their decimal points at
bottom right. Note that all the displays
are mounted slightly proud of the
board because of the 150Ω resistors.
Make sure that they are all correctly
aligned before soldering all their pins.
Switches S1-S3 must be oriented
correctly, so that there is normally
an open circuit between the top and
bottom terminals of each switch.
These switches have leads which are
rectangular in shape and it’s simply
a matter of installing them with their
leads oriented as shown in Fig.2.
The LED bargraph mounts so that
the anode leads are to the left. Install
Fig.3: follow this diagram when stacking the boards together
and be sure to use plastic washers where indicated. Note the
small heatsink attached to the brass spacer.
Fig.4: the full-size artworks for the front panel and PC boards
are shown above and at right.
it so that the green LEDs are to the
left and the red LEDs to the right and
you can’t go wrong. It should also be
installed so that its top face is 19.5mm
above the PC board, so that it will later
sit flush with the front panel.
The LDR should be mounted with
its face about 1.5mm above the displays.
Finally, complete the display board
assembly by inserting the pin headers.
These are installed from the copper
side of the board with their leads just
protruding above the board surface.
You will need a fine-tipped soldering
iron to solder them to the copper pads
on the PC board. It will also be necessary to slide the plastic spacers along
the leads to allow room for soldering.
Final assembly
The plastic case requires a minor
amount of work before installing the
PC boards.
First, use a sharp chisel to remove
the integral side pillars, then slide
the processor PC board into the case
and drill two mounting holes – one
through the metal tab hole of the regulator and the other below the 0.1µF
capacitor near IC2. An oversize drill
can then be used to countersink the
holes on the outside of the case, to suit
the specified M3 x 6mm CSK screws.
Two holes are also required at the
rear of the base of the case for the
power supply wiring and for the ignition coil lead. These holes can be
drilled so that they line up with the
relevant PC stakes.
The next step is to fashion a small
heatsink from sheet copper and solder it to the 6mm brass spacer – see
Fig.3. This heatsink must be shaped
so that the copper sheet cannot make
contact with any components on the
processor PC board and cause a short.
The main component to watch out for
here for is ZD1.
The display board can now be
plugged into the processor board
and the assembly secured exactly as
shown in Fig.3. Be sure to use plastic
washers and spacers where specified
and note that you must use an M3 x
15mm Nylon screw on one side of the
assembly, while the other side uses a
metal screw.
Check that the leads from the parts
on the display PC board do not interfere with any of the parts on the
processor PC board or with the copper heatsink. Some of the pigtails on
the display PC board may have to be
trimmed to avoid this.
The front panel label can now be
affixed to the front panel and used
as a template for making the display
cutouts and for drilling the hole for
the LDR. The main display cutout is
made by first drilling a series of small
holes around the inside perimeter,
then knocking out the centre piece
and filing the job to a smooth finish.
Make the cutout so that the red Perspex or acrylic window is a tight fit.
The window can be further secured by
applying several small spots of super
glue along the inside edges.
Similarly, the cutout for the LED
bargraph can be made by drilling a
row of small holes and then filing so
that the bargraph is a neat fit.
Test & calibration
It’s a good idea to check the power
supply before plugging the microcontroller IC into its socket.
To do this, first unplug the display
board and connect automotive wires
to the +12V and GND inputs of the
processor board. This done, apply
power and use a multimeter to check
that there is +5V on pins 4 & 14 of
IC1’s socket, using the metal tab of
REG1 for the ground connection.
If this is correct, disconnect the
power and insert IC1 in place, ensuring that it is oriented correctly. Now
attach both PC boards together and
reapply power. The 7-segment LED
displays should show “000” rpm,
April 2000 21
Parts List
1 processor PC board, code
05104001, 78 x 50mm
1 display PC board, code
05104002, 78 x 50mm
1 front panel label, 80 x 52mm
1 plastic case utility case, 83 x 54
x 30mm
1 dark red transparent Perspex or
Acrylic sheet, 59 x 20 x 2.5
1 4MHz parallel resonant crystal
(X1)
1 LDR (Jaycar RD-3480 or equiv.)
5 PC stakes
3 7-way pin head launchers
2 DIP-14 low cost IC socket with
wiper contacts (cut for 3 x
7-way single in line sockets)
3 tactile switches (S1-S3) (Jaycar
SP-0730 or equiv.)
1 500kΩ horizontal trimpot (VR1)
1 6 x 20 x 0.5mm sheet copper for
heatsink
1 400mm length of 0.8mm tinned
copper wire
1 2m length of red automotive
wire
1 2m length of black or green
automotive wire (ground wire)
1 2m length of 250VAC wire for
ignition coil connection
3 6mm tapped spacers
2 M3 nuts
2 M3 x 6mm countersunk screws
or Nylon cheesehead cut to
length
3 M3 plastic washers 1mm thick
1 M3 x 15mm Nylon screw
while the first seven LEDs of the bargraph should be lit.
Pressing the Mode switch (at far
left) selects the first calibration function (or mode). This mode shows the
calibration value which is a number
ranging from 1-12, corresponding to
1-12 cylinders for a 4-stroke engine.
Note that the display also shows the
two fixed righthand “00” digits but
these are ignored.
Initially, the display should read
“400” which is the default value for
the number of engine cylinders; ie, the
default is for a 4-cylinder engine (as
previously stated, the two righthand
digits are ignored).
The calibration number is changed
using the Up button (far righthand
side) which selects the next value.
22 Silicon Chip
1 M3 x 15mm brass screw
Semiconductors
1 PIC16F84P microprocessor
programmed with TACHO.HEX
program (IC1)
1 LM358 dual op amp (IC2)
1 7805, LM340T5 5V 1A
3-terminal regulator (REG1)
3 BC328 PNP transistors (Q1-Q3)
1 BC338 NPN transistor (Q4)
4 HDSP5301, LTS542A common
anode 7-segment LED displays
(DISP1-DISP4)
1 10-LED bargraph (Jaycar ZD1702 or equiv.) (LEDs 1-10)
1 16V 1W zener diode (ZD1)
1 20V 1W zener diode (ZD2)
Capacitors
2 47µF 25VW PC electrolytic
1 2.2µF 50VW bipolar electrolytic
2 0.1µF MKT polyester
1 .056µF MKT polyester
2 15pF ceramic
Resistors (0.25W, 1%)
1 47kΩ
2 1kΩ
1 22kΩ 1W
1 680Ω
1 22kΩ
3 470Ω
2 10kΩ
2 220Ω
1 4.7kΩ
13 150Ω
2 2.2kΩ
1 10Ω 1W
Miscellaneous
Automotive connectors,
heatshrink tubing, cable ties, etc.
You simply press this switch until
the required value appears. So, if you
have a 6-cylinder car, press the Up
button twice so that the display reads
“600”. The Down switch (middle)
does not operate for the calibration
adjustment.
Note that if you are calibrating for
a 2-stroke engine, you should select
a value that is twice the number of
cylinders.
Pressing the Mode switch again
lights the lefthand LED in the bargraph display. This corresponds to
the lower rpm LED setting which is
initially “000” rpm. It can be adjusted
using the Up and Down switches if
you wish to alter the default value.
Pressing the Mode switch again
cycles to the next LED in the bargraph
display and so on until the final 8, 9 &
10 (red) LEDs of the bargraph display
all light up.
As indicated at the start of the
article, the initial pre-programmed
redline value is 4000 rpm and this
will be indicated on the display. This
value should be altered to suit the
redline limit for your engine using the
Up and Down switches. Once this had
been done, the lower rpm settings for
LEDs 1-7 are automatically calculated
to provide a linear progression. You
can go back and check this by pressing
the Mode switch until you return to
the rpm setting modes (after three
Mode switch pressings) for each LED
on the bargraph display.
Note that you must change the 4000
rpm setting, otherwise the automatic
calculation process won’t take place.
This means that if you wish to set the
redline limit at 4000 rpm (ie, to the
default value), you must first press the
Up switch and then the Down switch
to return to 4000 rpm again. Once
this has been done, the automatic
calculation will take place.
OK, so that’s the basic setup procedure for the Digital Tachometer. Note
that all these settings now remain in
place unless they are altered using
the switches – even if the power is
removed.
Advanced features
While most users will be happy
with the basic setup, there are some
added features for those who would
like to customise their tachometer.
One of the obvious changes that
could be made is to individually adjust the rpm setting for each LED in
the bargraph display. This could be
done to compress the rpm range for
the middle LEDs where most of the
engine action takes place.
For example, the lower LED could
be set to indicate the engine speed at
which to change down, to prevent the
engine from labouring. The middle
LEDs could then be programmed to
light over a narrower range of rpm
values compared to the linear progression that is automatically calculated.
The only thing to note here is that it
is important to adjust the LEDs 8-10
(redline) value first before changing
the lower rpm values for the remaining LEDs. If you don’t do this, the
settings will be overwritten by the
automatic recalculation process that
takes place each time the LEDs 8-10
rpm value is changed.
Simply cycling through the LEDs
8-10 rpm setting using the Mode
switch will not activate the automatic recalculation process, however.
Automatic recalculation only occurs
when the Down or Up switch is
pressed in this mode. In fact, you can
cycle through all the modes without
changing any of the settings.
The hysteresis setting mode is
selected by repeatedly pressing the
Mode switch until the display shows
“H100” (ie, the default is 100 rpm).
If necessary, this can be altered using
the Up switch. As you do this, the
display indicates hysteresis in 100’s
of rpm. Note that the Down switch
does not operate in this mode.
Further tests & installation
You can test the dimming feature
by holding your finger over the LDR
to simulate darkness. Unfortunately,
you will need to unplug the display
board (with the power switched off)
to make adjustments to VR1, so adjustments will have to be done on a
trial and error basis. The best time to
make this adjustment is at night – just
set VR1 to give the correct minimum
brightness in the dark.
You can further test the Digital
Tachometer with a signal generator
set to give a 3V rms sinewave output.
Attach the signal generator output
between ground and the low voltage
input of the tachometer. The unit
should show a reading of 3000 rpm
per 100Hz input (4-cylinder, 4-stroke
calibration only).
Use automotive cable and connectors when installing the unit into a
vehicle. The +12V supply connection
is derived via the ignition switch and
a suitable connection point will usually be found inside the fusebox. Be
sure to choose the fused side of the
supply rail, so that the existing fuse
is in series.
The ground connection can be
made by connecting a lead to the
chassis via an eyelet and self-tapping
screw.
The coil input for rpm sensing can
connect directly to the switched side
of the ignition coil using 250VAC rated wire. Alternatively, you can use a
low voltage signal if this is available
from the vehicle’s computer; eg, a
low-voltage tachometer output signal.
A 0-5V signal will directly trigger the
Digital Tachometer if the signal is
Using The Rev Limiter Output
A
S MENTIONED the Digital Tach ometer limit output can control
an engine limiter. This will reduce the
number of sparks per revolution at the
rpm limit and thus prevent the engine
from revving past this limit.
We published a suitable Rev Limiter circuit in the April 1999 issue but
note that you don’t have to use the
whole circuit. Instead, you only have
to use the Ignition Switcher circuit
which was assembled on a separate
PC board.
The Ignition Switcher uses a single
555 timer IC and several transistors
to drive a high-voltage Darlington
output transistor. When the rev limit
is reached, this transistor shorts out
the main switching transistor in the
car’s ignition system for about 50% of
time, thus reducing the engine power
and thereby limiting the engine rpm
to the redline.
The two circuits are easy to marry –
all you have to do is connect the limit
output from the Digital Tachometer
directly to the terminal marked “From
Rev Limit Controller” on the Ignition
Switcher. A suitable value for C1 must
be chosen for the Ignition Switcher
from the table published in the April
issue. This sets the requisite number
of sparks that are blocked out during
the limiting action.
Note that if the Digital Tachometer
derives its input signal from the coil, it
will sense that the rpm has dropped
as soon as the coil is prevented
from sparking via the limiter action.
This means that the limit action may
not be as smooth as it would be if
the tachometer signal was derived
from a different source, such as the
tachometer output from the engine
computer.
However, the limit output from
the tachometer will remain low to
disable the spark for at least 0.3s,
regardless of the input source for the
tachometer. This should provide
sufficient time for the limit action to
take place.
The limiter output from the Digital Tacho can be used to drive this Ignition
Switcher board (SILICON CHIP, April 1999), to restrict engine revs to the
“red-line” setting.
connected to the low voltage input.
Note that some cars, including
late-model Holden Commodores and
Ford Falcons, use double-ended ignition coils, with each coil simultaneously firing two spark plugs (ie, three
coils are used for a 6-cylinder engine).
Similarly, some cars use individual
coils for each cylinder and these are
usually located at the ends of the HT
leads, directly on the spark plugs.
Invariably, these types of coils are
fully encapsulated and their terminals are not accessible. The answer
here is to use the tacho output from
the engine management computer.
You will need to refer to the wiring
diagram for your vehicle to identify
the correct lead or check with an auto
SC
electrician.
April 2000 23
|