Arduino Coil Ignitor

I once built a high voltage device to keep martens out of the engine compartment of my car.
It used an ignition coil intended for a motor scooter which I got on aliexpress for about $5. It used also a 555 timer based Nixie power supply to produce 300v which was switched on when a PIR sensor was triggered. This charged a capacitor which was about 100ms later discharged through the coil using a thyristor so very similar to a CDI ignition circuit. The whole thing was controlled by an attiny85 and powered by 4 AA batteries. It produced 30kV capable of sparking across a 1 cm air gap. I never installed it though. I still have to add a circuit to suppress the PIR trigger when the car is in motion.

Your design doesnt use a high voltage capactior although many others do. Do you find not having one helps or hurts. I have looked at alot of designs but know one tells me the purpose of the capacitor.

It is tied to earth ground.

The IRL540 has a flyback diode built-in.

Please explain how this works when there's a voltage build-up from the coil at the Drain? The diode is blocking up to a certain voltage, and then..?

Edit: Some positive feedback, good choice of MOSFET in regard to the logic level. That IRF244 would have less desirable outcome.

And the other side of the capacitor is connected where? It is the wire in the air, on insulators making a very high voltage capacitor. How is the high voltage capacitor discharged for safety?

The capacitor (condenser in automotive terms) is needed in points-triggered ignition systems. The primary purpose of the condenser is to prevent arcing in the points themselves. Since my design has no points, there's no capacitor needed. Just the flyback diode that is built in to the MOSFET.

Also, my design generates the pulse by applying a brief +12V pulse to the coil. Auto ignition systems always have +12V on the coil and the points cause a collapsing field. The collapsing field is faster so it generates higher voltage- as much as 50kV. Since I am not powering the coil except for the brief (10ms) pulse, no ballast resistor (actually a current limiter) is needed to protect the coil primary.

I was not looking for a very high voltage, just enough to discourage the chipmunks. They are cute but they will eat anything I plant in my raised vegetable garden. Oddly, the squirrels don't like vegetables, but they are always looking for a route to my bird feeder.

I also don't need spark plug wires. I just use wire rated at 600V insulation.

I don't know how to translate the spec: "Avalanche energy 310 mJ", but this circuit has been working for two years without a part failure, so I feel safe.

No, that is the body diode. It is in the wrong place, and pointing in the wrong direction to be useful. You do need flyback diode.

If your project is still working, consider yourself remarkably lucky.

Which means that your setup are within the tolerances of your MOSFET (for now). Despite of your success, a flyback diode is a Good thing™ and is usually a necessity to protect the FET.

I believe that this is the cumulation of all the recommendations (modified in paint)

Good diagram, the style is clean. :ok_hand:

Yes, it sums it up good. But ditch the -12 V, unless you have a 24 V system. (If so, you'll have trouble)

The flyback diode whilst protecting the MOSFET will also stop the high voltage from the secondary - won't it?

Primary and Secondary are isolated from each other.

The OP is just using the coil as a pulse transformer, not a HV generator.

In my experience an automotive ignition coil and similar can produce a high voltage, but it doesnt have the energy (joules) to carry very far along a fence. I've set up a similar system before and it threw beautiful sparks near the coil, a short distance along the fence was a different story.
So it could work if your fence is short like 50m or 100m and only for non-hairy animals like humans.

For hairy, thick skinned animals and longer distances, you need a special transformer.

With an ignition coil we usually use some waveform like this, a short spike: _/_
But the modern fence energisers use a more complex waveform with specific attack, sustain and decay, to use musical terms. It's generally a longer duration at a lower voltage, like only 3000v or so (from memory)

A regular ignition coil probably wont handle that, and produces too high a voltage.
You might get away with using a double or triple spike very close together to give some extra kick over longer distances. Keep a full second delay between those series of spikes.

You want a serious earth stake, even for a short fence - get a galvanised star picket or similar, drive it a long way into the ground, much more than just the usual. Connect it back to your energiser with good quality wire, rusty old fence wire is not good enough. Connect the wire to the earth stake with galvanised nut and bolt. For long fences you need more than one earth stake.
The soil moisture plays a big role.

For testing you want an ordinary automotive spark plug, open the gap up to 1mm.
Approximately there is 3000v per millimetre gap.
Wrap some very stiff fence wire around the body/thread, long enough to poke down into the ground from your highest fence wire. It wont matter if it is bare, but you can slip a piece of polypipe over it if you are scared :laughing:
Once the bare wire is pocked into the ground or touching a metal post, you wont feel a thing (no, true, trust me!) especially if you are wearing rubber soled shoes or gum boots.
You touch the end of the plug (that normally goes to the ignition lead and coil) onto the fence - you should hear solid clicks and even see the spark.
With a modern energiser and a 2mm spark gap (6000v) you would be lucky to get a spark.

Oh, and get actual electric fence tape for cattle, or maybe the stuff for horses but it requires less common/more expensive insulators. The electric tape is stretchy and easy to work with, except it's abrasive so be wary of running it through your hands.
It's Ok to use steel fence wire, but usually only necessary when dealing with larger animals that arent respecting your fences, and it's harder to work with.

I wonder why the Joules are different in a modern fencer than an old coil. Considering a Joule is WattsxTime or in a simpler form Amps x Volts x Time. So if a modern gallagher fencer releases its max stored energy in .003 seconds and repeats itself at 60 hz then why can an ignition coil that produces 20000 volts and can run at several thousand rpms or once every 60/2000 (.03) would the zap not be the same to an animal.

Please note .003 and .03 are intended to be different.

Hi @craisbeck

What will the current in each case be?

Tom.. :grinning: :+1: :coffee: :australia:

That would be illegal in my state.

Paul you have been mad since my first post. I feel like my Gallagher fencer pulses 1 time every second or at 60 hertz as I understand.

Or better wording 1 hertz maybe but at the 1 second mark.

Not sure. That’s why I want to build something. Mostly to learn. That’s why I ask the question. There is a good article about why joules are not the most important fencer measurement. Because changing one of the 3 variables adjust the measurement. That’s why I posted the question.

Yes, that is legal. 60Hz means 60 times per second! Not mad, but have been using electric fences for at least 75 years.