Arduino digital input, 80Vdc

dhenry:

I need to detect 0Vdc or >60Vdc (system on).

Assuming that you need isolation.

  1. Get the optocoupler's datasheet. Find the current needed to light up the led.
  2. Get a resistor that will generate that current under 60v. You can size that resistor a little bit higher if you want to make sure that there is sufficient threshold.
  3. If you want to protect the opto-coupler for reverse polarity, put a diode on it, or another opto-coupler but reverse the polarity - in that case, you can detect ac as well as dc.
  4. Done.

Great thanks !
I want isolation for two reasons, to learn my first optocoupler circuit and to make things saver.

Asuming a 4N35 optocoupler which seems quite famous

Collector-base voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 V
Collector-emitter voltage (see Note 1) 30 V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Emitter-base voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 V
Input-diode reverse voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 V
Input-diode forward current: Continuous 60 mA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Peak (1 µs, 300 pps) 3 A

http://measure.feld.cvut.cz/groups/edu/osv/4N35.pdf

So lets see if I get this right...
lets say 90V as you say.
V = I * R
90V = 0,060A * R
R = 1500 Ohms

so 1,5 Kohms resistor is ok?
P = V * I
P = (90-6)V * 0,06 Amps = 5 Watts ??? this is not right, isnt it?