Connecting 2 ports to 1 led

Hello,

I need to use 1 led indicator for 2 ports.
Only 1 port will be HIGH ‘1’ at a specific moment.

Will it work? Is it ok connecting like this?

Are there better suggestions?

Thank you.

Yes. Make sure the total current for LED and optocoupler doesn't get too large.

With the diodes, yes. You'll be OK.

NOTE - Most optocouplers have an LED inside and they need a current limiting resistor. (Maybe yours don't need the resistor, or maybe you just didn't bother to show it.)

Thanks for your quick responses.

I'm going to use this

www.ebay.com/itm/Two-Channel-5V-2-Relay-Module-With-Optocoupler-For-Arduino-PIC-ARM-DSP-AVR-1Pc-/281583127806?pt=LH_DefaultDomain_15&hash=item418fa98cfe

Do i need to add 2 resistors?

I don't know how much the input resistance of the module is, i would like to know.

Thanks.

If I am reading the ebay link right this module is reverse acting. IE; A LOW (0) activates the relay and a HIGH (1) deactivates the relay. Therefore your circuit will work, but the led will be on when the relay is off…

R

If you want the LED on when the relay is on then connect the LED's anode to the 5V rail the cathode to the resistor the resistor to the anode of the two diodes and connect a cathode each to the outputs.

rdfeil: If I am reading the ebay link right this module is reverse acting. IE; A LOW (0) activates the relay and a HIGH (1) deactivates the relay. Therefore your circuit will work, but the led will be on when the relay is off...

R

Grumpy_Mike: If you want the LED on when the relay is on then connect the LED's anode to the 5V rail the cathode to the resistor the resistor to the anode of the two diodes and connect a cathode each to the outputs.

I don't know how i missed the active low...

Thank you all for your help.

Zen-: I don't know how i missed the active low...

You missed it because there is virtually no critical information about the thing, and no circuit diagram.

Well, OK, there admittedly is this:

Low level actuation(indicator ON), high level release(indicator OFF)

But that is not entirely helpful and what on earth does this mean?

Rated voltage: DC12

So - here is a circuit diagram: Note that it is a good idea to run the relays themselves from a separate power supply to the Arduino and to do this you remove the link from "VCC" to "JD-VCC", connect only the inputs and "VCC" to the Arduino and the "GND" and "JD-VCC" to the relay power supply.

Knowing that it is active low, you just connect your Arduino pin directly to "IN0" and "IN1"

My observations are twofold.

Firstly, why do you want an indicator when the relay board has indicators on it?

And secondly, why not make it simple and use two indicators, each with its own resistor?

Paul__B: You missed it because there is virtually no critical information about the thing, and no circuit diagram.

Well, OK, there admittedly is this:But that is not entirely helpful and what on earth does this mean?So - here is a circuit diagram: Note that it is a good idea to run the relays themselves from a separate power supply to the Arduino and to do this you remove the link from "VCC" to "JD-VCC", connect only the inputs and "VCC" to the Arduino and the "GND" and "JD-VCC" to the relay power supply.

Knowing that it is active low, you just connect your Arduino pin directly to "IN0" and "IN1"

My observations are twofold.

Firstly, why do you want an indicator when the relay board has indicators on it?

And secondly, why not make it simple and use two indicators, each with its own resistor?

The led indicator will be mounted on a front panel.

I want to use a linear actuator, so i need just 1 indicator when the actuator is active.

This is where i am standing now:

note that my power source going to be a PC power supply, i prefer to use it with the arduino and the actuator, if you think that it is important in my case to separate totally as you mentioned before, i will separate.

http://i.imgur.com/N2ysJhs.png

Thanks for the help.

That looks fine for the LED indicator circuit.

Why not use a 3 leg bi-colour LED like this? It will be a single LED but the colour will depend on direction of actuator.

Grumpy_Mike: That looks fine for the LED indicator circuit.

Ok, thanks.

Riva: Why not use a 3 leg bi-colour LED like this? It will be a single LED but the colour will depend on direction of actuator.

I don't need an indicator of the direction, just 1 led to indicate that the actuator is on.

Zen-: note that my power source going to be a PC power supply, i prefer to use it with the Arduino and the actuator, if you think that it is important in my case to separate totally as you mentioned before, i will separate.

There are a few considerations involved. You indicate that you are going to feed your circuit which is apparently not using a stock Arduino board, from a 5V supply. We are then not concerned with the behaviour of the 5V regulator on the Arduino and its ability to supply the relay board.

The recommendation then becomes: wire the power to the relay board separately back to the power supply so that the point where the relay power and the ATMega power join is at the power supply itself. If you are using a "scavenged" PC power supply, then it has multiple wires emanating for 5V and ground, so you can split the connector and use different wires for these two parts of the circuit. This is even more important in separating the 12V wiring to the motor. Note also that the PC power supply may require more of a load on the 5V supply than just the ATMega chip in order to properly regulate; perhaps a few hundred milliamps.

Curious as to what the Reset switch does? Also why you are using a hardware switch to enable the motor, rather than software through the ATMega (and the "Turner off" indicator derived from it as well)?

Paul__B: There are a few considerations involved. You indicate that you are going to feed your circuit which is apparently not using a stock Arduino board, from a 5V supply. We are then not concerned with the behaviour of the 5V regulator on the Arduino and its ability to supply the relay board.

The recommendation then becomes: wire the power to the relay board separately back to the power supply so that the point where the relay power and the ATMega power join is at the power supply itself. If you are using a "scavenged" PC power supply, then it has multiple wires emanating for 5V and ground, so you can split the connector and use different wires for these two parts of the circuit. This is even more important in separating the 12V wiring to the motor. Note also that the PC power supply may require more of a load on the 5V supply than just the ATMega chip in order to properly regulate; perhaps a few hundred milliamps.

Curious as to what the Reset switch does? Also why you are using a hardware switch to enable the motor, rather than software through the ATMega (and the "Turner off" indicator derived from it as well)?

About the wiring i will do it as you explained.

In addition there will be connected LCD via I2C module, dht22, ds18b20, some pullup resistors for push buttons, leds and 3 SSRs that will work occasionally. Is it enough for a minimum load on the 5V supply? if not please suggest me a solution.

The reset switch is just in a case that i would want to reset the ATmega for some reason.

The reason for the hardware switch is to avoid a sudden movement of the linear actuator for any reason, and in this case i want a LED indicator that i wont forget to switch the linear actuator back to ON manually. It's important to have this switch because if the actuator will start moving in the time that it shouldn't it may cause some damage. I just want to cut power from the actuator totally and avoid a chance that for some reason (bug in the program) the ATmega will start the actuator.

Thank you for your time.