Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LED + Transistor puzzle.

Status
Not open for further replies.

Lunatic

New Member
Here's something I am working on and could use some help with.

Project description: Turn 8 Luxeon Star LEDs on/off via microcontroller, provide light controlled brightness adjust.

Achieved: Programmed microcontroller which provides 8 logic outputs (one for each luxeon star) as well as pulse width modulated output, whose duty cycle varies depending on the input from an optical sensor(CDS photocell read in through on-chip analog to digital converter then DAC byte is output to on-chip PWM function).

Problem. I am using a total of 9 transistors in this circuit. I have one large transistor to which the PWM signal is fed, this provides the 'dimming' of the circuit. from there the circuit connects to each luxeon star, who's cathod is connected to a resistor, which is connected to another transistor, which is connected to ground! (Did you follow that?)

+<---[ PWM xsister]---[LED1]---[Resistor]---[on/off xsistor]-------GND
|--[LED2]---[Resistor]---[on/off xsistor]-------GND
|--[LED3]---[Resistor]---[on/off xsistor]-------GND
|-----Etc...

The problem here is that the current through the luxeon star LEDs is supposed to be 350mA with a forward voltage of 2.8 volts. I am using a 5 volt supply, with a current limiting resistor of 7.4 ohms (closest I could get to the 6.3 I needed, at the moment) With the transistors out of the picture for a moment the LED draws 330ma. The problem is with the LEDs in the circuit. The PWM brightness control and the on/off transistors work. However, the most power I can get to go through the LEDs is a mere 80ma.. completely unacceptable and dim.. Even if I bypass the current limiting resistors the LEDs are dim. If I bypass the on/off xsistors they get MUCH brighter and use about 300ma worth of current.

If you have any realistic ideas as to why this is not working properly, or a better design suggestion please let me know. Thanks
 
Sounds like your on/off transistors are eating up your current before it gets to the LED. Could you post a schematic of the circuit and the part number of the on/off transistor.

How did you calculate the LED's dropping resistor.
 
Switching transistors

There are four possible combinations of PNP and NPN transistors here - we need to know at least which is what type.

I would expect the PWM transistor is a PNP and the switchig transistors are NPN (that way all work as common emitter giving the least volts-drop) :?:

If this is not the case then you will be losing at least 0.7v across the transistor ...
 
This may be my problem, I am running all NPN transistors in the circuit. I have attached a copy of the circuit(15k or so) to this message. The dropping resistors were calculated as follows.(for the 2.8 volt LEDs) Please ignore the resistor values shown in the schematic

vIn = 5v
LedI= 350ma
LedV= 2.8v

vIn - LedV = 2.2v
2.2v/LedI = 6.3ohms (If wanted 350ma)

For these LEDs (red, green, etc have different voltages obviously) I am running 8.5 ohms(measured value) which should give me a current of ~260ma to the LED, which is the reading I get with just the LED and resistor and no other electronics.

I don't run them full power as they are not mounted to their heatsink yet. As I state though, even with their resistors completely bypassed in the circuit, these LEDs will not draw more than 80ma. If I bypass one the 2n2222's the current draw goes up to what I would expect. But bypassing the TIP120 has minimal effect for what its worth.

**broken link removed**
 
I just tried this with PNP>PNP, NPN>PNP and PNP>NPN and although I am getting better results(180ma current draw) the transistors are still limiting the current. Do I just need to go to a voltage higher than 5V or is there another option? I'm trying to keep the voltage low so I don't have to waste a lot of power as heat in the resistors.
 
NPN vs PNP

Kinjal:
If PNP is used for the ON/OFF (your diagram Q2) then if the base is taken to 0v the best the emitter can achieve is 0.7v in order to be biassed on. This transistor will therefore 'waste' 0.7v, hence my comment of NPN for this role.

Lunatic:
Your comment of the 2N2222 having an effect on the current -- I wonder what value base resistor you have ...
hfe = 100 (ish)
Ic = 350mA
therefore assuming the control voltage goes as high as 5v...
Ib = 3.5mA so Rb must be 1k2 or less ? (your R6 to R9).

As for the darlington (your drawing is wrong - emitter is opposite end of resistor, connected to diode anode) I would expect to lose over a volt across this as you are using it as an emitter follower :!:

IDEA :idea:
Could you swap everything around - have the darlington emitter to 0v, collector to LEDs (re-arranged as common cathode) then smaller PNP switching transistors for each LED.
 
Am I going about this all wrong? I thought about this, and came up with the following. Use 8 transistors to turn on and off the LED's. Then use an Octal line driver/buffer such as a 74HC241 connected between my micro-controller output lines and the transistor gates/base. Then connect the PWM to the output enable lines? This makes things more digital, which is more in my domain and abilities by eliminating some transistors and incorporating the PWM into on/off data lines before they reach the transistors.
 
