Dual BJT constant current driver help

Thread Starter

EEENg

Joined Apr 4, 2024
15
Hey guys, I’m designing a constant current driver for Li-Fi applications. I chose to undertake the dual BJT constant current driver as I had success with it in the past.

I’m using Q1 Tip31cg https://www.onsemi.com/pdf/datasheet/tip31a-d.pdf

Q2 2N3904 https://www.onsemi.com/pdf/datasheet/2n3903-d.pdf.

the LED I’m currently using is XQE high intensity white led https://downloads.cree-led.com/files/ds/x/XLamp-XQE.pdf.

The LED can take up to 1.5A but I’m only designing it to get it to 1A.

As mentioned before this is for Li-Fi and the modulated signal will be coming in place of the 3.3v (from a teensy).

I previously used a supply voltage of 5v but had issues with the LED not getting enough current as designed. I assumed and attributed it towards the voltage drop of the circuit being more than the supply so now I moved it to 12v.

According to my calculations my RL which dictates the current through my LED should be 0.7 (assuming Vbe of Q2 is 0.7).

R1 in this case is just to ensure that there is enough current to bias Q1 and Q2. I believe this is where my troubles are. I chose a DC gain of 25 because it is roughly around the 10 min and 50 max, giving R1 as 82 ohms. But it doesn’t seem to be biasing. Even if I take out Q2, in theory the current should spike up but it remains the same. Do I need to account for the voltage drop across the resisto? Am I not giving Q1 or Q2 enough current?

As it currently stands when I’m using R1 as 82 ohms and RL as 1 Ohms IL should be 0.7A, but it is showing 0.999A through the 12v supply (power supply capped at 30v and 1A). The power Supply is capped at 1A, making the 12v only being roughly around 1 when seen on the power supply.

When RL is changed to 100 ohms, it displays the same characteristic where the power supply is capped at 1A through LED but the voltage is capped at 11.4v. I’m scared that when we use a non capped power source that the 12v would give it excess current given that it can’t even follow the basics of this circuit.

would love help to determine what’s wrong with my circuit as it’s been over 3 weeks and no progress has been made.
best regards Kane.
 

Attachments

Ian0

Joined Aug 7, 2020
10,001
There's one thing you have forgotten.
How much current can your 3.3V source actually supply?
If it's from a microcontroller, it will be about 4mA.

My suggestion:
Remove Q2 and short out R1.
Swap Q1 for a darlington.
Calculate R2 for (3.3-Vbe)/Idiode, remembering that Vbe is 1.3V for a Darlington.
 

eetech00

Joined Jun 8, 2013
4,004
I haven't tested this but,
Replace Q1 with low VGS(th), 5A, NMOS mosfet.
Increase R1 to permit a reasonable load (1ma) thru C/E of Q2 (not critical).
Change RL to 0.7 ohms.
 

Ian0

Joined Aug 7, 2020
10,001
I haven't tested this but,
Replace Q1 with low VGS(th), 5A, NMOS mosfet.
Increase R1 to permit a reasonable load (1ma) thru C/E of Q2 (not critical).
Change RL to 0.7 ohms.
Yes. That would work too, provided you found a MOSFET with low enough Vgs(th)
 

Thread Starter

EEENg

Joined Apr 4, 2024
15
There's one thing you have forgotten.
How much current can your 3.3V source actually supply?
If it's from a microcontroller, it will be about 4mA.

My suggestion:
Remove Q2 and short out R1.
Swap Q1 for a darlington.
Calculate R2 for (3.3-Vbe)/Idiode, remembering that Vbe is 1.3V for a Darlington.
That is an issue that I have yet to come across but it’s been something in the back of my mind.
If I may ask a few clarifying questions, why would you remove Q2 and short out R1? Wouldn’t that remove the whole feedback and hence the constant current.
I am very unfamiliar with Darlington transistors, but seems like two pairs of transistors connected together to amplify the current. Is this such that it can amplify the current through the load? If possible an explanation will be great.
What would R2 also be exactly? Just confused of where the equation is applied within the circuit. Thank you so much again.
 

Thread Starter

EEENg

Joined Apr 4, 2024
15
I haven't tested this but,
Replace Q1 with low VGS(th), 5A, NMOS mosfet.
Increase R1 to permit a reasonable load (1ma) thru C/E of Q2 (not critical).
Change RL to 0.7 ohms.
Hey mate thanksfor your reply, im pretty new when it comes to electronics but a lowVGS mean? And why does it help my circuit? I’m trying to seek answers online but just seems like a very foreign concept.

