my mood lamp design

Thread Starter

elimenohpee

Joined Oct 26, 2008
47
Hi everyone,

I'm venturing into my first "real" design outside of my lab at school. I thought I'd just do a simple mood lamp using 3 3.5W RGB leds. I just wanted someone to check my schematic and make sure the math/design looks suitable. I'm using a atmega168 to drive the darlington array which will provide the power to the leds. The idea here was to PWM each red, blue, and green from the same PWM pin since there are only 6 PWM pins on the chip. Therefore, I chose the resistor coming from the PWM to be 4.7kΩ, which will provide about 1mA, but current divides 3 ways into the base of each arrary. β for the array is about 1000, so that would put me at about 350mA for each led. Leds are common anode, so I chose 4Ω and 10Ω 1Watt resistors to drop part of 5V to get the desired drop across the led. I'm debating on using a single transistor for the last array since I won't really need to use the rest of the inputs there, but I haven't made up my mind since I have a bunch of them just laying around. Any comments?
 

SgtWookie

Joined Jul 17, 2007
22,230
Hi everyone,

I'm venturing into my first "real" design outside of my lab at school. I thought I'd just do a simple mood lamp using 3 3.5W RGB leds.
It would help a lot if you would attach a datasheet for your RGB LEDs.

I just wanted someone to check my schematic and make sure the math/design looks suitable.
Unfortunately, your schematic image is in .jpg format. This is not desirable, as .jpg is a "lossy" format; line drawing images get very fuzzy. .png format is far better for such images, as they are compact without being lossy.

You can attach the image here by using the "Go Advanced" button, then "Manage Attachments", and select your image file from your hard drive.

I'm using a atmega168 to drive the darlington array which will provide the power to the leds.
Darlingtons are convenient, but might be minimal for your application. ULN2003/ULN2803 drivers have a max sink of around 350mA per output. If you are using more than one channel, the sink is more limited.

The idea here was to PWM each red, blue, and green from the same PWM pin since there are only 6 PWM pins on the chip.

Therefore, I chose the resistor coming from the PWM to be 4.7kΩ, which will provide about 1mA, but current divides 3 ways into the base of each arrary. β for the array is about 1000, so that would put me at about 350mA for each led.
Don't depend on the hFE of the array to regulate current. Your mileage will vary. You will wind up dissipating a lot of power in the array, and rapidly overheat it.

Leds are common anode, so I chose 4Ω and 10Ω 1Watt resistors to drop part of 5V to get the desired drop across the led.
Resistors are a brute-force method to limit current. They work OK for small LEDs that run on 10mA-20mA current, but will turn into room heaters for high power LEDs. You really need to use dedicated LED driver ICs that use buck-type current limiting. On some of them, you can adjust the output current by
varying the DC level on an input pin. You could accomplish that directly by using a DAC output, or by using PWM and an RC filter.

However, since you've selected RGB LEDs instead of individual R, G, B LEDs, you're going to have to use some small value of resistance to parallel them - even if you're using a constant current supply.
 

Audioguru

Joined Dec 20, 2007
11,248
The writing on your fuzzy JPG file type schematic is tiny and pastel so it is impossible to see.
Please attach a very clear PNG file type schematic here instead of a fuzzy JPG over at PhotoBucket.

β is used for linear transistors that have plenty of collector-emitter voltage. For the ULN2001 it is 2V. The darlingtons are shown to saturate pretty well when the base current is 1/700th of the collector current.

Why not use ULN2003 darlington arrays that have the series base resistors built-in?
 

Thread Starter

elimenohpee

Joined Oct 26, 2008
47
The writing on your fuzzy JPG file type schematic is tiny and pastel so it is impossible to see.
Please attach a very clear PNG file type schematic here instead of a fuzzy JPG over at PhotoBucket.

β is used for linear transistors that have plenty of collector-emitter voltage. For the ULN2001 it is 2V. The darlingtons are shown to saturate pretty well when the base current is 1/700th of the collector current.

Why not use ULN2003 darlington arrays that have the series base resistors built-in?
I was using these arrays only becuase I have a bunch just laying around from past labs. Does it not seem to be saturated well enough in my design? BTW these are ULN2003A arrays
 

SgtWookie

