Monitoring An Electric Fence With LoRaWAN

Making sure that an electric fence which is keeping one’s cattle and sheep from wandering off is still working properly seems like a fairly daunting task, especially when this fence is quite a distance from one’s home so checking up on it is time-consuming. After a friend of [kiu] got called a few times by the police because some of the sheep had pulled a prison break, the obvious technological solution was to IoT-enable the fence with LoFence.

This solution is nothing if not elegant in its simplicity. For phoning home with status data, the system uses the Microchip RN2483 IC, which handles pretty much all aspects of LoRaWAN, so that one merely has to send data to its serial interface to transmit. Because this system uses The Things Network (TTN) there are no service costs due to the low data rates. This was the easy part, aside from having to add a LoRaWAN gateway to boost the signal in the area with the electric fence.

With that side covered, the rest of the build features an AVR ATmega328p MCU, a resistor divider and op-amp (TLV9062) along with some passives. The resulting circuit measures voltage, essentially to detect whether the fence is still forming a full circuit. Hacking into the little box that energizes the fence might be a possible upgrade there, but at least it is a fairly uncomplicated way to measuring things. Electric fences do work best with a voltage on them, after all.

At the other end of the LoRaWAN network, the data is parsed and analyzed by a service so that it can be displayed on a Grafana dashboard, ensuring that a single glance suffices to see the current state of the fence and whether one has to dash out in the rain at 1 AM to fix it or not.

An Electric Fence For Snails And Slugs

Anyone with a garden knows about doing battle with pests. Weeds, bugs, rabbits, birds — all of them try to get a bite out of our flowers and vegetables. Some of the worst are mollusks. Snails and slugs are notorious plant attackers. Tomato plants don’t stand a chance when these beasts come to town. Some folks would reach for the pesticide or even the salt, but [wheldot] had a better idea. He built an electric fence to keep these pests at bay.

Much like the electric fences used for large mammals like horses or cows, this fence is designed to deter, but not kill slugs and snails. The design is incredibly simple – two bare wires are strung around the raised garden about one centimeter apart. The wires are connected to a nine-volt battery. No boost circuit, no transistors, just nine volts across two wires. That’s all it takes to turn a slug away.

[Wheldot] didn’t come up with this hack — it’s been around in various forms for years. The nine-volt battery provides just enough current to annoy the slug or snail. The best part is that when not actively shocking a slug, the only current passing through the circuit is the whatever is passed through the wood.

Reddit user [gnichol1986] measured that at around 180 kΩ through wet wood. That means a typical 400 mAh battery would last around 34 days of continuous rain. Even in the UK it doesn’t rain that much. With a little work insulating the wires from the wood, that could be extended to the full shelf life of the battery.

You know, slugs and critters get into electronics too, so don’t forget a waterproof case to make sure your project stays slug free!

Continue reading “An Electric Fence For Snails And Slugs”