from my understanding it seems like the TIP31CG should be perfect for the job (according to my understanding of the data sheets) but just a bit confused as of why my current configuration is not working. Cheers!
 

Thread Starter

EEENg

Joined Apr 4, 2024
15
Below is the LTspice sim of the circuit using a Darlington to reduce the required base current:

View attachment 319556
This is actually pretty excellent, would I be able to gain the LTSpice file for this? I’ve tried constructing it myself but the custom components aren’t really working out for me. But this is exactly what I would want to experiment and mess around with.

A question as well with this Darlington, can I just construct it in that configuration withjust a 2N3904 and TIP31CG? Or do I have to buy a specialist “Darlington” transistor? Thank you very much
 

Ian0

Joined Aug 7, 2020
10,001
from my understanding it seems like the TIP31CG should be perfect for the job (according to my understanding of the data sheets) but just a bit confused as of why my current configuration is not working. Cheers!
because the TIP31 needs a base current equal to collector current divided by hfe, and the microcontroller is unable to provide that current
 

Ian0

Joined Aug 7, 2020
10,001
That is an issue that I have yet to come across but it’s been something in the back of my mind.
If I may ask a few clarifying questions, why would you remove Q2 and short out R1? Wouldn’t that remove the whole feedback and hence the constant current.
I am very unfamiliar with Darlington transistors, but seems like two pairs of transistors connected together to amplify the current. Is this such that it can amplify the current through the load? If possible an explanation will be great.
What would R2 also be exactly? Just confused of where the equation is applied within the circuit. Thank you so much again.
The feedback is via the emitter resistor. There is no need for the extra transistor.
A darlington behaves exactly the same as a single transistor with lots of gain, except for two things:
the base-emitter voltage is 1.2V instead of 0.6V
the minimum collector-emitter voltage when fully on is 0.6V.
and it really is two transistors connected together to increase the gain, either in two separate packages, or made as two transistor on a single piece of silicon.
With the base at 3.3V, the voltage across base and emitter will be about 1.3V, so that leaves 2V across the current sense resistor (R2)
 

crutschow

Joined Mar 14, 2008
34,679
I just construct it in that configuration withjust a 2N3904 and TIP31CG?
Yes.
The feedback is via the emitter resistor. There is no need for the extra transistor.
Except that now the current depends upon the 3.3V source voltage, and has two base-emitter drop variations with temperature instead of one.
So depends upon whether that extra variation could be a problem.
 

eetech00

Joined Jun 8, 2013
4,004
Hey mate thanksfor your reply, im pretty new when it comes to electronics but a lowVGS mean? And why does it help my circuit? I’m trying to seek answers online but just seems like a very foreign concept.

from my understanding it seems like the TIP31CG should be perfect for the job (according to my understanding of the data sheets) but just a bit confused as of why my current configuration is not working. Cheers!
Expanding on lan0 comments, the TIP31CG (or any BJT) requires base current to operate. The output current from a MCU output pin is very limited and can't provide the base current required for the BJT transistor to operate. A mosfet doesn't require much current (micro amps) to operate and can provide as much, or more, current to the load. The internal structure of the mosfet between the source and drain can be thought of as a resistor that, in your application, changes (when switched off to on via voltage applied to the "gate") from a very high value (mega ohms) to a very low value (usually milli ohms). If chosen correctly, the mosfet will not require heatsink. VGS(th) is a specified voltage threshold value that is the voltage required to turn the mosfet "on". The sim below shows the circuit status with the mosfet "on".

1712764155513.png
 

Ian0

Joined Aug 7, 2020
10,001
Yes.
Except that now the current depends upon the 3.3V source voltage, and has two base-emitter drop variations with temperature instead of one.
So depends upon whether that extra variation could be a problem.
The temperature dependence is the opposite way round as well, but varies less. Using 2mV/°C as the figure for 1 junction, it is +4mV/°C in 2V, rather than -2mV/°C in 600mV, which is an improvement from 0.333% to 0.2%.
The transistor losses reduce,but the resistor losses increase, but overall losses remain the same, but headroom reduces.
. . . All sorts of things to consider.
 

Thread Starter

EEENg

