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?
the internal pullup resistor from the arduino active.
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.
Quotethe internal pullup resistor from the arduino active.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.
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.
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?
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.