dimming control with BJTs

Thread Starter

xenolalia

Joined Jun 14, 2011
10
I would like to control multiple LED drivers (Mean Well LDD-L) with a single MCU-derived PWM dimming signal. As the input impedance of the driver's dimming pin is not specified, I assume that the safest approach would be to place a BJT between the MCU output and the driver's dimming input. However, I was hoping that someone could help me understand the practical differences between the configurations on the left and the right:
bjt_configurations.png

Are there any advantages to one over the other, given that an open circuit at DIM should register as logical high according to the datasheet? Also, is there any benefit to assigning each LDD to a separate BJT rather than having them all downstream of a single transistor?

Thanks!
 
Last edited:

bertus

Joined Apr 5, 2008
22,887
Hello,

The left circuit would work if there is a pull-up resistor from the collector of the transitor to the + 5 Volts.
An 1 k resistor will likely do.

Bertus
 

AnalogKid

Joined Aug 1, 2013
12,055
Similarly, the right circuit will work better if you add a pull down resistor from the transistor's (reference designators!) emitter to GND.

There is a third option, changing the right-side schematic to use a PNP as a saturated switch (similar to the left schematic).

ak
 

panic mode

Joined Oct 10, 2011
4,871
i agree with Bertus. neither circuit is complete since dimming input is likely high impedance (otherwise the datasheet would state current into or out of the dimming input).. so both circuits would need a path for current from 5V through transistor and resistor to -Vin.

but your question is about the difference between two circuits as well...

normal MCU has outputs that can reach some 3.3V or maybe 5V.
to activate transistor you need to run some current into its base so that Vbe is some 0.7V.
couple of mA will do... lets assume we want 5mA....
it means that base resistor will need to ensure that current while experiencing voltage different of 3.3V-0.7V=2.6V. so to get 5mA through to transistor base, you need base resistor that is 2.6V/5mA which comes to 520 Ohm. common values close to this is 510 Ohm.

and your MCU output is 5V, voltage across resistor would be 5V-0.7V=4.3V. and resistor would be 4.3V/5mA =860 Ohm so you could use 820 or 910 Ohm to get really close to desired base current.
so when transistor is on (5mA into the base), PWM voltage is 0.1V or so (transistor saturated).
when transistor is off (0mA into the base), PWM voltage is 5V or so (through pullup resistor).

and that is just fine - PWM would work well for circuit on the left.

but there is a problem with the circuit on the right since base must be some 0.7V higher than emitter. and emitter must be able to reach 5V. that means base would need to be at some 5.7V relative to -Vin terminal.

no problem we just calculate our base resistor like before:

3.3V - 5.7V = -2.2V (this is for MCU with 3.3V output).
or
5V-5.7V = -0.7V (this is for MCU with 5V output).

the problem here is that resistors would also need have negative resistance values.
-2.2V/5mA= -440 Ohm
and
-0.7V/5mA=-140 Ohm.

of course resistors with such values do not exist so you would need a different circuit and more parts. that means adding level shifter to some voltage that is above 5.7V (some 7-9V sounds fine).

the simplest workaround is to use optocoupler as a level shifter:
1736534545330.png
 
Last edited:

BobTPH

Joined Jun 5, 2013
11,466
I must be missing something. Why can you not just connect the output to all 3 drivers directly? It is very unlikely that the PWM input takes anywhere near the max current the output can supply.
 

sghioto

Joined Dec 31, 2017
8,633
I must be missing something. Why can you not just connect the output to all 3 drivers directly? It is very unlikely that the PWM input takes anywhere near the max current the output can supply.
I agree which is the reason for my questions in my previous post.
 

schmitt trigger

Joined Jul 12, 2010
2,035
Reading the data sheet, I am with Bob that a microcontroller’s port should be capable of directly driving all three modules, as long as the negative common rail is the same for all the devices.
 

Thread Starter

xenolalia

Joined Jun 14, 2011
10
Thanks all for the comments. My original post didn't have all of the relevant info - my apologies.
Correct, left circuit should work as is.
What is the PWM voltage?
Which dimmer model the LDD-300-700L or the LDD-1000L ?
My MCU uses a logic level of 3.3V and I will be using the LDD 300-700L model driver, which requires a logical high above 3.5V. Thus, at the least, I need some kind of switch (transistor, optocoupler, whatever) to act as a level shifter.
I must be missing something. Why can you not just connect the output to all 3 drivers directly? It is very unlikely that the PWM input takes anywhere near the max current the output can supply.
I didn't have enough experience to know whether the dimmer input would likely take too much current from the MCU, so the transistor seemed desirable from that point of view as well. But thank you for setting me right on this point.
the simplest workaround is to use optocoupler as a level shifter:
Is there any reason to prefer the solution with an optocoupler over some version of the circuit on the left (with or without an additional pull-up resistor)? And am I right in thinking that a FET (or a FET-output optocoupler) would be overkill?
 
Last edited:

sghioto

Joined Dec 31, 2017
8,633
Don't need anything else but the npn transistor as configured in the left circuit.
The only other possible issue is that the PWM signal is reversed going into the dimmer.
 

Thread Starter

xenolalia

Joined Jun 14, 2011
10
Don't need anything else but the npn transistor as configured in the left circuit.
Do you foresee any problem with joining all the LDD dimming inputs together? The alternative would be to assign a separate transistor to each driver.
The only other possible issue is that the PWM signal is reversed going into the dimmer.
I don't think this matters, since it is trivial to invert the PWM signal programmatically. However, out of curiosity, do you have in mind a particular configuration that wouldn't introduce the sign flip - perhaps with a depletion mosfet or something similar?
 

Thread Starter

xenolalia

Joined Jun 14, 2011
10
"high-powered ones". A part number would be better.
My question wasn't about the LEDs (which are Luxeon C's) but rather the dimming control aspect, so I didn't think it was necessary to provide that detail. I'm quite happy with the Mean Well drivers.
 

BobTPH

Joined Jun 5, 2013
11,466
Thanks all for the comments. My original post didn't have all of the relevant info - my apologies.
My MCU uses a logic level of 3.3V and I will be using the LDD 300-700L model driver, which requires a logical high above 3.5V.
Leaving out this detail meant we were all answering the wrong question. What you needed was a level translator, not a higher current driver as you implied.
 
Top