I'm making a remote weather station with a Mega 2560, an Ethernet Shield 2 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 Arduino 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) between the Arduino pins and the sensor. Would they be OK and what type should I get for a 5V signal? How to connect them properly?
Problem 2: the ethernet Cat 6 cable that connects the shield 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?
Diagram of the connections attached.
Thanks
How to post an image
Protecting Arduino against lightning and high voltage
My job once took me to a mobile phone mast site that had been hit by lighting. All the equipment was destroyed as was the electricity sub station transformer next door. You can't protect against that.
The metal pole should be connected to a very good earth with very thick conductors, by which I mean a metal structure buried in the ground. There are companies that install lighting protection, you can probably buy the kit if you want to.
Use screened cable for the reed switch and earth the screen and bond it to the pole.
The cat 6 cable and the mains should be in separate ducts.
I don't see a problem with the PSU being in the same box as the other electronics. The box should be metal and earthed. Bond everything.
Thanks for the suggestions!
You can't protect against that.
Yes, of course I can't guarantee absolute protection. But better to have some protection than having nothing.
I thought of another, both wires from the reed switch should have resistors in series with them close to their connection to the Arduino. Both the same value, as high as possible while still allowing it to work.
Also consider that if the pole is hit by lighting there will be thousands of volts between the pole and everything on it or bonded to it, and the electricity supply and the other end of the cat 6 cable. I don't know how to deal with this.
I would need a huge 2W 500kOhm resistor to withstand a 1kV voltage spike (considering a 2mA spike current), which makes that solution practically unmakable, not to mention that the voltage would be still very high. It would only limit the current. There must be a way of discharging the extra voltage to an earth wire... I have such a device in my living room to protect the TV in case of lightning, but I don't think I can use a 220V TV protector for a 5V sensor.
SquareBoot:
I would need a huge 2W 500kOhm resistor to withstand a 1kV voltage spike (considering a 2mA spike current), which makes that solution practically unmakable, not to mention that the voltage would be still very high. It would only limit the current. There must be a way of discharging the extra voltage to an earth wire... I have such a device in my living room to protect the TV in case of lightning, but I don't think I can use a 220V TV protector for a 5V sensor.
There is such a device, it is a gas tube surge suppressor. But heavy duty devices like that will not work without a complete heavy duty grounding system. Your resistor evaluation is incorrect. That might all be true if the lightning voltage was continuous. But, it's not. It's a pulse that lasts a few microseconds... Lightning voltage is measured in gigavolts, and the current can reach thousands of amperes. So, except in commercial installations like cell towers that have to take a hit and keep functioning, most lightning protection is simply directed at trying to encourage the current to follow a harmless path. For example, it is common to run a ground wire from a rooftop antenna. But unless that wire is a two inch wide braided metal strap, it vaporizes almost instantly if it takes a hit. But that's okay, because the remaining plasma is conductive and continues to direct the current to ground (instead of meandering down the antenna wire and taking a random walk through the building).
SquareBoot:
I would need a huge 2W 500kOhm resistor to withstand a 1kV voltage spike (considering a 2mA spike current), which makes that solution practically unmakable, not to mention that the voltage would be still very high. It would only limit the current. There must be a way of discharging the extra voltage to an earth wire... I have such a device in my living room to protect the TV in case of lightning, but I don't think I can use a 220V TV protector for a 5V sensor.
There are two voltages to contend with in a lightening strike. The first is the build up of static charge before any strike occurs. The static charge is quite common. The lightening strike is very rare.
The other voltage is that induced by the current in the lightening, which may actually be quite a few pulses of current. We are talking about 30,000 to 50,000 amperes through your pipe to ground. The actual current may pass both ways, cloud to the pipe and back the other way as other sources of static contribute their + or- charges. Quicker than you can blink you eye!
Look for DX Engineering web site. They source lots of material for lightening protection. But, unless your stuff is worth a lot more than the price of the protection, just have an extra set to install after the strike.
Paul
To really protect a processor, it takes more than on board components. It has to be in a Faraday cage with surge suppressors on every wire that passes through the wall of the cage. However, you can follow economics to improve your chances of survival. Some solutions like resistors, capacitors, clamp diodes and resettable poly fuses are fairly cheap so they will give you a good "bang for the buck" protection.
There is such a device, it is a gas tube surge suppressor
How can I choose those suppressors properly? There are various models rated at different voltages (e.g. 90kV)
But heavy duty devices like that will not work without a complete heavy duty grounding system
I'm adding a grounding pole underneath the station, so I have that covered.
Your resistor evaluation is incorrect.
It was just a quick calculation to understand if a resistor would really help. I'm not expecting Ohm's law to work with lightnings the way it does with DC currents.
However, you can follow economics to improve your chances of survival.
That's indeed what I'm looking for. It's not an area with "high lightning risk", but I would avoid replacing the eletronics for even just small voltage spikes or static charges as @Paul_KD7HB pointed out. The proper way to do it is the point of my investigation, and I would be glad if someone could suggest an affordable/simple protection circuit
Also, another well earthed, taller spike near the one you want to protect.
Make sure the one you want to protect has a rounded top and no sharp points anywhere.
Also, another well earthed, taller spike near the one you want to protect.
That's a good idea, too.
Make sure the one you want to protect has a rounded top
It's an M12 threaded rod on top of the roof of the weather station. The rod is inside a thin PVC pipe for esthetic purposes.
Lightening is some interesting stuff and while we have a handle on how it should behave sometimes it fails to follow the rules There are different types of lightening. With the common cloud to ground strike Paul_KD7HB brings up an interesting fact where he mentions:
The first is the build up of static charge before any strike occurs. The static charge is quite common. The lightening strike is very rare.
People who have survived a lightening strike in close proximity talk about suddenly feeling like a static electricity just before the big bang and blinding flash.
What is the voltage and amperage of an average lightning bolt? Well a read of the link and similar links touch on that subject. While it only exist for a small fraction of a second suffice to say it is a whole bunch. Enough that with a direct strike we can figure anything in the path will be vaporized short of very large conductor. Electronics will become vaporized or toast on a good day. Multi-Million dollar tower systems go through great expense to try and protect equipment which brings us to the cost feasibility. What is the cost to replace the system verse how much to spend trying to protect it? Then too, think about the odds?
Personally I would just hope lightening never strikes because if it does, directly strike your pole, good luck with any protection scheme.
House beside my sister's took a light (mild) strike. My sister lost the dial up modem in her PC and her house phones. The charge came in through the telephone land line. Go figure?
Ron
A good robust input circuit starts with a polyfuse (which doubles also as a low value resistor) in series, a TVS in parallel after that, and a solid ground connection all very close to the input terminals on the PCB. If you don't need high speed data, you can follow that also with another series resistor to limit the peak current into the processor substrate diodes and thus into the power supply, when the TVS voltage exceeds Vcc (it will if the current is high enough). It will slow down the input a little bit because it forms an RC filter with the 6pF or so pin input capacitance. You can also add Schottky diodes directly to the input, to shunt the intrinsic substrate diodes on the chip (because the forward bias voltage is much lower). Then the processor has extra protection, but you should also have a TVS on the power supply so that surplus current into Vcc has somewhere to go. Some voltage regulators can only source, not sink.