Joined Jul 17, 2007
22,230
Your S1 will not function as desired. As S1 is connected now, RESET will be "floating"; not connected to anything - and the 10k resistor will just be a drain on the 5v supply, for no apparent reason.

I do not know if your uC requires +5 or 0v on RESET for operation.
With PIC uC's, the RESET/MCLR pin is tied to 5v using a 10k resistor. If RESET is desired, 0v is applied to the RESET/MCLR input.


A few helpful notes on Cadsoft Eagle:
1) Use the VALUE tool on the left menu bar to indicate the value of the component, rather than using plain text. If you use the VALUE tool, the component value will also show up in the board layout, anchored to the component. Click the Value tool, then click the component to change. The Value tool looks like a resistor with "10K" in bold underneath.

2) Use the NAME tool to change a component's reference designator; ie: R1, ULN1, etc. For example, your crystal has a NAME of U$1. You may wish to change it to XTAL1. You may also wish to indicate the frequency using the VALUE tool. It's to the left of the VALUE tool; R2 in bold.

3) I like to use the Vcc and GND symbols in the supply-2.lbr rather than those in the supply-1.lbr; I find them easier to read.

4) Placing supply symbols will place "air wires" to interconnect everything on the board, but you will need to use some kind of connector or wirepad to get an external connection point, and connect the symbols to them.

4) Use the Erc function regularly. If you don't, you will have a big mess if you create a board.

5) Junctions - you usually only need them when connecting one (or more) wire(s) together. The Erc function will tell you if you are missing junctions.
 

SgtWookie

Joined Jul 17, 2007
22,230
We still don't know what kind of current your LEDs require. Please post their specifications. "3.5 Watts" is simply too generic.

For example:
Red - typ Vf=3.0v @ 350mA, max Vf=3.4v
 

Thread Starter

elimenohpee

Joined Oct 26, 2008
47
Sorry, this is my first time using Eagle, and I've been trying to search around for good Eagle tutorials, but haven't had much luck. And lol yeah I just realized I put the resistor on the wrong side of the switch. On the atmega168 when RESET is triggered high, it resets the device. This was meant to just mock something up, and I was doing it really fast. Not to mention I designed this whole thing in about 5 minutes.

Here's a data sheet for the leds. http://pdf1.alldatasheet.net/datasheet-pdf/view/274404/LUMEX/SML-LX1610RGBW+A.html

Vf for red is 2.1V and 300mA, Vf for blue and green is 3.5V and 350mA. I understand the reason to couple these together to eliminate the need for resistors, but they are expensive ($7 each) and I just didn't want to spend $50 just on leds.
 

Thread Starter

elimenohpee

Joined Oct 26, 2008
47
I have a quick question as how to tell whether the transistor is saturated or not. I have 5V from the source, then 3.5V is dropped across the led, and the remainder 1.5V dropped across the resistor feeding into the collector. The emitter voltage is 0 obviously, and based on the input base current, I should have about 350mA flowing from collector to emitter. How do I determine Vce? It looks as if all the voltage is dropped across the led and resistor, but it can't be 0 at the collector?
 

SgtWookie

Joined Jul 17, 2007
22,230
Not if you are using a Darlington.
Darlington Vce starts at around 600mV with light loads, and goes up to around 1.3v or so before the package power dissipation limit is reached.

Look at datasheets from Allegro, Motorola/ONsemi, and other manufacturers. ST Microelectronics goofed up on their Ic vs saturation voltage plot; they swapped the "typical" and "maximum" titles around.

You might consider using logic-level power MOSFETs instead. IRLD014's and IRLD024's are nifty little 4-pin DIP power MOSFETs capable of sinking 1.7A and 2.5A respectively, and can be driven right from your uC's output pin.
 

Audioguru

Joined Dec 20, 2007
11,248
The datasheet for the ULN2003A shows that it already has a series base resistor but you added another one which has too high resistance. So the ULN2003A darlingtons cannot saturate. The collector of the darlington is supposed to be 2V (not low enough for your LEDs) or less at 300mA if its input voltage is 3.0V but your extra input resistors spoil it.
 

Thread Starter

elimenohpee

