Forums

Is mcu pwm a decent way to control a power led current?

Started by Unknown June 19, 2014
I have a project whereby I am energizing a single 10W LED at 12 volts. 
I am controlling the current with a logic mosfet controlled by pwm from the mcu.

the questions are:
Is it useful to put a capacitor in parallel with the led? The idea is obviously 
to get smoothing.

Another issue is to monitor current by the mcu. This is not absolutely necessary, but wonder if there is a trick to get this measure. 

I am using an 18 pin picaxe, which is extremely easy to program. 

thanks in advance.
jb

<haiticare2011@gmail.com>
> >I have a project whereby I am energizing a single 10W LED at 12 volts. > I am controlling the current with a logic mosfet controlled by pwm from > the mcu. > > the questions are: > Is it useful to put a capacitor in parallel with the led? The idea is > obviously > to get smoothing.
** No. FFS get a fucking clue and get off this NG. Try " alt.electronics.wankers " .... Phil
On 19-Jun-14 8:13 PM, Phil Allison wrote:
> <haiticare2011@gmail.com> >> >> I have a project whereby I am energizing a single 10W LED at 12 volts. >> I am controlling the current with a logic mosfet controlled by pwm from >> the mcu. >> >> the questions are: >> Is it useful to put a capacitor in parallel with the led? The idea is >> obviously >> to get smoothing. > > ** No. > > FFS get a fucking clue and get off this NG. > > Try " alt.electronics.wankers " > > > > > ..... Phil > > > > > >
Bad hair day Phil?
On Thu, 19 Jun 2014 03:40:02 -0700 (PDT), haiticare2011@gmail.com
wrote:

>I have a project whereby I am energizing a single 10W LED at 12 volts. >I am controlling the current with a logic mosfet controlled by pwm from the mcu. > >the questions are: >Is it useful to put a capacitor in parallel with the led? The idea is obviously >to get smoothing. > >Another issue is to monitor current by the mcu. This is not absolutely necessary, but wonder if there is a trick to get this measure. > >I am using an 18 pin picaxe, which is extremely easy to program. > >thanks in advance. >jb
Above 100 Hz, flicker is not noticable. So forget the cap, it will cause more problems. Cheers
On Thu, 19 Jun 2014 03:40:02 -0700 (PDT), haiticare2011@gmail.com
wrote:

>I have a project whereby I am energizing a single 10W LED at 12 volts. >I am controlling the current with a logic mosfet controlled by pwm from the mcu.
--- You're controlling the _average_ current. ---
>the questions are: >Is it useful to put a capacitor in parallel with the led? The idea is obviously >to get smoothing.
--- No. depending on the capacitance, you'll kill the dimming effect of the PWM and, no matter what, you'll waste a lot of energy charging and discharging the cap. Version 4 SHEET 1 880 680 WIRE 432 32 112 32 WIRE 432 64 432 32 WIRE 432 176 432 144 WIRE 432 176 368 176 WIRE 368 208 368 176 WIRE 432 208 432 176 WIRE 368 304 368 272 WIRE 432 304 432 272 WIRE 432 304 368 304 WIRE 432 336 432 304 WIRE 256 384 208 384 WIRE 368 384 336 384 WIRE 112 448 112 32 WIRE 208 448 208 384 WIRE 112 560 112 528 WIRE 208 560 208 528 WIRE 208 560 112 560 WIRE 432 560 432 432 WIRE 432 560 208 560 WIRE 112 624 112 560 FLAG 112 624 0 SYMBOL voltage 112 432 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V1 SYMATTR Value 12 SYMBOL res 416 48 R0 SYMATTR InstName R1 SYMATTR Value 470 SYMBOL LED 416 208 R0 SYMATTR InstName D1 SYMATTR Value NSCW100 SYMATTR Description Diode SYMATTR Type diode SYMBOL npn 368 336 R0 SYMATTR InstName Q1 SYMATTR Value 2N3904 SYMBOL cap 352 208 R0 WINDOW 0 -23 2 Left 2 WINDOW 3 -48 57 Left 2 SYMATTR InstName C1 SYMATTR Value 100&#2013266101; SYMBOL voltage 208 432 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V2 SYMATTR Value PULSE(0 5 0 1u 1u 500u 1m) SYMBOL res 352 368 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R2 SYMATTR Value 2k TEXT 126 592 Left 2 !.tran 100m If you want smooth, increase the PWM frequency. ---
>Another issue is to monitor current by the mcu. This is not absolutely necessary, but wonder if there is a trick to get this measure.
--- No trick; it's pretty straightforward: . V1 . | . [Rs] . | . +-->V2 . | . [LED] . | . C . PWM>--[R]--B NPN . E . | . GND Knowing the supply voltage, V1, and the resistance of Rs, you take a slice of V2 with the on-board ADC - while the LED is ON - and have your MCU do: V1-V2 Iled = ------- Rs ---
>I am using an 18 pin picaxe, which is extremely easy to program.
--- Duck soup, then... John Fields
On Thu, 19 Jun 2014 03:40:02 -0700 (PDT), haiticare2011@gmail.com
wrote:

