Electronic – Long cable run for a flip-flop sensor

flipflop

I have some home automation, and want to put a rain sensor far away (about 30') from my computer.

(EDIT: Rainfall meter or rain gauge, not a sensor. as per Transistor)

The sensor uses a mechanical teeter-totter with a magnet that momentarily triggers a reed switch as it tips.

I want to use the reed switch to set a flip-flop (74?109) that the computer can read at its leisure, then I want the computer to clear the flip-flop.

Do I put the flip-flop far from the computer and near the sensor running Vcc, Gnd, Clr, & Sens, or put the flip-flop near the computer only running the reed closure through the wire?

Reliability, of course, is paramount. I am thinking noise issues, and impedance.

Reasoning?

My arguments for each case…

If I put the flip-flop near the reed switch, the reed switch will reliably trigger the flip-flop, but there may be a lot of noise on the clear line triggering false clears.

On the other hand, putting the flip-flop close to the computer will make that reliable, but the 60' of wire may not trip the flip-flop as the magnet goes by. Also, there may be noise on that line and may trigger false sets.

In either case, I have lots of old 4-conductor telephone (CAT3?) cord.

Thanks.

Best Answer

If you put the flipflop near the rain gauge, resistance of the wire will become problematic. The voltage drop from resistance and inductance of the wire could create noise and voltage drops. One could put the flip flop on the rain gauge, but it would also be wise to put a voltage regulator there also, to ensure that the voltage rail of the flip flop is constant. It might also be advantageous to use a Schmidt trigger to detect the voltage from the relay before the flip flop.

Since the gauge is simply a relay and open or closed, it would be sufficent to put the flip flop at the computer. There are several ways to prevent magnetic noise, one being twisted pair (which CAT 3 is) but it might also be better to use shielded twisted pair.

With outdoor wires, lighting and other electric fields can induce high voltages that could be too high for a digital input. Here are some ideas/example circuits to prevent high voltage from accessing digital electronics.

Either isolate the input with an optoisolator:

enter image description here

Source: https://www.avrfreaks.net/forum/level-protection-interfacing-24v-residential-electrical-installation

Or use voltage transient suppression (with a smaller fuse):

enter image description here

Source: https://dmohankumar.wordpress.com/tag/tvs-diode/