How to monitor electric fence?

Using my extension cord metaphor again. There is nothing plugged in to the female end of the extension cord, but once a second you plug in the male end of the extension cord for a microsecond, then unplug it. The wire in the extension cord is energized, but since there’s nothing on the female end to complete the circuit, no current flows.

The fence wire is energized for one microsecond every second. If there is nothing touching the wire to close the circuit through the ground, no current flows.

Yes, I agree with your description. “Energized for 1 μs” best describes that voltage is applied momentarily. No current flows during that moment unless the circuit is grounded.

The fact that no current normally flows through the circuit (i.e. nothing is ‘sent’ anywhere) is what makes a current sensor ineffective as a means of monitoring the system’s health.

1 Like


Your icon is remarkably similar to the “Ready Kilowatt” icon from mid-last century. (Damn, I’m old).

1 Like

It’s not that but equally obscure. It’s Gyro Gearloose’s helper.

Gyro’s constant companion was a tiny lightbulb that never had any dialogue in the stories.

Gyro is an inventor and one story I haven’t forgotten is when he goes for a picnic outdoors. Although ostensibly written for children, it has a message for children of all ages (and engineers).

He starts the picnic with food spread out on a blanket and is enjoying the fresh air and sunshine. He proceeds to devise a defense to protect it from ants, then flying grasshoppers, then rain, and finally wind. Eventually, the sum of all these defenses is … a weather and pest-resistant house. He is bemused by the fact that he has effectively arrived where he started (indoors)… yet is not where he wants to be (outdoors).

3 Likes

Have you tried the Xiaomi Door sensor? Just a wild guess but perhaps the change in magnetic field when the voltage is applied and you have the sensor just next to the wire might be enough to trip the detection in the module. Do note that having it send out every 1 second will cause the battery of the sensor to go down faster than for regular use.

1 Like

Thank you - “energise” is the word I was searching for!

I imagine door sensors will be reed switches and won’t be sensitive enough, but I did wonder if a Hall Effect Sensor would do the trick. Consensus seems to be that it won’t, though, unless there is current actually flowing (because someone or something is touching the fence).

Subscribing…

I have miles of electric fence and have been looking for same solution.

Haven’t gotten anything figured out yet. Sadly.

Going to write these guys to see how they are doing it…

It is clearly possible because this commercial solution is exactly what I need

https://www.agriace.com/#home

I don’t know why this is so hard. You simply put a voltage divider between the fence wire and ground then connect the low voltage to an input of an ESP device. Then you program the sketch to act as a missing-pulse detector.

A value of 1.8M for R1 and 1K for R2 would drop 5kV to 3V. Selecting the final resistor values would depend on what really is the fence voltage. Is it 5kV or 5.2kV or 4.5kV?

A High-Voltage opto-isolator on the low-voltage output of the voltage divider. (High-Voltage in electronics devices is anything over 5V). Adjust the value of R2 to get something between 5-10V, then the opto-isolator would provide an open-collector that would be safe to connect to a GPIO pin.

The fence voltage varies between 0 and 12k on my fencers. I need to do some math and work out how to end up with measurable voltage across the range that I can interpret for display. Ideally, the interpreted result matches the result from my hand held tester that also indicates the direction of a short on the wire.

I think the disconnect here is that I don’t want to detect a missed pulse, I want to detect voltage or something that I can generally extrapolate voltage from. Often a fence will still be energized and pulse, but only at 100v or 1000v, if there is an issue…which is generally ineffective.

1 Like

Missing pulse detector will tell you if there is no HV pulse for a few minutes, then you know that there is something wrong. If you put the detector at the end of the wire then a missing pulse can be a broken wire, an animal on the wire, a tree branch on the wire, or a failure of the fencer.

If you want to know where a short is at, then you need a TDR (Time Domain Reflectometer). A TDR will tell you how far the anomaly is. It will need a circuit like the one I described above to not attempt a TDR measurement when the HV is present, but doable with a Wemos or NodeMCU.

I know this is an old thread, but if the OP is still around, I found this post while looking for LoRaWan information.

1 Like

OP still here! :slight_smile: Many thanks, Stephen, very interesting indeed.

At least tell that you’re from that company, now it’s just shameful advertising. 600 dollars? That’s crazy…

Seems like interfacing with this device would provide an easy alert signal, Either wire it in or use a photosensor to detect led flashing and stick it in a sealed box. There are other sensors that flash when the fence is working, but this one only flashes when it is not working,

or this one

I use an NE2 bulb with a 10Meg series resistor (it’s a relatively low voltage, about 350 volts). At night it’s easily visible from my house.

Just a question and sorry for bringing up an old thread. But in the LoFence example in his Github, he uses a voltage divider into an Opamp. As a noob why would you use an opamp and not just the voltage divider straight into the input of a microprocessor?

Why use an op-amp? If all you want to do is detect if the fence is live, then using the op-amp as a voltage comparator is a cheap solution. (What was the problem)?

I would NOT put the low-voltage side of a divider into a processor input. You have no protection from voltage spikes and no fence circuit I’ve seen has any design goal other than make high voltage. Instead, use an optoisolator.