# How to dim an LED with constant current supply?

I have a power RGB led with 350 mA max per color. If I get 3x 300-350 mA constant power supplies will I be able to dim each individual color from 0 to 100% power with Arduino (with NPN transistors)?

I am a bit confused since constant current psu's are the best way to power led's but since they provide constant current can they be dimmed with pwm as one would expect with any power supply?

I am thinking of this PSU.

• This is a good video on how to implement it with a 555 Timer – Dean Dec 4 '12 at 9:39
• I'm very new to electronics so I think I will keep it simple for now and just usePWM of Aruino Uno, at least I know how it works :) – DominicM Dec 4 '12 at 21:02

Yes, you can use PWM to dim LEDs with constant current power supply.

Personally I would go with MOSFETs instead of NPN transistors. If nothing else MOSFET will dissipate less heat.

• Good to know! Why are mosfets better and by how much in my case? I have fairchild BC337 transistors and LM317T, are either of them suitable for the job? – DominicM Dec 4 '12 at 20:45
• MOSFETs have low on resistance and thus they will dissipate less heat when turned on. Drawback is that there is some gate capacitance and, depending on exact frequency, there is possibility of it heating up due to linear operation. Since you will be driving your LEDs at probably atmost at few hundred Hz, I doubt you will have a problem so almost any MOSFET will do. – Josip Medved Dec 5 '12 at 2:49
• Transistor needs voltage typically 0.6V accross junction. That means that you will always dissipate some heat. On other hand they are generally faster because there is no gate capacitance (which is moot point in this case since you don't need fast PWM). There is added complication of taking hfe into account to make sure you can deliver enough current from control pin. BC337 has hfe of 60 at 300mA so you should be ok with driving it from Arduino. – Josip Medved Dec 5 '12 at 2:49
• thanks for clarifying, I may go with single very high power led(15-30w) to avoid additional complexities with multiple led's. Can you think of a good mosfet or transistor to use with such high power led's(I'm not sure what to look for)? – DominicM Dec 5 '12 at 16:23
• That highly depends on what exact voltage and current you intend to use. Just search for MOSFET with rds as low as possible at given current (e.g. 10A). E.g. IPS040N03L G might be a good choice. – Josip Medved Dec 5 '12 at 22:46

I have used this constant current LED driver with success in the past. May be worth checking out. It can be controlled with an analog voltage or a PWM signal.

• Looks interesting but seems very expensive, 20$on mouser.com If I can use a 4.60$ psu to dim that's an easy choice :) I mean I might use 3 led's for more lumens meaning my led moodlight would cost well over 100\$ which is crazy expensive... – DominicM Dec 4 '12 at 20:36

As others have said, yes, it will work with PWM to control brightness. The name "constant current" is kind of misleading, I prefer "current limited". You can let the LED pull on the supply as hard as it wants, but it will only ever get 300 mA. If you shut off the LED the supply won't push harder than its rated voltage to force 300 mA through it. With the supply you linked that is 13 V, so it would just output 13 V and no current.