I might get some voltage surges and would not like to fry my arduino, also its a good oportunity to use them for the first time. Can you help me out on how to choose the appropiate one?

You could put in a protection diode for that. Get a 5V Zener diode and connect it in parallel with the lower resistor. If a voltage higher than 5V appears at the resistor junction the diode will short it to ground.

If the resistors have large values (75k, 5k) then there'll hardly be any amps, it should be enough protection.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

D4 is redundant in this circuit, unless you accidentally short the input of the opto isolator to the output. It might be a useful protection device if you were not using optical isolation. It is also connected the wrong way round.

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

D4 is redundant in this circuit, unless you accidentally short the input of the opto isolator to the output. It might be a useful protection device if you were not using optical isolation. It is also connected the wrong way round.

thanks, i thought this is what fungus ment to be able to give aditional protection in case there is a surge in the 80Vdc.dont understand what he ment then.

That pull-up "resistance" is too high and you may not be able to turn off the phototransistor and generate a logic 0.

Use a resistor and its value will generally be < 10k.

From the data sheet, the off-state collector current of the 4N35 is 50nA max at 25C. So the internal pullup resistor will be fine unless the OP puts the opto isolator somewhere very hot, or he needs a faster turn-off time (but we're only talking about a few hundreds of microseconds at most).

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

See attached. The diode in parallel with the input side of the optocoupler is needed only if there is a possibility of the polarity of the 60-80V input reversing. Enable the internal pullup on the digital input pin.

Sorry to bump this up, but I finally need to build this circuit.I was just wondering, what is the difference between setting the diode in series with positive, or to put it in parellel with the optocoupler?

Please correct me if I am wrongIn series: Acts as a polarity protection. In case + and - are connected the wrong way it will not allow current to flow.

In parallel: Acts as a short circuit in case voltage is over "reverse voltage", but it was suggested that any 1N400x however for example 1N4007 has 700V reverse voltage, and I am just putting in 80V, so any surge will be much lower. however 1n4148 does have a "reverse voltage" of 100V so that makes more sense.

Both? If I am correct, both diodes would be needed for extra security?

A diode such as 1N4007 will have a lot of capacitance and a slow reverse recovery time. This means that if you get a sudden negative going transient, it will initially be passed through the 1N4007 and cause the opto diode to break down - although probably not for long enough to cause damage. However, using a small signal diode such as 1N4148 (which is also much faster than a 1N4007) in parallel with the opto diode avoids that.

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

A diode such as 1N4007 will have a lot of capacitance and a slow reverse recovery time. This means that if you get a sudden negative going transient, it will initially be passed through the 1N4007 and cause the opto diode to break down - although probably not for long enough to cause damage. However, using a small signal diode such as 1N4148 (which is also much faster than a 1N4007) in parallel with the opto diode avoids that.

thanks dc42, so I dont need both?Is my description of the function of each diode correct? or am I missing something?

thanks dc42, so I dont need both?Is my description of the function of each diode correct? or am I missing something?

Your description is correct, and you don't need both diodes.

btw you can also get opto isolators that have two back-to-back LEDs on the input side. If you used on of those, then it wouldn't matter which way round you connected the 80V input, because it would work either way. Here's an example: http://www.farnell.com/datasheets/54263.pdf.

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Hi, I noticed this long drawn out discussion, here is my bit, find in the attached schematic that if you use a zener diode in series with the input to the opto, the input will not conduct until the input is above the zener voltage.Using 10mA as the starting current is just a suggestion.Just some quick calcs and you don't need high wattage components. It will need some more work to check current at 80V, but hey there's the challenge.A lot of industrial CNC and other control equipment use this method to check if all the supply rails in its system are present before commencing and continuing any sequence.

Hi, I noticed this long drawn out discussion, here is my bit, find in the attached schematic that if you use a zener diode in series with the input to the opto, the input will not conduct until the input is above the zener voltage.Using 10mA as the starting current is just a suggestion.Just some quick calcs and you don't need high wattage components. It will need some more work to check current at 80V, but hey there's the challenge.A lot of industrial CNC and other control equipment use this method to check if all the supply rails in its system are present before commencing and continuing any sequence.

Tom thank you very much for your suggestion also, as well as dc42, you have helped me a lot to understand all this.I have actually build your suggestion but using 2 zener diodes as I couldnt get 55V zeners plus this way I get double power dissipation as each of them has 1/2 the voltage.Things get warm but just that, and optocouplers are sending the signal completely correct to the arduino! great !It is also a very good improvement having the 55V trigger instead of just allowing voltage to build up until the 4N25 activated. This way I can detect ON/OFF states much more precisely.Thanks !!

I attached my unfinished PCB, although the part we are discussing here is indeed completed. I included a onboard led to show the status of each input. any suggestion on improvement is of course welcome