Go Down

Topic: can I connect 2 leds to one output? (Read 1 time) previous topic - next topic

david1234

I will explain
I want to send to digital output -HIGH\LOW
if LOW led1 will be turn on
if HIGH led 2 will be turn on
maybe something with pullup on digital output?

will this work?

Grumpy_Mike

#1
Oct 28, 2015, 05:12 pm Last Edit: Oct 28, 2015, 05:16 pm by Grumpy_Mike
Quote
will this work?
It will once you put a resistor in line with the digital output. Use something like a 220R.

But make sure 5V is never applied when there is no digital output, so to be on the safe side put a 120R in each leg of the LEDs, so that is 5V -> LED anode, LED cathode ->120R -> digital output and another 120R -> LED anode, LED cathode -> ground.

larryd

Add a series dropping resistor for "each" LED.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

CrossRoads

Sure, just put a current limit resistor between the Arduino pin and each of the LEDs. Limit the current to 10mA with ~250 ohm resistor.
When Arduino pin is high, top LED turns on.
When low the bottom LED turns on.
When set to an input pin, both LEDs may turn on, depending on their Vf.   You will +5-anode-cathode-resistor-(Arduino input)-resistor-anode-cathode Gnd.  If Vf is low enough (<2.5V), then 2 LEDs in series with 500 ohm resistance could have maybe 0.5mA flowing, the LEDs may turn on dimly.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Grumpy_Mike

Yes guys that is exactly what I said, the topology is identical.

CrossRoads

Ok, I guess we're all in agreement then 8)
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

larryd

#6
Oct 28, 2015, 11:02 pm Last Edit: Oct 28, 2015, 11:10 pm by LarryD
Just connect the LEDs as shown:

Of course this will not work   :smiley-roll-blue:


.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

CrossRoads

D1 will turn on/off 8).
D2, not so much.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

larryd

I have been spending way too much time with bipolar power supplies. 8)
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

david1234

#9
Oct 29, 2015, 09:02 am Last Edit: Oct 29, 2015, 09:04 am by david1234
so to connect like this ?

and to define D5 as a normal output , right?
pinMode(5,OUTPUT);

so when
D5=HIGH: LED1-->On,LED2-->Off
D5=LOW : LED1-->Off,LED2-->On

Grumpy_Mike


david1234


Go Up