Arduino digital input, 80Vdc

Hello,
Please can anyone help me out in this, I need to be able to read with an arduino digital pin a DC voltage that can go from 60 to 80Vdc. I would like it to be isolated, maybe a optocoupler? How can I find one that meets this requirements?

as far as i know, I dont need any additional circuit, right?

Thank you very much for your help.

How does that circuit read the 80v, the opto is the wrong way around.

As it is it controls the LED.


Rob

hi, sorry about that, I copied the wrong image from google images, just wanted to show the basic setup to connect the optocoupler. in case i was missing something. I have removed the picture so it does not confuse other people.

the idea is I have a 60 to 80Vdc input, that I need to detect using a digital pin.

is there any optocoupler or any other method where I can just put the 80Vdc and ground to it, and then get a signal which i can feed to the arduino input pin safely?

thank you Graynomad !!

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.

Sergegsx:
hi, sorry about that, I copied the wrong image from google images, just wanted to show the basic setup to connect the optocoupler. in case i was missing something. I have removed the picture so it does not confuse other people.

the idea is I have a 60 to 80Vdc input, that I need to detect using a digital pin.

is there any optocoupler or any other method where I can just put the 80Vdc and ground to it, and then get a signal which i can feed to the arduino input pin safely?

If it's just 80V DC then get two resistors in the ratio of 16:1 and wire them in series with the small resistor connected to ground. The voltage in between them will be one sixteenth of the input voltage.

You only need opto-isolators if you don't really know what might be connected to the input or if there's the possibility of big voltage surges. eg. they're used in music equipment which has hundreds of cables with interchangeable plugs which need to be connected in a hurry (usually in semi-darkness).

wow thanks so much for your answers !
the idea of the diode is great, I dont expect to get reverse voltage but better to be save. if i finally use 2 resistors, I guess i can put the diode in also,right? just at after the 2 resistors meet.
So i could just get a 1k and 16k resistor and if the input is 80V I get 5V. I like the idea but...

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?

thank you so much for the help, hope to be heading the electronic shop this afternoon to buy the stuff I need. Just need to figure out which optocoupler I could use.
I guess 1N4148 as diode is as good as 1N4001 or 1N4007 which I already have at home?

thanks a lot

The 2 resistors solution proposed by fungus was for use if you don't want optical isolation between the 60-80V and the Arduino. If you are using an optoisolator, then a single series resistor is all you need.

1N400x as the protection diode will be fine.

How can I find one that meets this requirements?

The answer depends on what your requirements are. If you simply want to detect the presence of a 80vdc signal (either it is or it is not), a simpler resistor + opto-coupler will do. If you want to detect the presence of a 80vdc signal vs. a 60vdc signal, a simpler resistor + zener + opto-coupler will do. If you want to detect if it is 80vdc or 80.1vdc, etc., you will need some really fancy stuff.

thank you all !

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

You say using a optocoupler I only need one resistor in series? I guess just like you would light up a led right? great ! I need to build 10 of this in a board so the fewer the parts the better.

so how can I choose the optocoupler? as I say, the system should have 0 V when OFF and around 60 or more Vdc when it is ON. I just need to dectect if its ON or OFF.

I will need for each subcircuit:
1 x 1N400x diode (to protect reverse voltage)
1 x Resistor to feed the optocoupler. Dont know which one as I dont know the optocoupler
1 x Optocoupler

Any additional help on selecting one for this particular use, bearing in mind the input voltage can go from 60 to 80Vdc and with surges.

once again, thanks a lot, this is a really important proyect.

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.

Any general-purpose optocoupler such as 4N25 or 4N35 will do for that job. Most optocouplers work well with around 10mA forward current, which is why I suggested a 6.8K resistor.

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?

just saw your message dc42.
let me see if I understand the calculations.

V=IR
80 =0,01 * R
R = 8000ohms
so similar to yours.
about watts of resistor, i think i got it wrong, i guess i need small 1/4W resistors

Sergegsx:
just saw your message dc42.
let me see if I understand the calculations.

V=IR
80 =0,01 * R
R = 8000ohms
so similar to yours.
about watts of resistor, i think i got it wrong, i guess i need small 1/4W resistors

Yes, that's right. You don't need to run the optoisolator anywhere near its maximum current rating. For the 4N35, even 1mA forward current should be enough to pull the digital input pin low, if you are using the internal pullup resistor.

If of 60ma is the max (continuous) current through the diode. You probably want your opto-coupler to work a little below that. Let's say 10ma.

That means a series resistor of about 90v/10ma = 10k.

You will then find the Ic corresponding to 10ma of If. Figure 6 shows a 1:1 current transfer ratio (but at 10v Vce). So assume that's true for 5v Vce as well. Your Ic is 10ma. You want this kind of current to generate a logic '0' on your avr's input. Check the AVR's datasheet and I think anything less than 1v is a logic low (for a ST pin). That means Rc = 4v / 10ma = 400ohm. Pick 330 or 390ohm.

You will then need to calculate at what threshold input voltage that your opto-coupler will product a high -> make sure that it is over the AVR's input threshold for logic '1'.

As you can see, there is a lot of assumptions / guesswork here so you will experiment a little bit.

What you will find is that using a zener will greatly help producing a sharper turn-on.

Sergegsx:
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.

fungus in parallel? like this... see picture. or maybe as the second option i have drawn?

dhenry thank you so much for the explanation. will reread it a couple of times for fully understanding it.

dc42, you are right, that is max. thanks !

mm...maybe i understood it wrong. maybe like this?
and 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.

the 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.