I assume the wind sensor is outside and the Arduino is inside. In which case you need isolation from lightning. An appropriate optical isolator will both protect your Arduino (and you) as well as translate from any voltage to 5V.
If i understand right - i connect pin 1 to my signal source (sensor output) with resistor on serial, pin 2 to ground.
Pin 3 connected to ATMEGA pin and this pin configured with pull - up enable and pin 4 connect to ground. Right?
So in this case - signal was inverted! If i have "1" on sensor side - i have "0" on input side...
i try - may be it work... If not - i reply here...
I don't have any troubles with signal inversion. I think, this schematic be in mind of sensor designers And sensor make inversion of output signal inside. And i make inversion second time...
I was on my local supplier's website yesterday and dropped a pack of 4N25s in my basket.
I notice, looking at this, that the 4N25 also brings the base out to a pin. I was wondering why? I imagine it would be useful for testing for example, where the base is controlled manually without having to energise the HV side of things. Any thoughts?
(My link also shows that the OP is exactly right: a series resistor on the input and a pull-up on the signal.)
I have seen phototransistors with a connection to the base. The datasheets indicated it was to bias the transistor: make it more or less sensitive to light. I suspect the same is true for the 4N25. (By I could easily be wrong.)
I guess the safest way is to use an isolator... but equally, a couple of transistors could have done the same job with little worry about reverse current ...
But, yeah an opto is a quick way, i generally think of using it with higher voltage apps.
What difference does 0.3" and 4000 volts against lightning sparcgap of 1 mile and a million volts.
It's better place a overvoltage protection on the cable from the weatherstation and keep the aurdino as isolated as possible (no grounding)
It is not so much protection against lightning, that immunity to radio-frequency interference for long lengths of cable. Indeed, with an optocoupler, we are in the presence of a symmetrical connection with a strong current. NMEA provides a current of 4 mA.
The other important point is the elimination of problems potencial differences between the sensor and the micro-pross. For example, the sensors can have a different power supply from the power supply Micropross.
In the case of a short length of cable between the sensor and the Micropross we allow our sensors to connect the NMEA signal OUT - to the UART Rx Micropross.