Getting information from power supply

Hi everyone,

First of all I’m sorry if I posted this in the wrong place/thread/topic/section and Yes, I made a lot of research but I’m so n00b that I have to ask someone to give me a little help.

Here is my situation: I have a 24v/1A (that’s a lot of watt!!) that’s used for light a powerful LED.

What I want is to know with an arduino due what LED are ON and what are not.

Obviously I need something that drops the current from 24v to 3.3v, but I also must be sure that arduino do not get too many amps.

Or did I just say a truck of bullshit?

Just to explain a little better:
24v source > ------ < 24v user
arduino I/O___|

the code doesn’t scares me, it’s simple, but I’m a complete idiot in electronics.
Could some good greg guy give me a help?

Thanks in advance for anything!
And sorry for my english, is so outdated!

will this help

http://ruggedcircuits.com/html/circuit_-28.html

drjiohnsmith: will this help

http://ruggedcircuits.com/html/circuit_-28.html

Thanks a lot. This could be really useful.

But... is the example you posted for output only? Because I need to us it as an input. I read a lot about voltage divider but I'm not sure it will work.

Thank you very much

how complicated do you want to go ?

are the leds in a string, wired in series ?

In a string of leds, if one led is off the complete string is off.

if the leds are powered individually , in paralel, then one led can go off , the other will stay on,

or the leds caan be wired as a set of parallel strings,

If the 24V supply has a common ground with the Arduino, then a voltage divider is all you need to sense whether the +24V supply is present or not. You could use 10K for the lower resistor and 68K for the upper resistor.

An alternative (which does not required the 24V supply to have a common ground with the Arduino) is to use an opto isolator. Connect the input of the opto isolator and a 10K series resistor across the 24V supply. Connect the output side between an Arduino digital input pin and ground. Enable the internal pullup resistor on that Arduino input. See http://cq.cx/pics/int-digin-opto.png for the general arrangement, except I am suggesting you make R2=10K and omit R1.

drjiohnsmith:
how complicated do you want to go ?

are the leds in a string, wired in series ?

In a string of leds, if one led is off the complete string is off.

if the leds are powered individually , in paralel, then one led can go off , the other will stay on,

or the leds caan be wired as a set of parallel strings,

I think it could be called parallel: Each led is powered by an external source. And Each led has a personal external button.

@dc42: thanks for your answer.
If I have a common ground (not sure if I could but I hope), isn’t it risky to use only a voltage divider?
I mean: I should have 24v @ 1A from the source.

For using a voltage divider… is the “schema” attached correct?

Thank you very much everyone!

PS: The resistors aren’t going to get really hot?

voltage-divider.jpg

Yes, that arrangement is correct. If you use those value resistors, they won't get hot. But f you have the least bit of doubt about whether you can use a common ground, use an opto isolator instead - it's still only 2 components.

dc42: Yes, that arrangement is correct. If you use those value resistors, they won't get hot. But f you have the least bit of doubt about whether you can use a common ground, use an opto isolator instead - it's still only 2 components.

Yes but... the opto isolator is too expensive... I have to connect all the 54 arduino due input...

Using a common ground is just a wire, am I right?

majorebola: Yes but... the opto isolator is too expensive... I have to connect all the 54 arduino due input...

54 of the cheapest ones will cost you about US$15 from a distributor, or a bit less on eBay e.g. http://www.ebay.com/itm/50-PCS-EL817B-DIP-4-EL817-PC817-Optocoupler-IC-/121199086335?pt=LH_DefaultDomain_0&hash=item1c38074aff.

majorebola: Using a common ground is just a wire, am I right?

Yes, but you need to be sure that it is safe to use a common ground. What are the details of the 24V power supply?

dc42: 54 of the cheapest ones will cost you about US$15 from a distributor, or a bit less on eBay e.g. http://www.ebay.com/itm/50-PCS-EL817B-DIP-4-EL817-PC817-Optocoupler-IC-/121199086335?pt=LH_DefaultDomain_0&hash=item1c38074aff.

:astonished: Let's talk about these!

What I have to check on these? I mean, I have 24V/1A source, I need 3,3V Arduino digital pin. What specs I should check?

dc42: Yes, but you need to be sure that it is safe to use a common ground. What are the details of the 24V power supply?

I've not complete data of the power supply, but it should simply be a 24V DC source with something around 1A (It lights a quite powerful status LED). I should have 0V if it is off and 24V if it's on. Should be simple... should be. :)

majorebola: :astonished: Let's talk about these!

What I have to check on these? I mean, I have 24V/1A source, I need 3,3V Arduino digital pin. What specs I should check?

Any optocoupler with phototransistor output should suffice. You need a series resistor between the 24V and the input side of the optocoupler, to limit the current to below the maximum (which is typically about 20mA). But you don't need as much current as that, which is why I suggested using a 10K series resistor (giving about 2.3mA current). I'm assuming that you will place the optocouplers close to the Arduino, and use the internal pullup resistors.

majorebola:

dc42: Yes, but you need to be sure that it is safe to use a common ground. What are the details of the 24V power supply?

I've not complete data of the power supply, but it should simply be a 24V DC source with something around 1A (It lights a quite powerful status LED). I should have 0V if it is off and 24V if it's on. Should be simple... should be. :)

Unless the 24V supply will be powered from the same mains outlet as your Arduino, then it is probably not a good idea to use a common ground, because by doing so you may create a ground loop and/or feed mains-borne transients into the Arduino ground.

opto is the way to go,

resistor divider, one of the resistors to the ground lifts, goes open circuit, , and you put 24 volts on to the arduino,

pop.

optos' the 24 volts is separated always from the arduino,

Okay...

Then I'll use Optos...

But Optos have a "line-in" with low-voltage. If I understand correctly, the EL817 has 1.4V, so I should drop the tension with a resistor...?

Then how I can choose the output at 3,3V?

I think I should study more electronics!

will this help

http://electronics.stackexchange.com/questions/36517/opto-isolated-arduino-input

majorebola: But Optos have a "line-in" with low-voltage. If I understand correctly, the EL817 has 1.4V, so I should drop the tension with a resistor...?

Yes, I've already told you to use a 10K series resistor (twice).

drjiohnsmith:
resistor divider, one of the resistors to the ground lifts, goes open circuit, , and you put 24 volts on to the arduino,

pop.

No, provided the resistor values are high enough, the upper resistor will limit the input current to a value that the input protection diode can safely handle. But I agree that opto is the way to go in this case.

Thank You very much dc42!

You explained me everything... sorry for being so dumb. But now I got it! Today I'll look for some optos!

Really, thank you very much!