This is only a preview of the July 2006 issue of Silicon Chip. You can view 38 of the 112 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. Articles in this series:
Articles in this series:
Items relevant to "Mini Theremin Mk.2; Pt.1":
Items relevant to "PC Controlled Mains Switch Mk.2":
Purchase a printed copy of this issue for $10.00. |
Easy-to-build
de s i g n h a s t w o
i n dep en den t l y
programmable
relay outputs
By GREG RADION
Low-Cost Analog
On-Off Controller
Have you ever wanted to control a device based on an
analog signal level? Perhaps you want to fill a water tank
automatically or control exhaust fans based on humidity or
temperature. Well now, you can – provided you have a sensor
that gives an analog voltage or current output.
T
his Analog On-Off Controller
unit switch
es two independent
relays based on the signal level at its
input. The “on” and “off” levels for
each relay are easily set using only a
screwdriver and you can monitor the
level of the signal on an LCD panel
meter if desired.
With its fully adjustable design,
the controller accepts inputs in the
range of 0-10V or 0-20mA. Its current
input capability also means that it
can be used with industrial sensors
40 Silicon Chip
that provide a 4-20mA current loop
interface.
Best of all, this unit can be put
together for about $65.00 and is very
easy to build. All the parts are mounted
on two PC boards which are stacked
together and connected using rainbow
cable.
How it works
The Analog On-Off Controller is
essentially a group of voltage comparators with additional circuitry to
translate input signals to a usable
voltage range, as well as flipflops to
hold the two outputs in their last “on”
or “off” state.
The complete circuit for the controller appears in Fig.1. Apart from op amp
IC1 and relays REL & REL2, the circuit
is powered via a 7805 +5V regulator
(VREG1). Diode D1 is included in
series with the 12V input to protect
against supply polarity reversal.
An LT1014 precision op amp (IC1c)
buffers the input signal. This op amp
siliconchip.com.au
siliconchip.com.au
July 2006 41
Fig.1: the input signal is buffered and normalised to a 0-1V level by an LT1014 quad precision op amp (IC1). The signal is then split into two channels, each
consisting of two LM339 voltage comparators with independently programmable rising and falling threshold levels. A pair of D type flipflops provides a setreset function to hold the last event and drive the business end – two high-current relays.
is connected as a differential amplifier
with unity gain, as determined by the
four 200kW resistors used in its input
and feedback networks.
Jumper JP6 is installed when the
controller is used with a current loop
type sensor, thus allowing current
to flow through the 62W resistor and
generate a voltage between the differential inputs.
The output from IC1c is fed into a
second op amp (IC1d), also configured
as a differential amplifier. In this case,
a 50kW trimpot (VR1) takes the place
of two resistors in the amplifier’s input
network, allowing it to be trimmed for
a gain of 0-2.
This is used to scale the input signal
to 1V full-scale ahead of the comparator network.
For example, when operating with
a 0-20mA input range, the gain would
be adjusted to produce 1V at the op
amp’s output with 20mA of loop current. For a 0-5V input range, the gain
would be adjusted to produce 1V out
with 5V in.
For a 4-20mA input range, the gain
would be adjusted to produce 1.25V
with 20mA in. An offset of 0.25V (adjustable with VR2) can be applied to
the inverting input via JP2 to subtract
from the signal on the non-inverting
input, thus producing 0-1V (representing 0-100% of scale) at the output.
A simple shunt regulator comprised
of a 3.3V zener diode (D2) and 5.6kW
resistor forms a stable reference for the
circuit. The regulator’s output feeds
two 20kW trimpots (VR2 & VR3), with
their wiper voltages buffered by two
unity-gain op amps (IC1a & IC1b).
VR3 is trimmed for 1V at the output
of IC1b (pin 7). Further, the reference
voltage for each comparator can be
adjusted within the 0-1V range using
trimpots VLO1, VHI1, VLO2 & VHI2.
The outputs of comparators IC2b
and IC2c will go high (near +5V) when
the voltage at their non-inverting in-
Fig.2: follow this parts layout diagram and the screened printing on the
PC board during assembly. Leave out the two LEDs (L1 & L2) and links
JP4 & JP5 if you’ve purchased the optional display panel!
Table 1: Resistor Colour Codes
o
o
o
o
o
o
o
o
No.
6
4
2
10
5
2
1
42 Silicon Chip
Value
10MW
200kW
100kW
10kW
5.6kW
2.2kW
62W
4-Band Code (1%)
brown black blue brown
red black yellow brown
brown black yellow brown
brown black orange brown
green blue red brown
red red red brown
blue red black brown
5-Band Code (1%)
brown black black green brown
red black black orange brown
brown black black orange brown
brown black black red brown
green blue black brown brown
red red black brown brown
blue red black gold brown
siliconchip.com.au
Par t s Lis t
1 double-sided PC board, 87 x
107mm
2 3-way 5.08mm 10A terminal
blocks
3 2-way 5.08mm 10A terminal
blocks
2 7A/240VAC relays with 12V
DC coils
1 12-way 2.54mm DIL header
strip (break in half for 2 x
6-way strips)
1 3-way 2.54mm SIL header
strip (JP1/JP2)
5 jumper shunts
3 14-pin IC sockets
1 50kW 10-turn trimpot (VR1)
2 20kW 10-turn trimpots (VR2,
VR3)
4 2kW trimpots (VHI1, VLO1,
VHI2, VLO2)
This is the fully assembled
controller board. Check the
text for the various linking
options.
puts is greater than that of the reference level on their inverting inputs.
Conversely, the outputs of IC2a and
IC2d will go high when the voltage
at their inverting inputs is less than
that of the reference level on their
non-inverting inputs.
A high value (10MW) resistor is
used to feed a small amount of each
comparator’s output signal back to its
input, eliminating oscillations near
the switching point.
Each comparator pair drives the
“set” and “reset” inputs of a D type
flipflop (IC3a & IC3b). A high from
the comparator connected to the set
input will cause the Q output to latch
high, biasing its associated transistor
into conduction and energising the
relay. Conversely, a high on the reset
input causes the Q output to go low,
switching off the relay.
As shown, the outputs of each
comparator pair can be steered to either flipflop input, depending on the
position of the A and B jumpers. This
allows each output to be switched
on or off on a rising or falling input
signal level.
Finally, the flipflops’ clock inputs
are connected to simple RC networks
so that a short positive-going pulse is
applied at power up. As the D inputs
are grounded, this ensures that the Q
outputs are reset (low) at startup and
that both relays are initially off.
calibrated to suit the intended application. All you need is a digital multimeter
and a voltage (or current) source set to
the maximum input signal level.
To begin, connect a 12V DC power
supply to the Vs and COM inputs.
Remember to disconnect power when
making jumper or link changes.
Calibration and setup
•
•
Before use, the controller must be
siliconchip.com.au
For 4-20mA operation:
•
•
•
•
•
•
•
Install a link at JP6.
Install a jumper in the JP1 position.
Supply 20mA to the inputs (IN+
& IN-).
Adjust VR1 to give 1.25V at TP1.
Move the jumper at JP1 to position JP2.
Adjust VR2 to give 1.00V at TP1.
Adjust VR3 to give 1.00V at TP6.
For 0-20mA operation:
•
•
•
•
•
Install a link at JP6.
Install a jumper in the JP1 position.
Supply 20mA to the inputs (IN+
& IN-).
Adjust VR1 to give 1.00V at TP1.
Adjust VR3 to give 1.00V at TP6.
For 0-5V (or 0-10V) operation:
•
•
•
Remove link at JP6.
Install a jumper in the JP1 position.
Supply 5.00V (or 10.00V for 0-10V
operation) to the inputs (IN+ &
IN-).
Adjust VR1 to give 1.00V at TP1.
Adjust VR3 to give 1.00V at TP6.
Semiconductors
1 7805 +5V regulator (VREG1)
1 LT1014 quad precision op amp
(IC1)
1 LM339 quad comparator (IC2)
1 4013 dual flipflop (IC3)
3 1N4004 silicon diodes (D1,D3,
D4)
1 1N4728 3.3V zener diode (D2)
2 BC548 transistors (Q1, Q2)
2 3mm red LEDs (L1, L2)
Capacitors
1 100mF 35V electrolytic
10 100nF 50V monolithic
ceramic
Resistors (0.25W, 1%)
6 10MW
5 5.6kW
4 200kW
2 2.2kW
2 100kW
1 62W
10 10kW
Parts For Optional Display Panel
1 PC board, 57 x 107mm
1 PM128E LCD panel meter
1 DPDT mini toggle switch
1 single pole 12-way rotary switch
1 knob to suit above
4 6mm M3 screws
4 20mm M3 screws
4 10mm M3 tapped spacers
4 25mm M3 tapped spacers
150mm length of 16-way ribbon
cable
Once calibration is complete, each
relay can be set to operate on either
a rising (jumper in position in “A”)
July 2006 43
actly the same manner using test pads
HI2 and LO2 and trimpots VHI2 and
VLO2, respectively.
Front panel add-on
This view shows the controller board wired to the optional front-panel display
board. The display board carries an LCD panel meter which makes it easy to
adjust the on/off trip levels without using a multimeter (see Fig.3 for the wiring
details).
or falling (jumper in position “B”)
input signal. The rising and falling
trigger levels can then be set for both
outputs.
To set the rising (high) level for the
first relay output, measure the voltage at the test pad labelled “HI1” and
adjust it using trimpot VHI1. A reading of 0.8V will mean that the relay
switches on at 80% of the maximum
input signal, while 0.6V equates to
60%, etc.
To set the falling (low) level for
the first relay output, measure the
voltage at the test pad labelled “LO1”
and adjust it using trimpot VLO1. A
reading of 0.2V will mean that the
relay switches off at 20%, while 0.3V
equates to 30%, etc.
The other output is adjusted in ex-
The Analog On-Off Controller can
be ordered with an optional LCD
front panel, allowing convenient adjustment and monitoring of the unit
without the use of a multimeter.
The front panel consists of an LCD
panel meter mounted on a small section of PC board alongside a 5-position
rotary switch and a toggle switch. Two
LEDs are also provided to indicate
relay activation. The panel mounts
above the main board on four 35mm
spacers.
Rotating the switch through its five
available positions shows the input
current/voltage level as a percentage
of the maximum, as well as the programmed on and off points of each of
the relays.
Setting of the four switching levels
is easily performed with the front
panel meter. Simply rotate the switch
through positions Hi1, Lo1, Hi2 and
Lo2 and adjust trimpots VHI1, VLO1,
VHI2 and VLO2 as described earlier.
Note that VR1, VR2 and VR3 are set
during initial calibration and must not
be altered here.
The “duty” switch on the front panel
swaps the on and off levels of Relay
1 with those of Relay 2. This is useful
when a “duty” and “standby” setup is
required, allowing the operation of two
devices to be periodically swapped to
ensure even wear.
Example application
The Analog On-Off Controller has a
large range of potential applications.
Let’s look at a couple that involve
water pumping.
For example, suppose two pumps
are to be used to fill a water tank. The
“duty” pump (connected to relay 1)
could be set to start when the level
drops below 40% and stop when it rises above 65%, whereas the “standby”
pump (connected to relay 2) could start
at 35% and stop at 70%.
Table 1: Application Examples
Operation
Relay 1
Relay 2
Two pumps
filling a tank
Duty pump
Standby pump
A (falling)
Two pumps
emptying a tank
Duty pump
Standby pump
B (rising)
44 Silicon Chip
Jumper Block 1 Jumper Block 2
Hi1
Lo1
Hi2
Lo2
B (falling)
65.0
40.0
70.0
35.0
A (rising)
60.0
50.0
70.0
55.0
siliconchip.com.au
Fig.3: here’s how to wire the display board to the controller. Leave enough wire length to allow the two boards to be
stacked together later. Note that several links (circled in red) must be placed on the LCD panel meter before use. In
four places, the pads can simply be shorted with blobs of solder. For the “P1” position, a short length of wire will be
required instead.
A similar example can be given for
emptying a tank. Suppose that the
“duty” pump starts at a level of 60%
and stops when the level falls below
50%, whereas the “standby” pump
starts when the level reaches 70% and
stops when it falls below 55%. Table 1
shows the settings required for these
two examples.
Extended operation
In some applications, more than
two devices must be controlled from a
single input signal. For example, you
may have a duty pump switching on at
80% and two standby pumps switching on at 85% and 90%.
This is easily accommodated by
installing a second controller and making a few minor changes. First, connect the “VOUT” terminals of the two
controllers together. The input signal
is then connected to the first controller
only, while link JP3 is removed from
the second controller.
Assembly
Before starting construction, note
that the two LEDs and links JP4 & JP5
siliconchip.com.au
must not be installed if you will be
fitting the optional display panel.
Using the overlay diagram in Fig.2
as your guide, begin by installing wire
links in place of jumpers JP3-JP6, noting that JP3 is only fitted when using a
current loop input. Next, install 3-way
header pins for jumpers JP1 & JP2 and
6-way headers for jumper blocks “1”
and “2”.
The resistors, capacitors, diodes
(D1-D4) and transistors (Q1 & Q2) can
all go in next. Note that resistor R6
(shown in red in Fig.2) is not required
– just leave this location empty.
Take care with the orientation of the
100mF electrolytic capacitor – be sure
to align its positive lead with the “+”
marking on the overlay. In addition,
the banded (cathode) ends of the diodes and the flat sides of the transistors
must be oriented as shown.
After this, solder in the trimpots
(VR1-VR3, VLO1, VHI1, VLO2 & VHI2),
LEDs (L1 & L2), voltage regulator
(VREG1) and IC sockets. Again, take
care to ensure that all these parts are
correctly orientated. Don’t plug in
Suggested Uses For The Controller
The Analog On-Off Controller could be used to:
• Operate one or two pumps based on the level in a tank or well.
• Operate pumps in a duty-standby arrangement.
• Regulate pressure using a compressor and a pressure sensor.
• Control a heating or cooling appliance using a temperature sensor.
• Regulate humidity using exhaust fans and a humidity sensor.
• Control chemical dosing, given an appropriate sensor.
• Almost anywhere that an analog signal level can be used to turn a
device on and off.
July 2006 45
The display board is wired to the
main controller board using short
lengths of rainbow cable. The two
boards are then stacked together
using spacers – see Fig.4.
Fig.4: the display panel board is
mounted above the main board
on four 35mm tapped spacers,
in turn assembled from shorter
25mm and 10mm items. Here’s
how it goes together.
the ICs until after you’ve checked the
power supply.
All that remains now are the terminal blocks and relays; install these
now and perform a final check of your
board before applying power.
Now connect a 12 DC source to the
Vs and COM terminals and measure
the voltage at the output of the regulator, accessible at pins 7 & 14 of IC3’s
socket. Obviously, the supply rail
should measure 5V (±5%). If all is well,
power off and insert the IC’s in their
sockets, noting that the notched (pin
1) ends must be oriented as shown.
Display panel
The optional display panel is as-
Where To Buy A Kit Of Parts
The Analog On Off Controller was developed by Ocean Controls, who
retain the design copyright. The controller is available as a kit of parts or
preassembled and tested. Prices at time of publication were:
Analog On-Off Controller kit: $59 +GST ($70 +GST assembled).
Analog On-Off Controller kit and Display Panel kit: $84 +GST ($99 assembled, $119 with IP65 box).
PM-128E Panel Meter (included with the Display Panel option): $20 +
GST.
Note that these prices do not include postage charges. Check out the Ocean
Controls website at www.oceancontrols.com.au for more information or
phone (03) 5983 1163 to order.
46 Silicon Chip
sembled next. The PC board provides
pads for just two 3mm red LEDs – so
install these first. The anode side of
the LEDs (indicated by the longer lead)
goes into the holes marked with a “+”
on the silkscreen. Leave about 5-10mm
of length when trimming the leads, so
that wires can be attached later.
Once the LEDs are in place, mount
the LCD panel meter, rotary switch
and toggle switch. Note that the rotary switch must be programmed for
5-position operation before mounting.
This is easily achieved by inserting the
tab of the ring in hole “5”, so that the
switch can only be rotated through the
first five positions.
Before use, five links must be installed on the LCD panel’s PC board,
as shown in Fig.3. Short links J1, J2,
DC and 2V with blobs of solder. A wire
link will be required to connect “P1”
to the “ON” side.
Short lengths of ribbon cable can
now be used to connect the two
boards together, as depicted in Fig.3.
That done, mount the display assembly above the main board using
tapped spacers and screws as shown
in Fig.4.
Your Analog On-Off Controller is
now ready for use. Remember, if you
are going to use it to switch 240VAC
mains voltages, the wiring must be
installed by a licensed electrician. SC
siliconchip.com.au
|