>I have a project whereby I am energizing a single 10W LED at 12 volts.
I assume that a "10 W" LED is a white LED (voltage drop about 3 V) with absolute maximum current of 3 A, so some marketing people talk about 10 W LEDs. If you really intend to run those LEDs at 3 A, you are going to have severe cooling problems, especially at higher environment temperatures. The phosphor life time is going to be very limited, perhaps only hundreds of hours, before the light output drops significantly. Except for intermittent flashlight applications, for general lighting, the maximum usable current for these "10 W" LEDS is about 1-1.5 A, when you have chances of getting 50000+ hour lifetimes. Unless dimming is required, I would suggest simply using three of those "10 W" LEDs in series at 1 A with a simple 2.7 ohm resistor to +12 V. For the generated (long time) lumens vs. current consumption from 12 V, the result will be better, since the efficiency [lm/W] drops quite fast when going from 1 A to 3 A.
On Thu, 19 Jun 2014 03:40:02 -0700 (PDT), haiticare2011@gmail.com
wrote:

>I have a project whereby I am energizing a single 10W LED at 12 volts. >I am controlling the current with a logic mosfet controlled by pwm from the mcu. > >the questions are: >Is it useful to put a capacitor in parallel with the led? The idea is obviously >to get smoothing. > >Another issue is to monitor current by the mcu. This is not absolutely necessary, but wonder if there is a trick to get this measure. > >I am using an 18 pin picaxe, which is extremely easy to program. > >thanks in advance. >jb
Capacitors "smooth" voltages Inductors "smooth" currents I'd suggest a classic buck (series inductor), with no output capacitor, and control the loop by sensing current. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
On Thu, 19 Jun 2014 03:40:02 -0700, haiticare2011 wrote:

> I have a project whereby I am energizing a single 10W LED at 12 volts. > I am controlling the current with a logic mosfet controlled by pwm from > the mcu. > > the questions are: > Is it useful to put a capacitor in parallel with the led? The idea is > obviously to get smoothing. > > Another issue is to monitor current by the mcu. This is not absolutely > necessary, but wonder if there is a trick to get this measure. > > I am using an 18 pin picaxe, which is extremely easy to program. > > thanks in advance. > jb
Do you have a current-limiting resistor in there, or an inductor? Or are you applying chopped 12V straight to the LED? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Thursday, June 19, 2014 12:27:40 PM UTC-4, Tim Wescott wrote:
> On Thu, 19 Jun 2014 03:40:02 -0700, haiticare2011 wrote: > > > > > I have a project whereby I am energizing a single 10W LED at 12 volts. > > > I am controlling the current with a logic mosfet controlled by pwm from > > > the mcu. > > > > > > the questions are: > > > Is it useful to put a capacitor in parallel with the led? The idea is > > > obviously to get smoothing. > > > > > > Another issue is to monitor current by the mcu. This is not absolutely > > > necessary, but wonder if there is a trick to get this measure. > > > > > > I am using an 18 pin picaxe, which is extremely easy to program. > > > > > > thanks in advance. > > > jb > > > > Do you have a current-limiting resistor in there, or an inductor? Or are > > you applying chopped 12V straight to the LED? > > > > -- > > > > Tim Wescott > > Wescott Design Services > > http://www.wescottdesign.com
No just pwm to a logic mosfet - which switches a 12 V supply.

100 Hz is not fast enough to prevent visible flicker if there is any motion, even the motion of your eye, i suggest you go faster,

also ensure that the hardware design is such that the LED will be "safe" even if the uP decides to go to 0% or 100%, because if it can, it will at some point.


Mark