This is only a preview of the April 2002 issue of Silicon Chip. You can view 27 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 "Automatic Single-Channel Light Dimmer":
Items relevant to "Build A Water Level Indicator":
Items relevant to "Easy-To-Build Bench Power Supply":
Items relevant to "6-Channel IR Remote Volume Control, Pt.2":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
This simple circuit lights a string of LEDs
to quickly indicate the level in a rainwater
tank. It’s easy to build and can be powered
from an AC or DC plugpack supply.
By ALLAN MARCH
There are two traditional methods
for finding the level of water in a tank:
(1) tapping down the side of the tank
until the sound suddenly changes;
and (2) removing the tank cover and
dipping in a measuring stick. The
first method is notoriously unreliable,
while the second method can be awkward and time-consuming.
34 Silicon Chip
After all, who wants to clamber up
on top of a tank each time you want to
find out how much water is inside it?
That’s where this simple circuit
comes in. It uses five green LEDs arranged in a bargraph display to give a
clear indication of how the water supply is holding up. The more LEDs that
light, the higher the water in the tank.
A sixth red LED lights when the tank
level drops below a critical threshold.
There are no fancy microcontrollers
or digital displays used in this project. Instead, it uses just a handful of
common parts to keep the cost as low
as possible.
Circuit description
Fig.1 shows the circuit details. It’s
based on an LM3914 linear LED dot/
bar display driver (IC1) which drives
five green LEDs (LEDs 1-5). Pin 9 of the
LM3914 is tied high so that the display
is in bargraph mode and the height of
the green LED column indicates the
level of the water in the tank.
The full-scale range of the bargraph
depends on the voltage on pin 6. This
voltage can be varied using VR1 from
www.siliconchip.com.au
Fig.1: the circuit is based on an LM3914 dot/bar display driver (IC1) which
drives LEDs 1-5. Its output depends on the number of sensors covered by water
– the more covered, the higher the voltage on Q1’s collector and the greater the
voltage on pin 5 (SIG) of IC1. LED6 provides the critical level warning.
about 1.61V to 2.36V. After taking into
account the voltage across the 390Ω
resistor on pin 4, this gives a full-scale
range that can be varied (using VR1)
between about 1.1V (VR1 set to 0Ω)
and 2V (VR1 set to 470Ω).
By the way, if you’re wondering
where all the above voltag
es came
from, just remember that IC1 has an internal voltage reference that maintains
1.25V between pins 7 & 8. This lets
us calculate the current through VR1
and its series 1kΩ resistor and since
this same current also flows through
the series 1.5kΩ and 390Ω resistors,
we can calculate the voltages on pins
6 and 4.
As well as setting the full-scale
www.siliconchip.com.au
range of the bargraph, VR1 also adjusts the brightness of LEDs 1-5 over
a small range. However, this is only
a secondary effect – it’s the full-scale
range that’s important here.
IC1’s outputs directly drive LEDs
1-5 via 1kΩ current limiting resistors.
Note, however, that an LM3914 has 10
comparator outputs but we only need
five steps for this application. That’s
done by wiring the outputs of successive comparator pairs in parallel – ie,
pins 1 & 18 are wired together, as are
pins 17 & 16 and so on.
Water level sensor
The input signal for IC1 is provided by an assembly consisting of six
sensors located in the water tank and
connected to the indicator unit via
light-duty figure-8 cable. This sensor
assembly relies on the fact that there is
a fairly low (and constant) resistance
between a pair of electrodes in a tank
of water, regardless of the distance
between them.
As shown in Fig.1, sensor 1 is
connected to ground, while sensors
2-5 are connected in parallel to the
base of PNP transistor Q1 via resistors
R5-R1. Q1 functions as an inverting
buffer stage and its collector voltage
varies according to how many sensor
resistors are in-circuit (ie, how many
sensors are covered by water).
When the water level is below
sensor 2, resistors R5-R1 are out of
circuit and so Q1’s base is pulled
high by an 82kΩ resistor. As a result,
Q1 is off and no signal is applied to
April 2002 35
Fig.2: follow this diagram when installing the parts on the
PC board. Note that some parts have to be omitted for 12V
battery operation – see text.
IC1 (ie, LEDs 1-5 are off). However, if
the water covers sensor 2, the sensor
end of resistor R5 is essentially connected to ground. This resistor and
the 82kΩ resistor now form a voltage
divider and so about 9.6V is applied
to Q1’s base.
As a result, Q1’s emitter is now at
about 10.2V which means that 0.8mA
of current flows through the 2.2kΩ
emitter resistor. Because this same
current also flows through the two
1kΩ collector load resistors, we now
get about 0.8V DC applied to pin 5
(SIG) of IC1. This causes pins 1 & 18
of IC1 to switch low and so the first
green LED (LED5) in the bargraph
lights.
As each successive sensor is covered by water, additional resistors are
switched in parallel with R5 and Q1’s
base is pulled lower and lower. As a
result, Q1 turns on “harder” with each
step (ie, its collector current increases)
and so the signal voltage on pin 5 of
IC1 increases accordingly. IC1 thus
progressively switches more outputs
Fig.3: this is the full-size etching pattern for the PC
board. Check your board carefully before installing
any of the parts.
low to light additional LEDs.
Note that Q1 is necessary to provide
a reasonably low-im
pedance drive
into pin 5 (SIG) of IC1, while keeping
the current through the water sensors
below the level at which electrolysis
becomes a problem.
of IC2 is high and LED6 is off.
However, if the water level falls
below sensor 2, LED5 turns off and the
anode of LED5 “jumps” to +12V. This
voltage exceeds the upper threshold
voltage of IC2 and so pin 3 switches
low and LED6 turns on to give the
critical low-level warning.
Note that the control pin (pin 5) of
IC2 is tied to the positive supply rail
via a 1kΩ resistor. This causes IC2 to
switch at thresholds of 0.46Vcc (5.5V)
and 0.92Vcc (11V) instead of the usual
1/ Vcc and 2/ Vcc and is necessary to
3
3
ensure that IC2 switches correctly to
control LED6.
Power for the unit is derived from
a 12-18VAC plugpack supply. This
drives a bridge rectifier D1-D4 and its
output is then filtered using a 100µF
electrolytic capacitor and applied to a
12V 3-terminal regulator (REG1). The
output from REG1 is then filtered using
a 10µF electrolytic capacitor and used
to power the circuitry.
Note that a regulated supply rail
is necessary to ensure that the water
Critical level indication
IC2 is a 555 timer IC and it drives
LED6 (red) to provide a warning when
the water level falls below the lowest
sensing point; ie, when all the green
LEDs are extinguished. However, in
this role, IC2 isn’t used as a timer. Instead, it’s wired as a threshold detector
and simply switches its output at pin
3 high or low in response to a signal
on its threshold and trigger inputs
(pins 6 & 2).
It works like this: normally, when
there is water in the tank, LED5 is
on and its anode is at about 2V. This
“low” voltage pulls pins 6 & 2 of IC2
low via a 100kΩ resistor, so that these
two pins sit below the lower threshold
voltage. As a result, the pin 3 output
Table 1: Resistor Colour Codes
No.
1
1
1
1
1
1
1
2
1
9
1
36 Silicon Chip
Value
820kΩ
680kΩ
560kΩ
330kΩ
220kΩ
100kΩ
82kΩ
2.2kΩ
1.5kΩ
1kΩ
390Ω
4-Band Code (1%)
grey red yellow brown
blue grey yellow brown
green blue yellow brown
orange orange yellow brown
red red yellow brown
brown black yellow brown
grey red orange brown
red red red brown
brown green red brown
brown black red brown
orange white brown brown
5-Band Code (1%)
grey red black orange brown
blue grey black orange brown
green blue black orange brown
orange orange black orange brow
red red black orange brown
brown black black orange brow
grey red black red brown
red red black brown brown
brown green black brown brown
brown black black brown brown
orange white black black brown
www.siliconchip.com.au
level indication doesn’t change due to
supply variations.
Construction
Construction is straightforward,
with all the parts installed on a PC
board coded 05104021 and measuring 80 x 50mm. This is installed in a
standard plastic case, with the LEDs
all protruding through the lid.
Fig.2 shows the parts layout on
the PC board. Begin the assembly by
installing the resistors, diodes and
capacitors, then install the ICs, transistor Q1 and the 3-terminal regulator
(REG1). Make sure that the diodes and
ICs are installed the right way around.
The same applies to the electrolytic
capacitors – be sure to install each
one with its positive lead oriented as
shown on Fig.2.
Trimpot VR1 can now be installed,
followed by the RCA socket and the
2.5mm power socket. The two sockets are both PC-mounting types and
mount directly on the board.
The LEDs are fitted last and must
be installed so that the top of each
LED is 33mm above the PC board.
This ensures that the LEDs all just
protrude through the lid when the
board is mounted in the case on 10mm
spacers. Make sure that all LEDs are
correctly oriented – the anode lead is
the longer of the two.
The power socket and RCA connector are both mounted directly on the PC
board. Make sure that all parts are correctly oriented and that they are in the
correct locations.
Dot operation
You can easily convert the LM3914
(IC1) from bar to dot operation if that’s
what you prefer. All you have to do is
cut the thinned section of track immediately to the left of the 0.1µF capacitor
and install a wire link between the two
vacant holes at the top of the board
near IC1. Alternatively, the link can be
omitted (ie, pin 9 can be either pulled
low or left open circuit).
Battery operation
If the unit is intended for 12V battery
operation in a mobile home or caravan,
regulator REG1 and diodes D2, D3 &
D4 are omitted. Both D4 and REG1
are then replaced by wire links – ie,
install a link instead of D4 and install
a link between the IN & OUT terminals
of REG1.
D1 remains in circuit to protect
against reverse battery connection.
Metal tanks
If the tank is of made of metal, you
can dispense with Sensor 1 and conwww.siliconchip.com.au
The PC board in secured to the bottom of the case using two 10mm standoffs at
one end, while the RCA socket provides the support at the other end.
nect the tank directly to the circuit
ground. You must also ensure sensors
2-6 do not touch the walls of the tank.
This can be done by slipping a length
of 25mm-OD clear PVC tubing over the
completed probe, securing it at the top
so that the water inside can follow the
level in the tank.
Final assembly
The PC board is mounted in the bottom of the case on two 10mm standoffs
and is secured using 3mm machine
screws, nuts and washers. Note that
the corners at one end of the PC board
must be removed to clear the pillars
inside the case.
You will have to remove these corners yourself using a small hacksaw
and rat-tile file if this hasn’t already
been done.
Fig.6 shows the locations of the two
board mounting holes in the bottom
of the case. You will also have to drill
two holes in one end of the case, so
that they line up with the RCA socket
and the power socket when the board
is installed (see Fig.6).
The front-panel artwork (Fig.5) can
be used as a template for drilling the
front panel. There are six holes to be
drilled here – one for each LED – and
these are all 5mm-dia. It’s a good idea
to countersink these holes from the
underside of the lid using a 6mm
drill, so that the LEDs slip easily into
position when the lid is fitted.
Sensor assembly
The sensor assembly is made by
threading six lengths of 1mm enamelled copper wire through 8mm OD
April 2002 37
Fig.4: the water level sensor is made by threading six lengths of 1mm enamelled copper wire through
8mm OD clear PVC tubing (see text). The six sensors should be evenly spaced down the tube.
clear PVC tubing – see Fig.4. This
tubing should be long enough to reach
the bottom of the tank, with sufficient
left over to fasten the top end securely. The reason for using 1mm wire is
primarily to make it easy to thread it
through the plastic tube.
Parts List
1 PC board, code 05104021, 80
x 50mm
1 plastic case, 130 x 67 x 44mm
1 PC-mount RCA socket
1 RCA plug
1 2.5mm PC-mount power socket
1 12V AC 500mA plugpack
1 100gm spool 1.0mm enamelled
copper wire
1 length 8mm-OD clear PVC
tubing to match height of tank
plus 200mm
2 3mm x 20mm screws and nuts
2 10mm spacers
The top sensor (S6) is placed about
100-150mm below the overflow outlet
at the top of the tank, while the other
sensors are spaced evenly down the
tube.
Begin by using a 1.0mm drill to
drill holes through the tube wall at the
appropriate points, including a hole
for the bottom sensor (S1) to hold it
in place securely. That done, you can
thread the wires through by pushing
them through the drilled holes and
then up the tube. You will find that
the wire goes in more easily if the
PVC tube is bent at an angle so that
the drilled hole is in line with the bore
of the tube.
The end of each wire should also be
smoothed before pushing it into the
tube, to avoid scratching the enamel
of the wires already in the tube. Leave
about 150mm of wire on the outside
of the tube at each point.
It’s a good idea to trim each successive wire so that it protrudes 20mm
further out of the top of the tube than
its predecessor. This will allow you
to later identify the individual wires
when attaching the resistors.
When all six wires have been installed, the next step is to solder the
wire for S1 to the “earthy” side of the
figure-8 lead, cover it with insulating
sleeving and pull the covered joint
down about 50mm into the 8mm
tube. This done, the resistors can be
soldered to their appropriate wires.
Push about 15mm of 2.5mm sleeving over each wire before attaching
its resistor. This sleeving should
then pulled up over the joint and the
bottom end of each resistor after it is
soldered. Once all the resistors have
been soldered, the wires should be
pulled down so that the joints are
just inside the 8mm tube, as shown
in the photo.
When this process is complete,
there will be five resistors protruding
from the top of the 8mm tube. Their
Semiconductors
1 LM3914 linear dot/bar driver
(IC1)
1 NE555 timer (IC2)
1 BC558 PNP transistor (Q1)
1 78L12 12V regulator (REG1)
4 1N4004 diodes (D1-D4)
5 5mm green LEDs (LEDs1-5)
1 5mm red LED (LED6)
Capacitors
1 100µF 35VW PC electrolytic
1 47µF 16VW PC electrolytic
1 10µF 16VW PC electrolytic
1 0.1µF greencap
Resistors (0.25W, 1%)
1 820kΩ
1 82kΩ
1 680kΩ
2 2.2kΩ
1 560kΩ
1 1.5kΩ
1 330kΩ
9 1kΩ
1 220kΩ
1 390Ω
1 100kΩ
1 470Ω trimpot
Miscellaneous
Light-duty figure-8 cable, 2.5mm
PVC sleeving, heatshrink tubing.
38 Silicon Chip
This is the author’s completed water level sensor. A weight can be attached to
the bottom end to keep the plastic tube straight when it is immersed in the tank.
www.siliconchip.com.au
Fig.5: this full-size artwork can be used as a drilling template for the
front panel.
Improved Water-Level Sensor
For a long-life water level sensor,
Bob Barnes of RCS Radio suggests that the probe be made out
of 19mm plastic conduit fitted with
stainless-steel radiator or fuel pump
hose-clamps for the sensors.
Suitably sleeved nichrome or
stainless steel wire (“up the spout”)
can then be used to make the connections between the clamps and
the resistors.
You will need to use Multicore
Arax cored solder or Litton Arax
cored solder (available from Mitre-10) when soldering nichrome
or stainless steel wire (ie, a corrosive flux is needed). You can buy
ni
chrome wire from Dick Smith
Electronics or from Jaycar, while
stainless steel wire should be available from boating suppliers.
remaining leads are then twisted together, soldered to the other side of
the figure-8 cable and covered with
heatshrink tubing. The other end of
the figure-8 cable is fitted with an
RCA plug, with the resistor lead going to the centre pin and the sensor
1 lead going to the earth side of the
connector.
The next step is to scrape away the
enamel from the 150mm wire lengths
at each sensor point and wind them
firmly around the outside of the tube.
A 30mm length of 12.5mm copper
water pipe can be pushed over sensor 1
to add weight and increase the surface
area if desired.
Note: on no account should solder
be used on the submersible part bewww.siliconchip.com.au
The top of the water level
sensor can be secured to the
tank using a suitable bracket.
cause corrosion will result from
galvanic action.
Finally, the end of the plastic
tube and the holes can be sealed
with neutral-cure silicone sealant. However, don’t get any
silicone sealant on the coiled
sensor wires, as this will reduce
the contact area (and perhaps
render them ineffective).
Switching on
Fig.6: this diagram shows the drilling
details for the plastic case.
Now for the big test. Apply
power to the unit and check that the
red LED comes on and that there is
+12V on pin 3 of IC1. If all is well, the
unit can now be tested by connecting
the sensor assembly and progressively
immersing it (starting with sensor 1) in
a plastic dish that’s full of water. When
sensor 1 and sensor 2 are immersed,
LED6 should extinguish and LED5
should come on.
Similarly, when sensors 1, 2 & 3
are immersed, LEDs 5 & 4 should be
on and so on until all five green LEDs
are lit.
Finally, trimpot VR1 must be set so
that the appropriate LEDs light as the
sensors are progressively immersed
in water. In practice, you should find
the two extremes of the pot range over
which the circuit functions correctly,
then set the pot midway between these
SC
two settings.
April 2002 39
|