driving two different color leds with 2 wires only

ScottWang

Joined Aug 23, 2012
7,409
Why do you have more posts on this thread than the OP.
You can check many our helpers that their posted more that the OP, is that so strange?
why do you care so much?
And why do you care so much about I'm trying to solve the problem?

I just thought that this issue is not that hard to solve it, and already had 3 pages still many things unknown, so I want to know more and solve it quickly, is that wrong?
 

ian field

Joined Oct 27, 2012
6,536
What were you planning for resistor values? I haven't simmed or calculated anything for real, but off the top of my head it seems like you're going to be dumping a LOT of current through whichever top resistor (R1 or R2) is above the active transistor.

Maybe there's a combination of resistance values that balances better than I'm imagining, or maybe the wasted current doesn't bother you, but it certainly looks strange to me.

I would've expected one of two likely solutions:
  • H-bridge arrangement
  • One pin controlling on/off function (bjt, MOSFET, relay, whatever) and the other pin controlling polarity reversal through a DPDT relay.
It looks to me like the 2 resistors at the LEDs are superfluous. The collector resistors should serve that purpose just fine.
 

ScottWang

Joined Aug 23, 2012
7,409
It’s a prototype at this stage. We are just testing out different part of a design. Could lead to a commercial, I hope.

So the lower the cost, the better.
For a commercial product, yes.
I totally understand why you suggest the circuit on post #52. In our application, we may need to drive 4 leds instead of 2. (Still two color, but 2 will be in serial). So I may prefer the h-bridge solution.

I can see what your suggested on post #52 is perfect for some other application.
Two days ago, T tried to designed the circuit with H-bridge, but you saying that you want to cost down, so
Or maybe the Chinese in me, I always want to do thing cheaper if possible
For a designer, yes, and for the company more cost down, more benefit ... :)
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Two days ago, T tried to designed the circuit with H-bridge, but you saying that you want to cost down, so...
Sorry about that, when first mention the h-bridge, I was only thinking about a chip, and I automatically think it’s more exoensive. Or using 4 NPN, need drive pump etc, again expensive.

But then Danko showed me it can be done with 2 NPN and 2 PNP, then I thought I could use a couple dual PNP-NPN sot 363 transistors, only cost a few more cents, and more efficient. Only at that point I realise it’s a better fit for my application.

I am actually very happy that I lean that designing a h-bridge with transitions, and some leds can’t stand ANY reverse voltage and they need protection.
 
Last edited:

GopherT

Joined Nov 23, 2012
8,009
I have never seen an LED that can not withstand at least 5 v of reverse voltage. In case you ever run across one of these rare unicorns that cannot have ANY reverse current, DONT use it in your application.

An LED with reverse voltage may have a few microamps of reverse current leakage but that is not important to your application. since you are in the design stage, simply specify an LED that can withstand 5 volts of reverse voltage (or more) and then connect in anti-parallel pair as shown above. They will protect each other as needed since forward voltage is lower than max reverse voltage.
 

BobTPH

Joined Jun 5, 2013
8,998
Agree with GopherT.

This thread has gotten out of hand. The original circuit, with the resistors at the LEDs removed would work fine. And, if the micro is at 5V, the circuit that just uses two output ports and 1 resistor connected to the LEDs in parallel would work fine and be as minimal as you can get.

Bob
 

ScottWang

Joined Aug 23, 2012
7,409
How are the IO_A and IO_B signals, are they just square wave or a pwm signal?
Using the R2~R4 resistors(maybe you can use less 1Ω) can be reducing the damaged by the different Vf between two in parallel's LEDs, you want two LEDs in series and I using them as in parallel and you still can light up two LEDs.
TwoLEDsTwoDir-02_ScottWang.png
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
How are the IO_A and IO_B signals, are they just square wave or a pwm signal?
Using the R2~R4 resistors(maybe you can use less 1Ω) can be reducing the damaged by the different Vf between two in parallel's LEDs, you want two LEDs in series and I using them as in parallel and you still can light up two LEDs.
View attachment 141196
IO_A and IO_B will likely be PWM signal, but I am not sure if it's a good idea to drive LEDs directly with digital IO over a long distance. Short circuit protection will be added at some stage.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Agree with GopherT.

This thread has gotten out of hand. The original circuit, with the resistors at the LEDs removed would work fine. And, if the micro is at 5V, the circuit that just uses two output ports and 1 resistor connected to the LEDs in parallel would work fine and be as minimal as you can get.

Bob
One thing I like asking question in public domain is I usually get feedback/advice/suggestion from people with different background/experty. I usually learn something I could never thought of by myself alone. :)
 

ScottWang

Joined Aug 23, 2012
7,409
IO_A and IO_B will likely be PWM signal, but I am not sure if it's a good idea to drive LEDs directly with digital IO over a long distance. Short circuit protection will be added at some stage.
For a commercial product the safety concerned is right.

About the drawing current, if the LED is working at the static status then I will use it around 80% of the rating current as I=10mA * 80% = 8mA, that is for the usage life and brightness of LED, for a PWM signal, if the duty cycle is 50% then the drawing current will be needs I = 8mA/50% = 16mA, if you just using only 5mA then the average drawing current with PWM signal will be only I=5mA*50% = 2.5mA.
 

ScottWang

Joined Aug 23, 2012
7,409
The drawing current that you should consider is the duty cycle in PWM signal, the range of duty cycle that you all need to concern, sometimes how to decide the values of resistor is a big issue, you need to test it via the practical experiments to get the balance that including the width duty cycle and narrow duty cycle.
 
Top