Pages: [1] 2 3 4   Go Down
Author Topic: Arduino digital input, 80Vdc  (Read 6317 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Edison Member
*
Karma: 17
Posts: 1413
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 11, 2012, 02:02:11 am by Sergegsx » Logged

* Si preguntas, pon el código de tu programa, hace mucho mas fácil ayudarte. Y me ahorro un mensaje pidiendo que lo hagas.
* Si consigues solucionar tu problema, dedica unos minutos a explicar en tu post como lo conseguiste para beneficio de todos.
* Cambia el 'Subject' de tu hilo y añade 'SOLUCIONADO' cuando hayas llegado a una solución al problema que planteaste.
* Utiliza un 'Subject' para tu hilo que explique de que va el hilo.
Si estas empezando:
* Comienza a usar Arduino
* Guías de iniciación a Arduino
* Ejemplos
* Referencia del Lenguaje
* Conceptos básicos
Guia de usuario de arduino
Tutoriales en Ingles
Si necesitas que alguien te escriba el código: http://www.freelancer.com/  o esta  http://www.guru.com/

nr Bundaberg, Australia
Online Online
Tesla Member
***
Karma: 129
Posts: 8594
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

As it is it controls the LED.
_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Edison Member
*
Karma: 17
Posts: 1413
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 !!
« Last Edit: October 11, 2012, 03:24:30 am by Sergegsx » Logged

* Si preguntas, pon el código de tu programa, hace mucho mas fácil ayudarte. Y me ahorro un mensaje pidiendo que lo hagas.
* Si consigues solucionar tu problema, dedica unos minutos a explicar en tu post como lo conseguiste para beneficio de todos.
* Cambia el 'Subject' de tu hilo y añade 'SOLUCIONADO' cuando hayas llegado a una solución al problema que planteaste.
* Utiliza un 'Subject' para tu hilo que explique de que va el hilo.
Si estas empezando:
* Comienza a usar Arduino
* Guías de iniciación a Arduino
* Ejemplos
* Referencia del Lenguaje
* Conceptos básicos
Guia de usuario de arduino
Tutoriales en Ingles
Si necesitas que alguien te escriba el código: http://www.freelancer.com/  o esta  http://www.guru.com/

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* Scan 100.JPG (52.49 KB, 1653x1165 - viewed 99 times.)
Logged

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.

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5651
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

0
Offline Offline
Edison Member
*
Karma: 17
Posts: 1413
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

* Si preguntas, pon el código de tu programa, hace mucho mas fácil ayudarte. Y me ahorro un mensaje pidiendo que lo hagas.
* Si consigues solucionar tu problema, dedica unos minutos a explicar en tu post como lo conseguiste para beneficio de todos.
* Cambia el 'Subject' de tu hilo y añade 'SOLUCIONADO' cuando hayas llegado a una solución al problema que planteaste.
* Utiliza un 'Subject' para tu hilo que explique de que va el hilo.
Si estas empezando:
* Comienza a usar Arduino
* Guías de iniciación a Arduino
* Ejemplos
* Referencia del Lenguaje
* Conceptos básicos
Guia de usuario de arduino
Tutoriales en Ingles
Si necesitas que alguien te escriba el código: http://www.freelancer.com/  o esta  http://www.guru.com/

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

0
Offline Offline
Edison Member
*
Karma: 17
Posts: 1413
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

* Si preguntas, pon el código de tu programa, hace mucho mas fácil ayudarte. Y me ahorro un mensaje pidiendo que lo hagas.
* Si consigues solucionar tu problema, dedica unos minutos a explicar en tu post como lo conseguiste para beneficio de todos.
* Cambia el 'Subject' de tu hilo y añade 'SOLUCIONADO' cuando hayas llegado a una solución al problema que planteaste.
* Utiliza un 'Subject' para tu hilo que explique de que va el hilo.
Si estas empezando:
* Comienza a usar Arduino
* Guías de iniciación a Arduino
* Ejemplos
* Referencia del Lenguaje
* Conceptos básicos
Guia de usuario de arduino
Tutoriales en Ingles
Si necesitas que alguien te escriba el código: http://www.freelancer.com/  o esta  http://www.guru.com/

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

0
Offline Offline
Edison Member
*
Karma: 17
Posts: 1413
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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?


* scheme.png (11.72 KB, 922x362 - viewed 60 times.)
Logged

* Si preguntas, pon el código de tu programa, hace mucho mas fácil ayudarte. Y me ahorro un mensaje pidiendo que lo hagas.
* Si consigues solucionar tu problema, dedica unos minutos a explicar en tu post como lo conseguiste para beneficio de todos.
* Cambia el 'Subject' de tu hilo y añade 'SOLUCIONADO' cuando hayas llegado a una solución al problema que planteaste.
* Utiliza un 'Subject' para tu hilo que explique de que va el hilo.
Si estas empezando:
* Comienza a usar Arduino
* Guías de iniciación a Arduino
* Ejemplos
* Referencia del Lenguaje
* Conceptos básicos
Guia de usuario de arduino
Tutoriales en Ingles
Si necesitas que alguien te escriba el código: http://www.freelancer.com/  o esta  http://www.guru.com/

0
Offline Offline
Edison Member
*
Karma: 17
Posts: 1413
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

* Si preguntas, pon el código de tu programa, hace mucho mas fácil ayudarte. Y me ahorro un mensaje pidiendo que lo hagas.
* Si consigues solucionar tu problema, dedica unos minutos a explicar en tu post como lo conseguiste para beneficio de todos.
* Cambia el 'Subject' de tu hilo y añade 'SOLUCIONADO' cuando hayas llegado a una solución al problema que planteaste.
* Utiliza un 'Subject' para tu hilo que explique de que va el hilo.
Si estas empezando:
* Comienza a usar Arduino
* Guías de iniciación a Arduino
* Ejemplos
* Referencia del Lenguaje
* Conceptos básicos
Guia de usuario de arduino
Tutoriales en Ingles
Si necesitas que alguien te escriba el código: http://www.freelancer.com/  o esta  http://www.guru.com/

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1] 2 3 4   Go Up
Jump to: