This is only a preview of the February 2000 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 "A Digital Voltmeter For Your Car":
Items relevant to "Build A Safety Switch Checker":
Items relevant to "A Sine/Square Wave Oscillator For Your Workbench":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
Keep tabs on your
car's battery with this:
Digital Voltmeter
This digital voltmeter will let you
keep tabs on the condition of your
car’s battery & charging system. A PIC
microcontroller shrinks the circuitry
into the smallest available jiffy box
and makes it a snack to build.
By JOHN CLARKE
Flat batteries usually happen at the
most inconvenient time, in the most
inappropriate place and when the
weather is being totally disagreeable.
In fact, the battery is probably the most
unreliable component in a modern vehicle. To alleviate this problem, some
battery manufacturers incorporate a
backup unit within the same case, to
allow the vehicle to be started if the
main unit fails.
24 Silicon Chip
A car battery can only deliver peak
performance if it is properly maintained. This not only involves keeping
an eye on the electrolyte level but also
ensuring that the charging voltage operates within strict limits. That means
a charging voltage of 13.8-14.4V for a
12V battery, or 27.6-28.8V for a 24V
battery.
If the battery voltage never reaches
13.8V, then either the charging voltage
is too low or the battery is on the way
out. This means that the battery will
be marginal when it comes to delivering the necessary current during
starting, particularly in cold weather.
Conversely, if the battery is being
overcharged, the electrolyte will gas
excessively, leaving the plates dry
and reducing the battery’s amp-hour
(Ah) capacity.
This can not only dramatically
shorten the life of the battery but in
severe cases (eg, if the voltage regulator has failed) could damage various
electronic equipment in the car.
So how can you be sure that your
car’s battery is being properly charged
and that it is in good condition? The
answer is to build and fit this Digital
Voltmeter. It monitors the voltage
across the battery terminals and thus
provides an accurate indication of
the charging voltage. It also indicates
how well the electrical system and the
battery cope with extra loads such as
lighting, fans and audio systems.
In addition, an accurate voltmeter
can quickly indicate the overall condition of the battery. For example, if the
battery voltage regularly drops below
its nominal value of 12V (eg, when
the engine is idling or if the engine
has been turned off for some time), it
indicates that the battery is unable to
maintain a charge (assuming that the
charging system is OK).
Another time to watch the battery
voltage is during starting. During this
time, the starter motor draws substantial current and the battery voltage
will fall below its nominal 12V value.
Wouldn’t it be nice to be able to accurately monitor the minimum battery
voltage when the vehicle is started?
Well, with this Digital Voltmeter
you can because we’ve incorporated a
minimum hold facility. All you have to
do is press the Min/Hold button on the
front panel at any time after starting
and the lowest measured voltage will
be displayed. The display then reverts
to normal mode when the button
is released. The minimum voltage,
which is stored in volatile RAM, is
automatically cleared the next time
the ignition is turned off.
Normally, with a good battery, the
voltage should only drop to around
10.5V when starting the engine, although this will depend on the temperature, the cranking current and on
the battery itself. In any case, it’s just
a matter of using the Min/Hold button
to establish a benchmark minimum
voltage for your car’s battery and then
checking it occasionally to make sure
that the battery is in good condition.
Be aware, though, that it’s normal
for the voltage to go down during cold
weather, so keep this in mind before
suspecting a faulty battery.
In summary, there are good reasons
for carefully monitoring the battery
voltage and this unit is ideal for the
job. It boasts high accuracy, negligible
drift with temperature and a 3-digit
LED display that reads to the nearest
0.1V in 12V mode. It also features
automatic display dimming to suit the
ambient light conditions.
Only three wires are required to
Fig.1 (right): the PIC microcontroller
does most of the work. It accepts
inputs from the battery (via IC2a) and
the Min/Hold switch and drives the
7-segment displays in multiplex fashion.
FEBRUARY 2000 25
Parts List
1 processor PC board, code
05102001, 78 x 50mm (150
holes)
1 display PC board, code
05102002, 78 x 50mm (93
holes)
1 front panel label, 80 x 53mm
1 plastic case utility case, 83 x 54
x 30mm
1 4MHz parallel resonant crystal
(X1)
1 LDR (Jaycar RD-3480 or
equivalent)
3 PC stakes
3 7-way pin head launchers
2 DIP-14 low-cost IC sockets
with wiper contacts (cut for 3 x
7-way single in-line sockets)
1 PC board mount click-action
push-on switch (S1)
1 9mm tapped brass spacer
3 6mm tapped spacers
2 M3 x 6mm countersunk screws
or Nylon cheesehead
2 M3 plastic washers 1mm thick
or 1 M3 plastic washer 2mm
thick
2 M3 x 15mm brass screws
1 2m length of red automotive
wire
1 2m length of yellow automotive
wire
1 2m length of black or green
automotive wire (ground wire)
1 5A 3AG fuse and in-line
fuseholder (optional)
1 1kΩ horizontal trimpot (VR1)
connect the device to the car’s wiring
(+12V, 0V and battery +ve) and the unit
is easily calibrated by adjusting a single trimpot. A second trimpot sets the
minimum display brightness at night.
Circuit details
Refer now to Fig.1 for the circuit
details. It’s dominated by IC1, a
PIC16F84 microcontroller, which
forms the basis of the circuit. This
device accepts inputs from the battery
and switch S1, processes this information and drives the LED displays
to give a voltage readout.
If you think that the circuit looks
similar to the Speed Alarm featured in
the November 1999 issue, you’re dead
right – it is. The major change, at least
26 Silicon Chip
1 500kΩ horizontal trimpot (VR2)
Semiconductors
1 PIC16F84P microprocessor
programmed with DVM.HEX
program (IC1)
1 LM358 dual op amp (IC2)
1 LM2940-T5.0 5V 1A low dropout
3-terminal regulator (REG1)
3 BC328 PNP transistors (Q1-Q3)
1 BC338 NPN transistors (Q4)
3 HDSP5301, LTS542A common
anode 7-segment LED displays
(DISP1-DISP3)
1 20V 1W zener diode (ZD1)
Capacitors
1 47µF 16VW PC electrolytic
1 22µF 35VW PC electrolytic
1 10µF 35VW PC electrolytic
1 1µF 16VW PC electrolytic
2 0.1µF MKT polyester
2 15pF ceramic
Resistors (0.25W, 1%)
3 10kΩ
3 680Ω
1 3.3kΩ
8 150Ω
1 1.8kΩ
1 10Ω 1W
Miscellaneous
Automotive connectors, heatshrink
tubing, cable ties, superglue.
Extra parts for the 24V version
1 PC stake
1 22kΩ resistor
5 820Ω 1W resistors
as far as the hardware is concerned,
is to the input circuitry around IC2a
(plus we’ve eliminated some of the
switches). And that’s the beauty of
using a PIC processor – we can use
similar circuitry but get it to perform
a completely different function by
rewriting the software that controls
the internal “smarts” of the device.
As a bonus, we can shrink the parts
count and that in turns means lower
cost.
OK, let’s start with the voltage sensing circuit based on IC2a. As shown in
Fig.1, the battery voltage is applied to
a divider consisting of a 10kΩ resistor
and a 1.8kΩ resistor in series with a
1kΩ trimpot (VR1). Assuming a 12V
battery, the battery voltage is divided
by a factor of 5.1, filtered using 10µF
capacitor and applied to pin 2 of comparator stage IC2a.
In operation, IC2a compares the
voltage on its pin 2 input with a DC
voltage on its pin 3 input. This DC
voltage is derived by applying a pulse
width modulated (PWM) square-wave
signal from the RA3 output of IC1 to
a 1µF capacitor via a 10kΩ resistor.
As a result, pin 1 of IC2a switches
low when ever the voltage on its pin
2 is greater than the voltage on pin 3.
This signal is then fed via a 3.3kΩ limiting resistor to the RB0 input of IC1.
The resistor limits the current flow
from IC2a when its output goes high
to a nominal 12V, while the internal
clamp diodes at RB0 limit the voltage
on this pin to 5.5V.
A-D converter
Most of the complexity of this circuit is hidden inside the microcontroller (IC1) and its internal program.
However, among other things, IC1
functions as an analog-to-digital (A-D)
converter. In operation, it converts the
comparator signal on its RB0 (pin 6)
input into a digital value which is then
used to drive the 3-digit LED display.
The A-D converter used here is a
little unusual and only requires two
connections to the microcontroller.
As mentioned above, the output at
RA3 produces a PWM signal and this
operates at 1.953kHz with a duty cycle ranging from .075% to 90%. Note
that the high output level is at +5V
while the low output level is at 0V.
The 10kΩ resistor and 1µF capacitor
filter the output from RA3 to derive a
DC voltage that is the average of the
duty cycle waveform.
This means that if the duty cycle is
50% (ie, a square wave), the output
voltage is 50% of 5V, or 2.5V This
voltage is applied to pin 3 of IC2a.
Other DC voltages are obtained by
using different duty cycles. This DC
voltage is connected to pin 3 of IC2a
which is used as a comparator.
Operation of the A-D converter is
as follows: initially, the RA3 output
operates with a 50% duty cycle and
this sets the voltage at pin 3 of IC2a to
2.5V. At the same time, an 8-bit register inside IC1 has its most significant
bit set high so that its value will be
10000000.
The 50% duty cycle signal is produced by IC1 for 65.5ms, after which
the comparator output (pin 1 of IC2a)
is monitored by the RB0 input. Pin 1
of IC2a is low if the divided battery
voltage at pin 2 is greater than 2.5V
and high if the divided voltage is less
than 2.5V.
What happens now is that if the
divided voltage is less than 2.5V, the
PWM output at RA3 is reduced to a
25% duty cycle to produce 1.25V.
The internal register is now set to
01000000. Alternatively, if the divided voltage is greater than 2.5V,
corresponding to a low comparator
output, RA3’s output is increased to
a 75% duty cycle to provide 3.75V.
The register is thus set to 11000000,
with the most significant bit indicating
a 2.5V 50% duty cycle and the next
bit indicating the 1.25V 25% duty
cycle (adding the two bits gives us
the 3.75V).
The comparator level is now again
checked after 65.5ms, after which
the microcontroller adds or subtracts
a 12.5% duty cycle (0.625V) and
checks against the divided battery
voltage again. The register is then set at
X1100000 (with the X value a 1 or 0 as
determined by the previous operation)
if the input voltage is higher than the
PWM waveform. If the input voltage
is lower than the PWM voltage, the
register is set at X0100000.
This process continues for eight
cycles, the microcontroller either
adding or subtracting smaller amounts
of voltage (0.3125V, 0.156V, 0.078V,
0.039V and 0.0195V) and the lower
bits in the 8-bit register being either
set to a 1 or a 0 to obtain an 8-bit A-D
conversion.
The A-D conversion thus has a resolution of about 19mV (0.0195V) at the
least significant bit. In addition, there
are 256 possible values for the 8-bit
register, ranging from 00000000 (0) to
11111111 (255). In practice, however,
we are limited to a range from about
19 to 231.
This is because the software must
have time for internal processing to
take place, to produce the waveform
at RA3’s output and to monitor the
RB0 input. The two values (ie, 19 &
231) correspond to 1.9V and 23.1V
for the 12V measurement mode. This
restricted measurement range is not
really a problem for a car voltmeter
since we only need to measure within
a narrow range from about 6-16V for
a 12V battery.
Following the A-D conversion process, the binary number stored in the
Fig.2: the top waveform in this scope shot shows the output from pin 2 of IC1.
In this case, the peak-to-peak output is 5.12V and the duty cycle is 50%. The
bottom trace shows the resulting filtered waveform on pin 3 of IC2.
8-bit register must be converted to a
decimal value before it can be shown
on the 3-digit display. Once again, this
takes place inside the PIC microcontroller. Note that, in the 24V mode,
the 8-bit register value is multiplied
by two before being converted to the
decimal value. This gives a resolution
of 200mV for the measured voltage.
The A-D conversion relies on several factors to produce a consistent
reading. First, the reference voltage
must remain stable and this means
that the output from RA3 must swing
to the full positive supply rail and all
the way to ground. If it doesn’t, then
the filtered output from RA3 will vary
and give inaccurate results.
For the same reason, the duty cycle
of the PWM waveform at RA3’s output must remain accurate over each
65.5ms period.
In this case, the reference uses the
supply from an LM2940T-5 regulator
which has excellent long term stability
Main Features
•
•
•
•
•
Compact case.
3-digit LED display with automatic dimming.
12V or 24V operation.
Optional remote voltage sensing.
Minimum hold voltage display.
(20mV/1000 hours at 150°C junction
temperature and at maximum input of
26V). Its temperature variation is just
20mV over a 100°C range. In addition,
the output at RA3 is CMOS and swings
to within a few millivolts of the supply
rails at no load.
As for the duty cycle, this is set by
the software and is controlled using
a 4MHz crystal oscillator on pins 15
& 16. This means that the resultant
voltage reading should be accurate to
±1 digit (±2 digits for 24V operation).
The minimum hold switch (S1) is
monitored at the RA4 input. Normally,
the RA4 input is held high via a 10kΩ
resistor to the 5V supply. However,
when the switch is closed, it pulls
the RA4 input low. This low is then
detected by the software which subsequently loads the 7-segment data for
the minimum voltage reading into the
display register.
When S1 is released, RA4 is pulled
high again and the current battery
voltage is again displayed.
LED displays
The 7-segment display data from
IC1 appears at outputs RB1-RB7.
These outputs directly drive the LED
displays via 150Ω current limiting
resistors while the RA0-RA2 outputs
drive the individual displays via
switching transistors Q1-Q3.
The displays are driven in multiplex
fashion, with IC1 switching its RA0,
FEBRUARY 2000 27
and off at 1.96kHz, they appear to be
continuously lit.
Display brightness
Fig.3: install the parts on the PC boards as shown here. Note particularly
the orientation of switch S1 and be sure to use a BC338 transistor for Q4.
The 820Ω resistors (shown in green) are used only in the 24V version.
IC2b is used to control the display
brightness. This op amp is wired as a
voltage follower and drives a transistor
buffer stage (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 drives
Q4 which in turn controls the voltage
applied to the emitters of the display
drivers (Q1-Q3).
During daylight hours, the voltage
on pin 5 (and thus on pin 7) is close
to +5V because the LDR has a low
resistance in strong light. This means
that Q4’s emitter will also be close to
+5V and so the displays are lit at full
brilliance
Conversely, as the light level falls,
the resistance of the LDR increases and
the voltage on pin 5 of IC2b decreases.
In fact, when it’s completely dark, the
voltage on pin 5 is determined by the
setting of trimpot VR2 which sets the
minimum brightness level. As before,
this voltage appears at Q4’s emitter
and so the displays are all driven at
reduced brightness.
Note that, in practice, VR2 is adjusted to give the desired display
brightness at night.
Clock signals
RA1 and RA2 lines low in sequence.
For example, when RA0 is brought
low, transistor Q1 turns on and applies power to the common anode
connection of DISP1. 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 RA0 output is taken
high and DISP1 turns off. The 7-segment data on RB1-RB7 is then updated, after which RA1 is brought low to
drive Q2 and display DISP2. Finally,
RA2 is taken low and new 7-segment
data presented to DISP3.
This cycle is repeated for as long
as power is applied to the unit and
because the displays are switched on
Clock signals for IC1 are provided
by an internal oscillator circuit which
operates in conjunction with crystal
X1 (4MHz) and two 15pF capacitors.
The two capacitors are included to
provide the correct loading for the
crystal and to ensure reliable starting.
The crystal frequency is divided
down internally to produce separate
clock signals for the microcontroller
Resistor Colour Codes
No.
1
3
1
1
3
8
5
1
28 Silicon Chip
Value
22kΩ
10kΩ
3.3kΩ
1.8kΩ
680Ω
150Ω
820Ω
10Ω
4-Band Code (1%)
red red orange brown
brown black orange brown
orange orange red brown
brown grey red brown
blue grey brown brown
brown green brown brown
grey red brown brown
brown black black brown
5-Band Code (1%)
red red black red brown
brown black black red brown
orange orange black brown brown
brown grey black brown brown
blue grey black black brown
brown green black black brown
grey red black black brown
brown black black gold brown
operation and for the display multi
plexing.
Power
Power for the circuit is derived from
the vehicle’s battery via the ignition
switch. A 10Ω 1W resistor and 22µF
capacitor decouple this supply rail,
while 20V zener diode ZD1 protects
the circuit from transient voltage
spikes above this value.
The decoupled ignition supply rail
is then fed to regulator REG1 which
provides a +5V rail. This rail is then
used to power all the circuitry except
for IC2 which is powered directly
from the decoupled ignition supply. A
47µF capacitor and a 0.1µF capacitor
are used to decouple the regulator’s
output.
For 24V systems, the supply input
is applied via five parallel-connected
820Ω 1W resistors which provide a
voltage drop to limit dissipation in
the regulator. Note that a low dropout
regulator is used to allow the voltmeter
to operate down to about 5.5V for 12V
systems. A standard regulator would
have only allowed measurements
down to about 8V before REG1 began
to drop out of regulation.
OK, so much for the circuitry. Of
course, most of the clever stuff takes
place inside the PIC microcontroller
under software control. For a broad
overview of how this software works,
take a look at the accompanying panel.
Construction
Fortunately, you don’t have to understand how the software works to
build this project. Instead, you just
buy the ready-programmed PIC chip
and “plug it in”.
All the parts are mounted on two
small PC boards: a processor board
coded 05102001 and a display board
coded 05102002. These are stacked
together using pin headers and cut
down IC sockets. Fig.3 shows the
assembly details.
Before installing any of the parts,
check the PC boards carefully for
etching defects and undrilled holes.
Two large holes are required in the
display PC board to accommodate a
screwdriver to adjust VR1 and VR2.
These are just below DISP3 and to the
left of S1. Note that two small pilot
holes are provided in each location to
suit two different trimpot sizes – just
drill out the holes to suit the trimpots
supplied.
The display board (in case at top) plugs into the pin header sockets on the
processor board (above). Notice how the bodies of the electrolytic capacitors on
the processor board are bent over, so that they lie parallel to the board surface.
You can now start the assembly by
installing the parts on the processor
board. Begin by installing all the wire
links, then solder in all the resistors
using the accompanying resistor colour code table as a guide. It’s also a
good idea to use a digital multimeter
to measure each one, just to make sure.
Note that the seven 150Ω resistors
Capacitor Codes
Value
IEC Code EIA Code
0.1µF
100n
104
15pF 15p 15
are mounted end on. Note also the
different values for the resistor immediately below VR1.
The two horizontal trimpots (VR1
& VR2) can go in next, followed by
PC stakes at the four external wiring
points. This done, solder in a socket
for IC1 (but don’t install the IC yet),
then install IC2 by soldering it directly
to the PC board. Make sure that both
the socket and IC2 are correctly oriented. This done, install zener diode
ZD1 and 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.
Zener diode ZD1 can now be
FEBRUARY 2000 29
How The Software Works
We have already described the operation of the
A-D converter in the main article and this forms a
major part of the software operation. Other sections
of the software come under two headings: (1) MAIN
and (2) INTRUPT.
The accompanying flowchart shows the MAIN
and INTRUPT programs. The MAIN program
operates when the processor is reset after first
powering up. It sets up the RB0 and RA4 ports as
inputs and the RB1-RB7 and RA0-RA3 ports as
outputs. It then reads the value stored in memory
for 12/24V mode and places it in a flag register.
After this, it looks for a pressed switch which is
used to change the 12/24V option.
If the switch is pressed, it toggles from the
current option to the other (ie, if the unit was in 12V
mode, it toggles to 24V mode and vice versa). The
new option is then written to memory for storage.
Interrupts are now allowed which starts the program skipping to the INTRUPT section when ever
the internal timer triggers an interrupt. We interrupt
via an internal timer which can be preloaded so
that the period between interrupts can be adjusted.
This feature is used to generate the pulse width
modulation output at RA3.
If we want the RA3 output to be low for a short
time, we load the timer with a value close to 255.
Then, when the counter increases and overflows
from 255 to 0, we have another interrupt.
The converse happens for a high output from
RA3. In this case, the timer is preloaded with a value
of 255 minus the value used for the RA3 low output
time. When the next interrupt occurs (ie, when the
count rolls over from 255 to 0 again), RA3 goes
low and the cycle start all over again.
The value that is loaded into the counter is
called LOW_TIME and is the same value as used
in the 8-bit register for the A-D conversion. This
A-D conversion is detailed in the circuit description
and its operational block is shown in the MAIN and
INTRUPT program flowchart.
The display is updated in the multiplex routine
when the total 255 counter period has expired. This
occurs on each second timer overflow interrupt.
The multiplexing lights the next display and switches off the previous one. The left digit is blanked if
the value for the display is below 10.0V.
After the A-D conversion, in the Main program,
the software tests the minimum hold switch. If it
is pressed, the LOW_1 value (ie, the lowest value)
is displayed.
If the switch is open, the REAL_V value, which
is the value arrived at during the A-D conversion,
is compared with the current LOW_1 value. If the
REAL_V value is the lower of the two, it replaces
the current LOW_1 value (ie, the LOW_1 value is
updated).
A check as to whether the 12V or 24V flag is set
determines whether or not the value for display is
multiplied by two, as required for the 24V setting.
Finally, the values are converted to decimal for
the display. The process then continues with another A-D conversion to measure the voltage again.
Full software for the Digital Voltmeter can be
obtained from our website and is called DVM.ASM.
This may be used by readers who are interested in
the programming details.
30 Silicon Chip
Specifications
Range: about 5.5-23.1V when
powered from a 12V battery; 1846.2V when powered from a 24V
battery.
Display Resolution: 100mV in
12V mode, 200mV in 24V mode.
Update time: 0.52s
The pin headers are installed on the copper side of the display board using a
fine-tipped soldering iron. These headers plug into matching sockets on the
processor board.
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 an adjacent PC pad to the right of
transistor Q2.
Finally, the three 7-way in-line
sockets can 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.
Display board
This view shows the completed module, with the two PC boards stacked
together in “piggyback” fashion. Make sure that none of the parts on the
processor board contact the back of the display board.
installed, followed by REG1. The
latter 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. Be sure to accurately align the
hole in the regulator’s metal tab with
its hole in the PC board.
The capacitors can go in next, mak-
ing sure that the electrolytic types
are all correctly oriented. Note that
the electrolytics must all be mounted
so that they lie parallel with the PC
board. In particular, the 22µF & 47µF
capacitors at bottom right lie across
the regulator leads, while the two
10µF capacitors lie across the adjacent
1.8kΩ and 10kΩ resistors.
Now for the display board: install
the seven wire links and the resistors
first, then install the three 7-segment
LED displays with their decimal
points at bottom right. Note that the
links all go under the displays, which
is why they’re shown dotted on Fig.2.
The 820Ω 1W resistors (shown in blue)
are required for the 24V version only.
The LDR is mounted so that its top
face is about 3mm above the displays.
Install it now (it can go in either way),
then install S1 with its flat side oriented as shown. Finally, complete the
display board assembly by installing
the pin headers. These are installed
from the copper side of the board,
with their pins protruding about 1mm
above the top surface.
You will need a fine-tipped iron
to solder these pin headers. You will
also have to slide the plastic spacers
along the pins to give sufficient room
for soldering.
Preparing the case
Fig.4: the two PC boards are secured together using spacers, a 2mmthick washer and several machine screws.
Work can now begin on the plastic case. First, use a sharp chisel to
remove the integral side pillars, then
slide the processor PC board into
place and use it as a template to drill
two mounting holes in the base – one
through the hole in REG1’s metal tab
and the other immediately below the
0.1µF capacitor on the far lefthand
FEBRUARY 2000 31
small dabs of super glue along the
inside edges.
Finally, a hole is also required
in the rear (base) of the case for the
power leads.
Testing
Fig.5: this full-size front panel artwork can be used as
a drilling template.
It’s a good idea to check the power
supply before plugging the microcontroller IC into its socket.
To check the supply, first unplug the
display board and put it to one side.
Now connect automotive hookup wire
to the +12V and GND (chassis) inputs
on 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 (you can use the
metal tab of REG1 for the negative
connection).
If this is correct, disconnect the
power and install IC1 in its socket,
ensuring that it is oriented correctly.
This done, plug the display board back
into the pin headers on the processor
board and reapply power. The LED
displays should light and show “L0”,
indicating that the input voltage is
below 1.9V (ie, not connected).
You can test the dimming feature
by holding your finger over the LDR.
Adjust VR2 until the display dims.
Calibration
Fig.6: check your boards carefully against these full
size PC artworks before installing any of the parts.
side. This done, use an oversize drill
to countersink these holes at the rear
of the case, to suit the specified M3 x
6mm CSK screws.
Next, plug the display board into
the processor board and secure them
together as shown in Fig.4. Check that
the leads from the parts on the display
PC board do not interfere with any
parts on the processor PC board. If
necessary, trim the leads of the parts
on the display board to avoid this.
The front panel artwork can now
be affixed to the panel and used as
32 Silicon Chip
a template for drilling the LDR and
switch holes and for making the display cutout. It’s best to drill a small
pilot hole for the switch first and then
carefully enlarge it to the correct size
using a tapered reamer.
The display cutout is made by first
drilling a series of small holes around
the inside perimeter, then knocking
out the centre piece and filing to a
smooth finish. Make the cutout so that
the red Perspex or Acrylic window is
a tight fit. This window can then be
further secured by applying several
The calibration procedure for both
versions is straightforward. Basically,
the procedure involves applying a
suitable input voltage and adjusting
trimpot VR1 until the reading on the
display matches the reading obtained
on a digital multimeter.
Let’s look at the 12V version first.
The step-by-step procedure is as
follows:
(1). Connect the “To Battery +ve”
terminal to the “+12V Via Ignition
Switch” terminal using a short length
of wire.
(2). Connect a 12V (approx.) supply
to the “+12V Via Ignition Switch”
terminal and ground.
(3). Compare the reading against a
digital multimeter and adjust VR1 for
the same reading. Note that the Digital
Voltmeter only updates about every
0.5 seconds, so adjust VR1 slowly
during this procedure.
If you don’t have a digital multimeter, connect the “To Battery +ve”
terminal to the output of REG1 and
adjust VR1 for a reading of 5.0V. This
should give a reasonably acc
urate
calibration, to within ±150mV.
Truscott’s
• RESELLER FOR MAJOR KIT
RETAILERS
• PROTOTYPING EQUIPMENT
• COMPLETE CB RADIO SUPPLY HOUSE
• TV ANTENNA ON SPECIAL
(DIGITAL READY)
• LARGE RANGE OF
ELECTRONIC COMPONENTS
Professional Mail Order Service
Truscott’s
The Perspex window should be a tight fit in the front panel cutout and can be
further secured by applying spots of super glue along the inside edges.
The calibration procedure for the
24V version is only slightly more
complicated. In this case, you have
to “switch” the unit to 24V mode first
before calibration can take place (the
12V mode is the default). The step-bystep procedure is:
(1). Connect the “To Battery +ve”
terminal to the “+24V Via Ignition
Switch” terminal.
(2). Press (and hold down) the Min/
Hold switch and apply 18-30V to the
Digital Voltmeter. The display will
show an “H” to indicate that the 24V
mode has been set. This setting will
now remain even if the supply is subsequently switched off and on again.
(3). Compare the Digital Voltmeter
reading against the reading obtained
on a digital multimeter and adjust
VR1 for the same reading. Be sure to
adjust VR1 very slowly – as before, the
Digital Voltmeter updates only about
twice every second.
Note also that the reading will only
show an even number after the decimal point (ie, it indicates in 200mV
steps). This means that a 24.1V supply
may show 24.0 or 24.2V but not 24.1V.
(4) If you don’t have a digital multimeter, connect the “To Battery +ve”
terminal to the output pin of REG1 and
adjust VR1 for a reading of 5.0V. Once
again, this should give a reasonably
accurate calibration.
By the way, if you want to revert to
the 12V mode, all you have to do is
again press the Min/Hold switch as
power is applied. The display will
now show an “L”, indicating that
the 12V setting mode has now been
selected.
ELECTRONIC WORLD Pty Ltd
ACN 069 935 397
Ph (03) 9723 3860
Installation
Be sure to use automotive cable and
connectors when installing the unit into
a vehicle. The +12V supply is derived
via the ignition switch and a suitable
connection can usually be made at 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 a
solder eyelet and a self-tapping screw.
The “To Battery +ve” input can also go
to the fused side of the ignition switch.
Alternatively, this connection can be
run directly to the positive terminal of
the battery via an in-line automotive
fuseholder (mount this fuseholder close
to the battery terminal). This reduces
the voltage drops across the wiring of
the ignition supply and gives a more
accurate reading of the battery voltage,
particularly when starting.
The only drawback with the direct
connection method is that there will
be a constant 1mA drain from the
battery. However, this current is so
low that it really shouldn’t cause any
problems, even if the battery is left
for extended periods without recharging.
Note: When using the voltmeter with
24V vehicles, the five 820Ω resistors
will become quite hot. To alleviate
this, we recommend replacing them
with 10 1.8kΩ 1W resistors. The five
added resistors can be installed on the
SC
underside of the PCB.
Amidon
Stockist
Fax (03) 9725 9443
27 The Mall, South Croydon, Vic 3136
(Melway Map 50 G7)
email: truscott<at>acepia.net.au
www.electronicworld.aus.as
P.C.B. Makers !
•
•
•
•
•
•
•
•
•
If you need:
P.C.B. High Speed Drill
P.C.B. Guillotine
P.C.B. Material – Negative or
Positive acting
Light Box – Single or Double
Sided – Large or Small
Etch Tank – Bubble or Circulating
– Large or Small
U.V. Sensitive film for Negatives
Electronic Components and
Equipment for
TAFEs, Colleges and Schools
FREE ADVICE ON ANY OF
OUR PRODUCTS FROM
DEDICATED PEOPLE WITH
HANDS-ON EXPERIENCE
Prompt and Economical Delivery
KALEX
40 Wallis Ave E. Ivanhoe 3079
Ph (03) 9497 3422
FAX (03) 9499 2381
• ALL MAJOR CREDIT
CARDS ACCEPTED
FEBRUARY 2000 33
|