Joined Oct 26, 2008
47
The datasheet for the ULN2003A shows that it already has a series base resistor but you added another one which has too high resistance. So the ULN2003A darlingtons cannot saturate. The collector of the darlington is supposed to be 2V (not low enough for your LEDs) or less at 300mA if its input voltage is 3.0V but your extra input resistors spoil it.
So basically, I don't need any resistors leading into the collector? I'm just a little confused now, I thought the point of operating the transistors as a switch was to have a low a Vce as possible.
 

SgtWookie

Joined Jul 17, 2007
22,230
You must use some form of current limiting, either via resistors or via active current regulation.

As LEDs and other PN semiconductors increase in temperature, their Vf decreases; a negative temperature coefficient. If there is no current limiting, the decrease in Vf will result in an increase in current, which causes yet greater power dissipation in the PN junction, more heat, and further decrease ... this is called "thermal runaway", and will rapidly result in a melt-down.

Curiously, MOSFETs have a positive temperature coefficient; the hotter they get, the more their internal resistance, which tends to limit the current flow through the device.
 

Thread Starter

elimenohpee

Joined Oct 26, 2008
47
You must use some form of current limiting, either via resistors or via active current regulation.

As LEDs and other PN semiconductors increase in temperature, their Vf decreases; a negative temperature coefficient. If there is no current limiting, the decrease in Vf will result in an increase in current, which causes yet greater power dissipation in the PN junction, more heat, and further decrease ... this is called "thermal runaway", and will rapidly result in a melt-down.

Curiously, MOSFETs have a positive temperature coefficient; the hotter they get, the more their internal resistance, which tends to limit the current flow through the device.
I'm way past confused now, I thought someone said it had built in resistors and the biasing scheme would be messed up if I included the external resistors :(
 

Audioguru

Joined Dec 20, 2007
11,248
So basically, I don't need any resistors leading into the collector? I'm just a little confused now, I thought the point of operating the transistors as a switch was to have a low a Vce as possible.
Of course you need the resistors in series with the collectors to limit the current.

I said to remove the extra series base resistors because the darlingtons in the ULN2003a have them already built-in.

But they have a 2V max saturation voltage so your LEDs might not get enough voltage to turn on.
 

Attachments

Thread Starter

elimenohpee

Joined Oct 26, 2008
47
Of course you need the resistors in series with the collectors to limit the current.

I said to remove the extra series base resistors because the darlingtons in the ULN2003a have them already built-in.

But they have a 2V max saturation voltage so your LEDs might not get enough voltage to turn on.
Oh ok that makes sense, I thought the built resistors were at the collector. My only concern now is making sure I'm in the correct saturation point. I didn't take note of this earlier. Vce @ 350mA is 1.2V. So I'm dropping 3.5V on the blue diode for example, then the remaining 1.5V on the 4Ω resistor. How exactly would I calculate the voltage AT the collector? The emitter voltage will be 0 obviously, I just want to make sure that I'm saturating correctly/efficiently.

Thanks for all the help and input so far too!!
 

Audioguru

Joined Dec 20, 2007
11,248
If the LED is 3.5V (it might be more), the saturation voltage of the darlington is 1.6V and the power supply is 5.0V then the LED does not have enough voltage to light because the total required without any current in the 4 ohm resistor is 5.1V.
If you want 350mA then the 4 ohm resistor will have 1.4V so you need a 6.5V power supply.
 

Thread Starter

elimenohpee

Joined Oct 26, 2008
47
If the LED is 3.5V (it might be more), the saturation voltage of the darlington is 1.6V and the power supply is 5.0V then the LED does not have enough voltage to light because the total required without any current in the 4 ohm resistor is 5.1V.
If you want 350mA then the 4 ohm resistor will have 1.4V so you need a 6.5V power supply.
Makes sense. What if I wasn't to include the resistor? That would leave the desired 1.5V at the collector. I mean is it worth putting a 1Ω resistor in there? Seems like bad practice not to include one, but if the collector current is already specified by the base current, is the resistor really needed?
 

THE_RB

Joined Feb 11, 2008
5,438
That question was already answered above.

My suggestion would be to ditch the ULN chips and just use 3 transistors with 3 base resistors. Your control system only has 3 drives. 3 transistors is simpler and easier to wire and less PCB space. It should also be more rugged with the right transistors.

And yes you also need resistors in series with the LEDs.
 
Top