This is only a preview of the April 1999 issue of Silicon Chip. You can view 34 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Articles in this series:
Items relevant to "High-Power Electric Fence Controller":
Items relevant to "Programmable Thermostat/Thermometer":
Articles in this series:
Items relevant to "A Rev Limiter For Cars":
Purchase a printed copy of this issue for $10.00. |
This new electric fence circuit has
considerably higher output than our
previous economy design and is
suitable for much longer fence runs.
It is essentially a capacitor discharge
design and uses a DC-DC inverter with
high energy output.
New High Power
ELECTRIC FENCE
E
LECTRIC FENCES are widely
used on farms to control livestock. They can be set up quickly, are easily moved from place to
place and they’re much cheaper than
permanent fencing.
This new electric fence controller
is suitable for fence runs up to about
5km long.
We have mounted the controller in
a section of 90mm plastic storm-water
pipe fitted with standard end caps.
This means it can be made water-proof
and it can be attached to a fence post
using standard 90mm fittings.
Our previous design was based on a
standard 12V ignition coil. While this
was a cheap approach it did not have
the output for longer fences and was
less effective against larger livestock
such horses and cattle.
This new design has substantially
higher energy storage and should be
adequate for fence runs up to 5km
long. It is designed to comply with
the relevant Australian Standard AS/
NZS 3129.
on again just after the dump capacitor
has been discharged.
Now let’s have a look at the full
circuit which is shown in Fig.2.
Block diagram
The DC-DC converter comprises
a 7555 timer (IC1), Mosfet Q1 and
transformer T1 plus diodes D1 and D2.
IC1 is connected to oscillate at around
20kHz, as set by the .0039µF capacitor
at pins 2 & 6 and the associated 4.7kΩ
and 6.8kΩ resistors.
The 20kHz pulses from pin 3 are
used to drive Mosfet Q1 and this drives
transformer T1 which steps up the
voltage and drives a half-wave rectifier
consisting of two fast recovery diodes,
D1 & D2, connected in series. They
are connected in series because their
500V rating is insufficient to allow one
diode to be used by itself.
The block diagram for the electric
fence controller is shown in Fig.1.
This comprises a 12V battery supply
which is stepped up to 340VDC using
a DC-DC converter. This charges a 7µF
dump capacitor.
The charge in this capacitor is
“dumped” through the step-up transformer once every second or so using
a discharge circuit involving a Triac
and pulse timer.
The pulse timer controls both the
DC-DC converter and the Triac. It
switches off the converter each time
it fires the Triac and then switches it
Circuit description
Design by JOHN CLARKE
24 Silicon Chip
FEATURES
*Up to 5km multiwire fence length
*Controls cattle, horses, sheep and pigs
*Operates from a 12V battery
*Efficient circuit uses minimum power
*EMI suppressed output
E CONTROLLER
Fig. 1: you’ll find it easy to follow the circuit
description in the text if you refer to this block
diagram and the circuit diagram overleaf.
The half-wave rectifier charges the
7µF 250VAC dump capacitor via the
two 220Ω resistors and the primary
winding of transformer T2.
The voltage stored in the dump
capacitor is monitored by the error
amplifier IC2a. The voltage is reduced
by the voltage divider consisting of two
1.5MΩ resistors and the 10kΩ resistor
and this feeds pin 2 of IC2a.
The non-inverting input of IC2a, pin
3, is connected to trimpot VR1 which
taps off the reference voltage from the
4.7V zener diode, ZD1.
The gain of IC2a is set at 28 by
the 10kΩ resistor at pin 2 and the
270kΩ resistor between pins 1 & 2.
The .0047µF capacitor provides high
frequency rolloff above 125Hz.
Modulating the 7555
The error amplifier works in an
unusual way to control the DC voltage
across the dump capacitor at about
April 1999 25
Fig. 2: the circuit diagram shows just how simple the electric fence controller is. Beware the components on the
secondary side of T1: they bite!
340V DC. IC2a compares the voltage at
its pin 2 with the preset voltage from
VR1 and if it is higher, the output at
pin 1 goes lower, pulling pin 5 of IC1
low via diode D4.
Pin 5 is used to shift the upper and
lower thresholds of the 7555 and thus
changes the output frequency. When
pin 5 is pulled lower, it reduces the
time for the .0039µF capacitor at pins
2 & 6 to charge and discharge and this
increases the frequency.
More importantly, when pin 5 is
pulled lower it reduces the pulse
width fed to the gate of Q1 and so the
drive to transformer T1 is also reduced
and this lowers the output voltage.
Pulse timer
The pulse timer is a 1.5Hz Schmitt
trigger oscillator based on amp IC2b.
The 10µF capacitor at pin 6 is charged
via diode D2 and the 100kΩ resistor
connecting to pin 7 and the 150kΩ
resistor from pin 6 to 7.
When IC2b’s output goes high, two
things happen. Number one is that
26 Silicon Chip
transistor Q2 is turned on to pull pin
4 of IC1 low. This stops IC1 from oscillating and so the DC-DC converter
is disabled.
Number two is that Q3, connected
as an emitter follower, delivers a positive pulse to the gate of the Triac via
the 2.2µF capacitor. This switches on
the Triac which dumps the charge of
the 7µF capacitor through the primary
winding of transformer T2.
This results in a high voltage pulse
from the transformer’s secondary
winding, enough to repel any beastie
which might be nuzzling up to the
fence.
Inductor L1 is connected in series
with the transformer primary and this
controls the rise time of the pulse current from the dump capacitor.
Without the inductor, the very rapid
turn-on time of the Triac would mean
that a burst of radio interference would
be radiated by the electric fence every
time it fired.
When you consider how long the
antenna (ie, the fence) could be, it was
essential that we remove this potential
interference.
The actual energy dumped into
transformer T2 is given by the formula
E = 1/2CV2
With a dump capacitor of 7µF and a
DC voltage of 340V, the stored energy
equates to 0.4 Joules. Combined with
the transformer’s peak output of close
to 3.6kV, that’s enough to give quite a
belt to any animal.
Scope waveforms
We have included a number of oscilloscope waveforms in this article to
illustrate the circuit operation.
Fig.3 shows how IC1 is turned on
and off by the pulse timer. The top
trace shows the gated oscillation from
pin 3 of IC1 while the bottom trace is
the pulse waveform fed to pin 4. Each
time the pulse is high, the oscillator
output is disabled.
Note that the top trace waveform
shows severe quantising error and
looks random because the 20kHz
oscillation is much too fast for the
scope’s sampling rate which is set by the very low timebase sweep speed of 250ms per division (ie, one sweep
takes 2.5 seconds).
Fig.4 shows the charging and discharging of the dump
capacitor every 1.5 seconds. The top trace is the waveform across the dump capacitor and as you can see, this
builds up to 340V and then is abruptly dropped to zero.
Each time it is to discharged to zero corresponds with
the positive-going pulse on the bottom trace. This is the
waveform at the emitter of Q3 which is used to trigger
the Triac.
Fig.5 shows the high voltage waveform delivered by the
secondary winding of transformer T2. It was measured via
a 100:1 voltage divider and so the peak voltage is 3.6kV.
Fig.6 shows the operation of the DC-DC inverter transformer, T1. The top trace shows the waveform at the
drain of Mosfet Q1 while the bottom trace is the driving
WARNING
Be aware that this circuit produces high voltages
and that a large amount of energy is stored in the
dump capacitor. If you are not careful you could
receive a nasty electric shock. Do not touch the PC
board while the circuit is operating. You could get
a shock from the dump capacitor, from diodes D1 &
D2, the 1.5MΩ & 220Ω resistors, transformer T2 and
inductor L1, as well as the Triac; all are charged to
the 340V potential.
Naturally, the secondary winding of transformer
(T2) can also give you a belt – that's the idea – but it
is not as dangerous as the 340V side of the circuit.
Fig.3: how IC1 is turned on and off by the
pulse timer. The top trace shows the gated
oscillation from pin 3 of IC1 while the bottom
trace is the pulse waveform fed to pin 4.
Fig.5: the high voltage waveform delivered
by the secondary winding of transformer T2.
It was measured via a 100:1 voltage divider
so the peak voltage is 3.6kV.
Fig.4: the charging and discharging of the
dump capacitor every 1.5 seconds. The top trace
is the waveform across the dump capacitor and
as you can see, this builds up to 340V and then is
abruptly dropped to zero. Each time it is
discharged to zero corresponds with the
positive-going pulse on the bottom trace.
Fig.6: the operation of the DC-DC inverter
transformer, T1. The top trace shows the waveform
at the drain of Mosfet Q1 while the bottom trace is
the driving waveform from pin 3 of IC1, the 7555.
April 1999 27
Fig 7: construction should be relatively straightforward if you follow this PC board component overlay.
Just be careful when placing polarised components and remember many exposed components have 340V
DC on them! The output pads labelled A&B are for the temporary installation of a spark gap during testing – see text.
28 Silicon Chip
waveform from pin 3 of IC1, the 7555.
Note that the frequency of the bottom trace is 23kHz (nominally 20kHz)
and it is essentially a clean pulse waveform. However the top trace shows
evidence of ringing at a much higher
frequency. What is happening?
The clue is the peak voltage of the
waveform: 124V.
What is happening is that each time
the waveform at pin 3 of IC1 goes
positive, Mosfet Q1 turns on and feeds
current through the primary winding
of transformer T1. About 20µs later
it turns off abruptly and this causes
a high voltage (ie, 124V) to appear
across the secondary and as shown
in the scope trace, it also causes the
winding to “ring”.
The primary voltage is then stepped
by the transformer turns ratio of 3:1 to
around 370V although ultimately, the
voltage stored in the dump capacitor
is set at 340V DC by trimpot VR1 and
the error amplifier IC2a.
Construction
Our new Electric Fence Controller
is built onto a PC board measuring
189 x 77mm and coded 11303991. It
is housed in a 250mm length of 90mm
diameter stormwater tube with caps
fitted to seal off the ends. The component overlay diagram for the PC board
is shown in Fig.7.
You can begin construction by
checking the PC board for any shorts
or breaks in the tracks. Also check that
the hole sizes for the fuseholder clips,
transformers and cable ties for the 7µF
capacitor are drilled sufficiently large
for these components.
Install the single link and then the
resistors. You can use the colour codes
in Table 1 when selecting the resistors
for each position. Alternatively, you
can use a digital multimeter to check
each resistor value before it is inserted
in the PC board. Insert and solder in
Fig. 8: winding details for transformer
T1. This one is the simpler of the two
but take care with the starts and
finishes and direction of winding.
the PC stakes and the
diodes, including zener
diode ZD1.
The capacitors can
be mounted next, with
the exception of the 7µF
250VAC dump capacitor.
Note that the electrolytic
capacitors must be oriented with the correct
polarity.
Be sure to orient the
two ICs correctly when
installing them and also
be careful to put each one
in the correct position.
Since they are both
8-pin ICs it is quite easy
to put them in the wrong
Fig. 9: winding details for
position – they don’t
transformer T2. It's important to
work if you do that!
insulate the secondary properly
Then insert the two
to avoid flashover from the high
transistors, Mosfet and
voltage. The primary is wound
Triac and trimpot VR1.
on last – over the secondary
The fuse clips can be
winding and insulation. ENCU
installed and are best
is an abbreviation for
enamelled copper wire.
mounted with the fuse
clipped in place before
soldering. Otherwise you
might solder the clips in
back-to-front and their lugs will stop dump capacitor may be 6.5µF or 7µF
250VAC.
you putting the fuse in.
The 7µF capacitor is mounted and
Winding the transformers
held in place with two cable ties
Transformer T1 is wound using
wrapped around its body and through
the PC board. Attach the two wires 0.4mm enamelled copper wire. Fig.8
to the terminals on the PC board as shows the winding details.
Start by locating pin 1 on the coil
shown.
By the way, depending on where former. If the former is not marked,
you buy your kit or the parts, the label pin 1 yourself, as shown on Fig.7.
Now strip the enamel insulation off
the end of the 0.4mm wire and solder
the wire onto pin 1. Wind on 25 turns
in the direction shown and terminate
the end on pin 10, after stripping off
the enamel insulation.
Insulate the winding with a layer
of electrical tape before starting on
the secondary.
Now wind on 75 turns, starting
This view of the completed PC board is not far off full size, so your board should look very similar! Note the missing cable
tie around the 7µF capacitor – this was removed and an additional hole drilled (top left) to allow mounting in an
alternative case. For stability the second cable tie should be used, even if this means drilling new holes in the PC board.
April 1999 29
Parts List
1 PC board, code 11303991,189 x 77mm
1 label, 125 x 50mm (Electric Fence Controller)
1 label, 85mm diameter (Fence Terminals)
1 label, 85mm diameter (Input Voltage)
1 250mm length of 90mm diam. PVC stormwater pipe
2 90mm diameter end caps
2 E30 transformer assemblies (bobbin, two cores and
clips) (T1,T2) (see text for winding details)
1 iron powdered toroidal core 14.8mm OD x 8mm ID x
6.35mm, Jaycar LO-1242, Neosid 17-732-22 core or
equivalent (L1)
2 280 x 5mm cable ties
6 PC stakes
2 3AG PC board fuse clips
1 2A 3AG fuse
1 red banana socket
1 green banana socket
1 red battery clip
1 black battery clip
1 cord-grip grommet
1 2m length of figure-8 medium duty wire
1 100mm length of brown 250VAC insulated wire
1 300mm length of blue 250VAC insulated wire
1 8m length of 0.4mm enamelled copper wire
1 15m length of 0.25mm enamelled copper wire
Semiconductors
1 7555, LMC555CN CMOS timer (IC1)
1 LM358 dual op amp (IC2)
1 IRF820 500V 3A or P6N60E 600V 6A Mosfet (Q1)
1 BTA10-600 Triac (Triac1)
2 BC337 NPN transistors (Q1,Q2)
2 1N4936 500V 1A fast diodes (D1,D2)
1 4.7V 1W zener diode (ZD1)
2 1N914, 1N4148 switching diodes (D3,D4)
Capacitors
1 470µF 16VW PC electrolytic
3 10µF PC electrolytic
1 6.5µF or 7µF 250VAC
1 2.2µF 16VW PC electrolytic
2 0.1µF MKT polyester
1 .0047µF MKT polyester
1 .0039µF MKT polyester
Resistors (0.25W, 1%)
2 1.5MΩ
1 270kΩ
4 100kΩ
5 10kΩ
1 4.7kΩ
1 2.2kΩ
1 390Ω
2 220Ω
1 47Ω
1 150kΩ
1 6.8kΩ
1 1kΩ
1 100Ω
Miscellaneous
1 12V 2.4Ah or larger battery; 2 clamps for 90mm
conduit; 1-3 2m long galvanised ground stakes; selfinsulated timber posts or steel posts and insulators;
fence tape, etc.
30 Silicon Chip
at pin 5 and finishing at pin 6. Be sure to follow the
winding directions as shown. Finish off with another
layer of electrical tape.
The transformer is assembled by sliding the two cores
into the former and holding them together with a cable
tie or clamp.
Transformer T2 is wound using 0.25mm enamelled
copper wire for the secondary and 0.4mm enamelled
copper wire for the primary. Fig.9 shows the details.
First, identify or mark pin 1. The secondary winding
is wound first and the start is insulated with a 50mm
length of sleeving which is held onto the bobbin with
electrical tape.
This end of the wire is not connected to the transformer pins because it is the high tension end and it would
arc between pins otherwise.
You will need to file down the cheek section of the
transformer to allow the insulating tubing to sit flat on
the inside winding area of the bobbin.
Fix the insulation tubing in place as shown with
insulation tape. Wind on about 10-turns neatly side by
side to complete the filling of the first layer. Cover it in
a layer of insulation tape.
Always make sure that the wire passes out from the
insulation as shown and with a 2mm clearance between
winding and the cheeks of the former.
Continue winding on another nine layers, with about
27 turns per layer and with insulation tape between
each layer. Terminate the finish of the winding at pin 6.
We must emphasise that the insulation and placement
of the winding in the 10 layers is most important, otherwise the transformer will suffer from flashover and
ultimately, it won’t work. Each layer must be insulated
with a layer of electrical tape and be sure to start and
end the tape at the top section of the bobbin rather than
at the sides. The reason for this is to improve clearance
between the windings and the ferrite cores which are
slid in place after the windings are completed.
Note also that the wire must not be started or finished
beyond a 2mm clearance gap at each end of the winding
area in the former.
By comparison with the high voltage secondary, the
primary winding is easy. Wind on 7 turns of 0.4mm
enamelled copper wire between pins 5 and 10, as shown.
Then slide the cores into the former and secure them
with a cable tie or clips.
Insert and solder the transformers in place, making
sure that they are oriented with pin 1 as shown on the
diagram of Fig.7.
Inductor L1 is wound using 6 turns of 0.4mm enamelled copper wire and these are terminated as shown on
the PC board. You can secure the toroid in place with a
cable tie or with a 3mm screw, nut and plastic washer
or a small rubber grommet.
Note: the transformer bobbins for T1 & T2 may differ
from those used in our prototype. The difference will be
that the five rows of pins on each bobbin may be spaced
wider than allowed for on the printed circuit board. You
can either bend the pins on the bobbin inward so that
they will fit into the original holes or new holes can be
drilled at the wider spacing. The larger bobbins mean
that the transformers will be easier to wind and there
will be more room to insert the ferrite cores. A revised PC
board has been produced to provide
for both bobbin types.
Warning
Before applying power and commencing to test the unit, please heed
the warning earlier in this article.
Contrary to what you might think, the
primary side of the output transformer
is in fact more dangerous than the high
voltage secondary.
Of course, we would prefer not to
get across either!
Testing
Having warned you about the high
voltages, we can talk about testing
the circuit.
The first step is to wind trimpot VR1
fully anticlockwise. Then apply 12V
to the circuit and check that there is
12V between pins 1 and 8 of IC1 and
between pins 4 and 8 of IC2.
Switch off power. Temporarily tie
pin 6 of IC2b to pin 8 with a 10kΩ resistor. This disables the pulse timer and
means that IC1 operates continuously.
Connect a multimeter between
ground and the cathode of diode D2
with the meter set to read 400V DC or
more. Now switch on the power and
adjust VR1 slowly until the meter
reads 340V. Switch off and wait for
the voltage across the dump capacitor
to discharge to below 12V.
Disconnect the 10kΩ resistor between pins 6 & 8 of IC2. We are now
almost ready for the high voltage check
This photo shows the completed electric fence controller immediately before
final assembly inside its 90mm PVC stormwater pipe "case".
and this should be a mere formality if
you have been successful to this point.
and you should get a healthy spark
every 1.5 seconds.
High voltage check
Final assembly
Don’t reapply the power just yet.
Instead connect a piece of tinned
copper wire between the high voltage
terminals on the PC board, ie, between
terminals A & B.
Then cut the wire with your side
cutters and bend the cut wires slightly apart so that you have a spark gap
about 5mm wide.
Now apply 12V to the circuit again
While we built our prototype Electric Fence Controller into a length
of 90mm plastic stormwater pipe,
an alternative approach would be to
house the PC board in a sealed plastic
weatherproof box such as one sold by
Dick Smith Electronics with catalog
number H-2865. Measuring 146 x
222 x 55mm, this box has plenty of
room for the PC board and the lid is
The two end caps in position, complete with labels. If used out in the open (ie without covering) it would be a good idea to
apply some silicone sealant inside the cap to waterproof the terminals and (especially) the power cable hole.
April 1999 31
Finally, the completed controller. The caps are a push fit on the 90mm PVC pipe and are quite watertight. The label at the
battery end states red and black for +12V and 0V: this of course refers to the colour of the battery clips, not the wire!
Incidentally, if you don't like the pretty pink pipe and groovy grey caps, they're also available in boring old white.
fitted with neoprene gasket to ensure
a water-tight seal.
We understand that this box will be
included in the Dick Smith Electronics
Fig.10: here's how
a typical electric
fence installation
goes together. Note
that for safety
reasons, electric
fences are always
powered by battery.
Battery charging
should always be
done “off line”.
32 Silicon Chip
kit for this project.
We have designed a number of
labels for the Controller. As with the
PC board pattern, they can be down-
loaded from the SILICON CHIP website,
www.siliconchip.com.au
The first measures 125 x 50mm
and has the words “Electric Fence
Controller”. This can be glued to
the pipe itself, as shown in our
photos. There are also two 85mm
diameter labels, one of which
fits inside each end cap. One is
labelled “Fence Terminals” and
the other is “Input Voltage”.
When these are fitted to the
end caps, you can drill the two
holes for the fence terminals and
cut out the hole for the cord grip
grommet in the other end cap.
Attach the terminals and connect
and solder the earth lead and the
high tension lead.
Solder a length of figure-8 cable
to the 12V input PC stakes on the
PC board. Feed the end of the cable
through the stormwater pipe and the
hole in the end cap and then place
the assembled PC board into the tube.
The figure-8 cable is anchored in the
end cap using the cord grip grommet.
Both end caps can then be fitted onto
the tube. To stop the board rattling inside the tube, you can wrap it in some
foam rubber or bubble-wrap.
Attach the battery clips to the
figure-8 cable, using red for positive
and black for negative. Don't get these
back-to-front otherwise you will blow
the fuse. Then give the system another test, with the spark gap wires still
Above: the label we
prepared for the electric
fence. It was glued onto
the PVC pipe with spray
adhesive.
Right: the full-size PC
board pattern for those
who wish to make their
own. You can also use
this to check
commercial boards for
etching defects.
All three labels and the
PC board pattern are
available for
downloading from the
SILICON CHIP website,
www.siliconchip.com.au
An alternative mounting approach would be to use a sealed
weatherproof case such as this one from Dick Smith Electronics.
As luck would have it, the holes for one of the capacitor-holding
cable ties line up perfectly with the mounting points moulded into
the case. For security, another cable tie should probably be used,
necessitating a new pair of holes drilled in the PC board.
April 1999 33
Resistor Colour Codes
No.
Value
2 1.5MΩ
1 270kΩ
1 150kΩ
4 100kΩ
5 10kΩ
1 6.8kΩ
1 4.7kΩ
3 2.2kΩ
1 1kΩ
1 390Ω
2 220Ω
1 100Ω
1 47Ω
across the output terminals.
Does it still give a nice, juicy spark?
Yep? Good. Now you can remove the
spark gap wires before final assembly
(the fence won't operate satisfactorily
with the spark gap left in place).
Use some silicone sealant to waterproof all joints around the end caps
and wire entry point.
By the way, don’t be tempted to
fix the end caps with PVC solvent
glue – you’ll never get them off again
if you do.
Installation
The controller is best installed
inside a building in a position free
from the risk of mechanical damage.
If mounted outdoors, it should be
4-Band Code (1%)
brown green green brown
red violet yellow brown
brown green yellow brown
brown black yellow brown
brown black orange brown
blue grey red brown
yellow violet red brown
red red red brown
brown black red brown
orange white brown brown
red red brown brown
brown black brown brown
yellow violet black brown
5-Band Code (1%)
brown green black yellow brown
red violet black orange brown
brown green black orange brown
brown black black orange brown
brown black black red brown
blue grey black brown brown
yellow violet black brown brown
red red black brown brown
brown black black brown brown
orange white black black brown
red red black black brown
brown black black black brown
yellow violet black gold brown
Capacitor Codes
Value
0.1µF
0.0047µF
0.0039µF
EIA
104
472
392
IEC
100n
4n7
3n9
clamped to a fence post, to minimise
the risk of mechanical damage.
Fig.10 shows a typical installation.
The controller should be fitted with
separate earth electrodes and these
should not be connected to any other
earthing device.
All fence wiring should be installed
well away from any overhead power or
telephone lines or radio aerials.
Where the electric fence is installed
in such a position that people might
touch it and it is not using white or
orange tape, it should be identified by
suitable signs clamped to the wire or
fastened to the posts at intervals not
exceeding 90m.
Such signs should bear the words
“ELECTRIC FENCE” in block letters
SC
no less than 50mm high.
COMING NEXT MONTH
We have developed a number of
testers to check the output from
this, or any other electric fence.
They range from very, very
simple to very simple – and all
are easy to build.
The two end labels, designed to fit inside a standard 90mm PVC (stormwater) pipe end cap. These labels can be
photocopied or the originals downloaded from the SILICON CHIP website, www.siliconchip.com.au
34 Silicon Chip
|