I'm making a remote weather station with a Raspberry Pi 4 and a few sensors.

Problem 1: the anemometer is held on a iron rod (was already there, can't change), dangerously exposed to lightnings. Inside it has a reed switch connected to GND on one wire and to a GPIO on the other. Wires go down to the RPi box. What's the best way to avoid hazarous high voltages from burning everything? I was thinking about gas discharge tubes, commonly used in ethernet protection. Would they be OK and what type should I get for a 3.3V signal? How to connect them properly?

Problem 2: the ethernet Cat 6 cable that connects the RPi to the LAN will stay underground, a few cm below walking level. Shall I add a surge protection to it, too?

Problem 3: the board will stay in the same box as 220V wires, which power the station. Is it fine? Or will it interfere with the delicate electronics?


EDIT: block diagram

enter image description here

  • \$\begingroup\$ Please draw a block diagram that shows all the main interconnections and power feeds. \$\endgroup\$
    – Andy aka
    Jul 19, 2020 at 17:06
  • \$\begingroup\$ I would be more worried about the Ethernet cable bringing a transient in, the one way to mitigate, may be to bury the ethernet right alongside the power cable, which needs to be 2 feet below ground anyway by regulation. At that point ethernet over power looks sweeter. As for mixed power and low voltage, it's a matter for making maintenance easy and safe mostly. \$\endgroup\$
    – Conrad B
    Oct 11, 2021 at 13:30

1 Answer 1


Is this iron rod part of lightning protection on an outbuilding or what?

Install surge protection in your house supply board or you may have everything blown, not only RPI.

Gas discharge tube AND optocoupler on anemometer input should be enough for indirect strike.

Direct strike...Even with surge protection everything plugged in in the house have minimal chances of survival.

Add second "iron" rod 1-5m higher 2-5 meters away as direct hit avoidance measure.

  • \$\begingroup\$ The rod is on the roof of the weather station, the worst places of all. Yeah definitely surge protection on the 220V line. Putting an optocoupler would protect only one of the 2 wires of the anemometer (the other would still need RPi's 3.3V to turn on the optocoupler, unless I use a power supply for the sensor only). As for the direct strike, well... I'm not expecting it to be absolutely 100% lightning-proof. Any recommendations about the gas discharge tube? \$\endgroup\$ Jul 19, 2020 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.