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?

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?

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.

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

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

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?

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.

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.

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.

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.

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.

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

V=IR80 =0,01 * RR = 8000ohmsso 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.

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.

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.