Your problem might be the voltage drop across the collector-emitter junctions in addition to your base-emitter drop in your common-for-all-leds-transistor.
Try using mosfets. I usually stick to IRF1010 and IRF 4095 as i hve tons of them, but almosta any power type should do. They have no drain-source voltage but a resistance when switched on. 10 milli (!) ohms to 300 milli ohms. At 330mA, you only loose a few millivolt instead of 0,7 volt or more for a collector-emitter junction.
Aside from that, mosfets are even easier to interface (no resistors for the base needed). Use a P-Channel (PNP-kind of mosfet) for your common transistor-for-all-eight-leds and a N-channel type for your one-transistor-for-each-led. This helps to prevent any dropout due to gate-source voltage.

BTW: Where did you get the luxeons ? How much do they cost ? (Too lazy to search for myself)
 
Lunatic said:
Am I going about this all wrong? I thought about this, and came up with the following. Use 8 transistors to turn on and off the LED's. Then use an Octal line driver/buffer such as a 74HC241 connected between my micro-controller output lines and the transistor gates/base. Then connect the PWM to the output enable lines? This makes things more digital, which is more in my domain and abilities by eliminating some transistors and incorporating the PWM into on/off data lines before they reach the transistors.

This makes a lot of sense. Use logic-level MOSFETs and connect a 10k resistor from each driver output to ground to keep the gates from floating.
It may require more base current than you realize to saturate a 2N2222 at Ic=350ma. The rule of thumb for saturation is Ic/Ib=10. This is 35ma base current! You can probably get away with Ic/Ib=20, but definitely not 100. MOSFETs start to look pretty good when you come to this realization.
 
Lunatic said:
Am I going about this all wrong? I thought about this, and came up with the following. Use 8 transistors to turn on and off the LED's. Then use an Octal line driver/buffer such as a 74HC241 connected between my micro-controller output lines and the transistor gates/base. Then connect the PWM to the output enable lines? This makes things more digital, which is more in my domain and abilities by eliminating some transistors and incorporating the PWM into on/off data lines before they reach the transistors.

This makes a lot of sense. Use logic-level MOSFETs and connect a 10k resistor from each driver output to ground to keep the gates from floating.
It may require more base current than you realize to saturate a 2N2222 at Ic=350ma. The rule of thumb for saturation is Ic/Ib=10. This is 35ma base current! You can probably get away with Ic/Ib=20, but definitely not 100. MOSFETs start to look pretty good when you come to this realization.
 
Lunatic said:
Am I going about this all wrong? I thought about this, and came up with the following. Use 8 transistors to turn on and off the LED's. Then use an Octal line driver/buffer such as a 74HC241 connected between my micro-controller output lines and the transistor gates/base. Then connect the PWM to the output enable lines? This makes things more digital, which is more in my domain and abilities by eliminating some transistors and incorporating the PWM into on/off data lines before they reach the transistors.

This makes a lot of sense. Use logic-level MOSFETs and connect a 10k resistor from each driver output to ground to keep the gates from floating.
It may require more base current than you realize to saturate a 2N2222 at Ic=350ma. The rule of thumb for saturation is Ic/Ib=10. This is 35ma base current! You can probably get away with Ic/Ib=20, but definitely not 100. MOSFETs start to look pretty good when you come to this realization.
 
The other reason of low current may be that he is measuring pulsating current (due to PWM) through LEDs which will be less than the continuous current that he is expecting.
 
Multiple posts

I was getting an error message, and the topic wasn't moving to the top of the list when I refreshed, so I thought it wasn't posting. :(
 
Thanks for the suggestions guys, here's what I got going.

I built this up on a breadboard and it worked fine, the PCB's are being manufactured as I type.

The Mega8 uC receives it's data through the TWI/I2C bus, it then sets the port bits appropriately where they are then fed into the 74FCT541 buffer chip which comes with two enable lines. One enable line is grounded (or always on) the other is connected to the PWM master drive which comes from the master control board. The 74FCT541 drives 2 ULN2003A darlington driver IC's which drive the 8 LEDs at an acceptable current rating. I know the 2003A's have 7 drivers, but due to thermal dissipation I can only run 4 channels at a time and still stay in spec. At any rate it works great and runs cool, just thought I would update, hate to leave a thread open ended.

**broken link removed**
 
This works... Mega8 uC --> 74541 -> 2 x ULN2003 2x the ULNs due to power dissipation and the current required by the LEDs :) Runs cool, runs bright, works great.

**broken link removed**
 
Not posting?

This works... Mega8 uC --> 74541 -> 2 x ULN2003 2x the ULNs due to power dissipation and the current required by the LEDs :) Runs cool, runs bright, works great.

**broken link removed**
 
Not posting?

This works... Mega8 uC --> 74541 -> 2 x ULN2003 2x the ULNs due to power dissipation and the current required by the LEDs :) Runs cool, runs bright, works great.

**broken link removed**
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top