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.
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.
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.
LEDs are -- very roughly -- constant voltage devices, whose brightness you control by controlling the current through the LED. You really don't want to put voltage to an LED through a low-impedance source unless you really, really, really know what you're doing. You either end up with very little current because your applied voltage is too small, or you end up with way too much current because your applied voltage is too big.
If power savings is less important that circuit simplicity, put a resistor in series with the LED. Calculate the series resistance such that the LED consumes its maximum current with the supply at its highest possible voltage.
If power savings matters, use a buck converter as JT suggested. You'll probably have to monitor the LED current, or use a small dropping resistor, because while the LED roughly dictates its voltage, that voltage varies over temperature and with each individual LED.
I don't know the physics of the LED phosphor degradation, but if the rate of phosphor degradation is more than linear with light intensity, then the dropping resistor and PWM scheme won't save your phosphor, because the LED will come up to the maximum (phosphor-damaging) brightness each time; it'll just be your eyes that average it out.
One should *never* depend on software alone, to assure the safety of system components (or of the user). It's far better to design a layer of hardware safety into the system, to provide robust limiting or shutdown if software (or the system user) does something egregiously stupid. Current-limiting resistors, zeners, "hard" limit switches, crowbars, etc... the more expensive it is to repair the system (or deal with a human's injuries) the more sense it makes to make the design as hardware-fail-safe as you can.
(And I'm speaking as a software weenie with a fair bit of experience in embedded-system and microcontroller-based project design.).
You'd have to approach the whole current-smoothing business with care, for sure. A boost topology with guaranteed-discontinuous operation may do it, but -- why bother?
You measure the current at a particular fixed point in the PWM cycle (such as shortly after turn-on) - that gives you a solid feedback for regulation.
For an LED, you do not want constant current unless you actually require continuous light (such as for lighting when filming). You want PWM fast enough to avoid any sort of flicker (100 Hz is often enough, but 200 Hz is safer). The eye will perceive a 20% duty cycle as being about the same brightness as 60% steady state current - meaning you can save two thirds of your power by using PWM without any sort of smoothing. It also means that you will get only one third of the heating in the LED for the same brightness, and (depending on reliability and lifetime requirements) can mean you can overdrive your LED with higher peak currents will keeping a lower average current.
The microcontroller here (a PIC) is brain-dead monstrosity to work with and far more expensive than far better modern chips, but it is still perfectly capable of such PWM and regulations.
That depends on how you define "emulate" -- but with an ADC it can sure _implement_ one. I'm doing that with a motor controller right now, in fact.
But, some points:
First: I'm not sure if I'm tongue-in-cheek here, or if I'm thinking in terms of minimalist hardware, or what. So don't think I'm married to this whole idea.
Second: I stipulated a boost with a duty cycle that guarantees discontinuous operation for a reason: because as long as the coil current is discontinuous, the output impedance will be high, or at least the thing won't be super-stiff in voltage. There will be _some_ current dependence on the output voltage, but it won't be huge (I think), and the more discontinuous you let the current be, the higher the effective impedance (I think).
If a situation arose where the current _did_ become continuous in the coil, then you'd probably let the smoke out of _something_. The situation may not end up being an entirely unmitigated disaster, but it may not be far from it -- so I would suggest not allowing that to happen.
Third: You don't need active control to achieve discontinuous operation after startup. You just need to keep the ratio below the ratio of the LED forward drop over the supply voltage. For startup you can either say "what the hell" and let it happen (because it'll stop once the output cap gets charged up), or you can ramp up the duty cycle.
Here's an LTSpice netlist, showing what I've thrown together to demonstrate the concept. I'm sure that there's many things wrong with it, but it does show that you can get a pretty good relationship between LED current and duty cycle, without having a hyper-critical "it'll blow up in your face" situation unless you get way too enthusiastic with the duty cycle:
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.