The 10mA@ 60V in this diagram is the PPTC rating.

Hi,
If the post has been there for sometime, then it has not been struck by lighting, if it had it wouldn't be there now.
The fact that it is a pole and long and thin, means any charge that would attract a lightning strike is bled off as it tries to build up.
That is how a lightning conductor works, it doesn't short lightning, it leaks away any charge that would attract a strike.
The build up of static in the case of the weather station, or difference between sensors and the controller would be the biggest problem.
A closeby strike would induce a dangerous energy build up in your system, so good earthing is the best you can do, with the suggestions from @aarg.
Tom... 
Just a small note on that input circuit (it's a conglomeration of ideas from watching an STM seminar and spending some research time). It's something I'm actually building now. The polyfuse (PPTC) can be replaced with a resistor in this application - 20 ohms or so. The purpose of the fuse is to protect the TVS from sustained over-current (e.g. t > ~200-500ms), which might result in an open circuit across the diode which destroys any protective action. In this case we're not expecting anything but impulse currents. The poly fuse intrinsic resistance (also approximately 10-50 ohms) also acts beneficially, as a low pass filter combined with the fairly high parasitic capacitance of the TVS. That is why I suggest replacing it with a resistor.
I had a problem with a lightning some time ago. I have "solved" it by replacing the damaged components and so far it did not repeat.
I was studying the topic for some time and my conclusion was
- You cannot survive a direct/close lightning strike. Even if your circuit is insulated the induced currents are enough to do a lot of harm.
- The more protection you add the stronger/closer the lightning may be - meaning a dangerous event is less likely. I have found no clues how to estimate probability of such event or how much a protection improves the chance.
- The circuit and explanation aarg provided is exactly what I would do.
- When calculating values of the components estimate the amount of energy each component will dissipate (and peak currents for devices that state this such as diodes) and try to make them reasonably share the stress.