Joined Apr 4, 2024
15
The feedback is via the emitter resistor. There is no need for the extra transistor.
A darlington behaves exactly the same as a single transistor with lots of gain, except for two things:
the base-emitter voltage is 1.2V instead of 0.6V
the minimum collector-emitter voltage when fully on is 0.6V.
and it really is two transistors connected together to increase the gain, either in two separate packages, or made as two transistor on a single piece of silicon.
With the base at 3.3V, the voltage across base and emitter will be about 1.3V, so that leaves 2V across the current sense resistor (R2)

Ah that makes sense, but in saying that the Base emitter of the darlington pair should not change my value of R_L? since itsonly dependent on the Vbe of Q2?
 

Ian0

Joined Aug 7, 2020
10,001
OK.
the voltage at the base is 3.3V
the voltage at the emitter is 1.2V lower than the voltage at the base (1.2V because it’s a Darlington, it would be 0.6V for a normal transistor).
so the voltage across the resistor is 3.3-1.2V = 2.1V
so the current is 2.1V/R

The base current required is Ic/hfe. You can use the normal value for hfe as the transistor is not saturated.
That current has to be provided by the processor output which is limited to perhaps 4mA, so you need a Darlington as that isn’t enough for a normal transistor.
 

Thread Starter

EEENg

Joined Apr 4, 2024
15
Yes.
Except that now the current depends upon the 3.3V source voltage, and has two base-emitter drop variations with temperature instead of one.
So depends upon whether that extra variation could be a problem.

I finally had time to go construct your circuit. Only variation Is that I'm currently using a 0.47 ohms load resistor.

The problem I'm having again is that it doesn't reach the desired current value. In theory with a load resistor of 0.47 ohmsthe current should exceed 1A. The power supply I'm using caps at 1A but the current value through the 12V isn't even reaching that. Another funny behaviour is that for aboutthe first 30 seconds it increases 0.600A to 0.700A. Then it fluatuates around 0.700-0.730A.Somtimes it even exceeds this value and keeps on increasing.

When I put a 1 ohm resistor for the load, it increases and decreases at around 0.630, sometimes dipping to 0.500A and increasing to 0.700A.

It is never consistent, even as I'm writing this it is constantly changing. So I'm just not quite sure what I'm doing wrong

Ill attach a video ( https://drive.google.com/file/d/1p2gK1b_gGH0gmkvIaL9NyrqpXZ4xZEHZ/view?usp=sharing ) build on the breadboard. But im almost certain I've built it right.

Would I be able to obtain the file for your LTSpice circuit aswell?

Thank you again so much for your assistance.
 

Thread Starter

EEENg

Joined Apr 4, 2024
15
OK.
the voltage at the base is 3.3V
the voltage at the emitter is 1.2V lower than the voltage at the base (1.2V because it’s a Darlington, it would be 0.6V for a normal transistor).
so the voltage across the resistor is 3.3-1.2V = 2.1V
so the current is 2.1V/R

The base current required is Ic/hfe. You can use the normal value for hfe as the transistor is not saturated.
That current has to be provided by the processor output which is limited to perhaps 4mA, so you need a Darlington as that isn’t enough for a normal transistor.
Ah yes thank you so much, Im pretty sure its making sense so far. The darlington in short can be turned on with minimal current which would suit the output of a microcontroller.

But my issues now is just getting that previous circuit that crutschow did up on LTSpice to work like it should, the behaviour is just no where near.
 

Thread Starter

EEENg

Joined Apr 4, 2024
15
Expanding on lan0 comments, the TIP31CG (or any BJT) requires base current to operate. The output current from a MCU output pin is very limited and can't provide the base current required for the BJT transistor to operate. A mosfet doesn't require much current (micro amps) to operate and can provide as much, or more, current to the load. The internal structure of the mosfet between the source and drain can be thought of as a resistor that, in your application, changes (when switched off to on via voltage applied to the "gate") from a very high value (mega ohms) to a very low value (usually milli ohms). If chosen correctly, the mosfet will not require heatsink. VGS(th) is a specified voltage threshold value that is the voltage required to turn the mosfet "on". The sim below shows the circuit status with the mosfet "on".

View attachment 319652
Just tried out tour implementation on a breadboard. Im fairly new to MOSFETs but grabbed the one that looked most suited K1336. The current itself coming from the GPIO seems very small so that's great! The only problem now is that the MOSFET is getting real real real hot. Im just inhaling melting plastic at this point. THe current for the most part seems stable at around 0.28A when using a 0.47 ohm resistor. It tends to fluxature a small bit from 0.265-0.3A. What is the spice simulation saying? Should my current through load be that small?
 
Top