0

I want to dim an LED strip.

It's about 1.5m in total length and could work for prolonged time on a battery.

If it weren't for the battery limitation I would probably just put a resistor in series, but I'd like to make it as efficient as possible so I'm thinking of using PWM.

I've got a 5V uC. Strip is running off of 12V. I have a bunch of IRLZ44N transistors laying around which is probably overkill for this job but that's what I have so I'll just use it.

My question is in two parts:

  1. In this famous greatscott video it is explained that switching higher loads causes oscillations that can't lead to anything good. Since I don't own an oscilloscope, how can I tell if my load/frequency are causing voltage spikes?

  2. In this question's accepted answer, a comment states that current can rush back into the component driving the gate. How does that happen and does it mean that driving the gate from a uC pin is guaranteed to fry the uC, making a driver ic a requirement?

php_nub_qq
  • 880
  • 8
  • 24
  • What is uC? IRLZ designed to work with logical level signals. – user263983 Feb 15 '21 at 22:52
  • @user263983 uC = micro controller. Could be just about any it is not really relevant to the question. I'm using atmega328. Looking at the datasheet of the MOSFET Vgs max seems to be 10V so 5 should be fine. – php_nub_qq Feb 15 '21 at 22:53
  • 1
    In my project some PIC MCU driving IRLZ44 . No driver, even no resistor.MCU output push-pull. Works. But for mass production may be not so good. – user263983 Feb 15 '21 at 22:57
  • @user263983 well I suppose it is highly dependent on the load and frequency. – php_nub_qq Feb 15 '21 at 22:59
  • @ php sure things. 400Hz PWM , load 3W LEDs in serial. – user263983 Feb 15 '21 at 23:06
  • At 400 Hz it will probably work fine. It would be good to place 2.2-10uF from ground to VCC near the FET and connector for the wires that go to the strip. Also, since you are doing low-side switching, you need to be very careful if there are any other connections to the strip (such as any data or other logic connecctions). – user57037 Feb 15 '21 at 23:33
  • Also a flyback diode to suppress any transient that may otherwise tend to form when you turn off the FET. – user57037 Feb 15 '21 at 23:34
  • 1
    Just FYI you can get a crappy battery powered oscilloscope for $20. It's unawesome compared to the ones engineers use, but 1000x better than nothing. Anything under 1000Hz is really easy to work with for LEDs, and microcontrollers can be cheap, but just be aware you can do 0-100% duty cycle control at that frequency with a 555 timer or two. You should also check if your LED strip has resistors(and therefore current limiting) built in. – K H Feb 16 '21 at 02:28
  • Oh and also be aware you can buy a mosfet driver chip when your microcontroller output is not sufficient to drive your mosfet gate capacitance fast enough. – K H Feb 16 '21 at 02:33
  • @KH boy have I looked for what you are referring to.. cheapest ones I could find started at $100 which is still nothing but not so for the less fortunate. – php_nub_qq Feb 16 '21 at 06:28
  • I suppose you're going to have to try searching harder. I can find them for anywhere from 10 for a few dollars from aliexpress(questionable providence) or a dollar or two on Digikey. – K H Feb 16 '21 at 07:22
  • If you are going to bring it up and comment about it TWICE, maybe you could at least provide a link instead of taunting the OP and saying "I suppose you're going to have to try searching harder." Aren't we supposed to be improving our image? @KH – user57037 Feb 16 '21 at 22:30
  • @mkeith I didn't recommend a specific driver chip for lack of a selected MOSFET, although I now realize I could have just picked a MOSFET too. The "I suppose you're going to have to try searching harder." Was because I didn't feel like I had enough information to do the search myself, but I had googled "MOSFET driver" to confirm it would come up with a normal list of reasonably priced chips, so I concluded OP just didn't have the right search term. I'll try to remember to come on later to recommend a MOSFET and gate driver just to not be a jerk. – K H Feb 17 '21 at 00:22
  • I thought you were talking about oscilloscopes. Here is what I see, looking back: "Just FYI you can get a crappy battery powered oscilloscope for $20". Then "boy have I looked for what you are referring to.. cheapest ones I could find started at $100." Then "I suppose you're going to have to try searching harder." It came across to me as taunting rather than helpful. I am sure that was not the intention. – user57037 Feb 17 '21 at 00:35
  • 1
    @Mkeith bahahahaha that makes many times more sense than what I was thinking. [this](https://www.aliexpress.com/item/33042463166.html?spm=a2g0o.productlist.0.0.752735f7EPNh3q&algo_pvid=b8dd3b35-0641-4c6a-8444-77cc6d142137&algo_expid=b8dd3b35-0641-4c6a-8444-77cc6d142137-17&btsid=0bb0623016135305552568060ea6c0&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_) is similar to what I meant by crappy oscilloscope. Mine came with a DC power adaptor, but if you make your own battery pack you can use it without worrying about ground loops. – K H Feb 17 '21 at 03:00
  • If you want a cheap oscilloscope from Aliexpress, there are hundreds, so I recommend doing a comparison. Some are just a board with no case, some require the case be ordered separately, and the cheapest ones just come with all the parts and instructions to solder it together yourself. [here](https://www.aliexpress.com/item/4000217165149.html?spm=a2g0o.productlist.0.0.752735f7EPNh3q&algo_pvid=b8dd3b35-0641-4c6a-8444-77cc6d142137&algo_expid=b8dd3b35-0641-4c6a-8444-77cc6d142137-55&btsid=0bb0623016135305552568060ea6c0&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_)'s another. – K H Feb 17 '21 at 03:05
  • We're cautious about recommending aliexpress here because the site is riddled with bad documentation, counterfeit products, and many of the products don't have the UL or CSA, etc. ratings that would make them suitable for commercial use in some countries. That said, they're the king of better than nothing, so if you want to find out how cheap (albeit often questionable) something can be, look there. The oscilloscopes I'm talking about are 1Msample/second, which basically means above 30kHz or so it gets hard to see what's going on in a circuit. – K H Feb 17 '21 at 03:12

3 Answers3

2

schematic

simulate this circuit – Schematic created using CircuitLab

This would be capable of driving 10m @ 12V LED string

This is pretty common. Using 1k to 10kHz PWM > 4.5V guarantees low side losses are minimal with 35.0 mΩ with high side of string to 12V.

If one was concerned about reactance use twisted wire to the string and between 12V and gnd to keep as short as possible. ~ 5nH/cm into say 6W is 2A. L/R gives a fast rise time.

The string has SMD series resistors to dampen oscillations for each set of 3 LEDs but is designed to reduce current variations with V+ (10~14.2)

Gate capacitance is 1700 pF @ 0V thus even a 470~1k series R would not affect rise time results significantly. But if you were concerned about operator/ connector string induced ESD getting back into uC and the series R also dampens oscillations while increasing dissipation a slight amount.

Tony Stewart EE75
  • 1
  • 3
  • 54
  • 182
2

For any kind of large-area LED illumination (like a panel, or strip) I think using PWM for dimming is... an abomination. Sure, it's efficient and cheap, but the strobing effect on anything large that moves is very annoying. For example, every time I see it on a moving car's tail lights with PWM chop it makes me very twitchy. And when that car is filmed? The PWM chop strobes with the frame rate... gah!

Instead, how about using a constant-current driver with analog control? Like this one: https://www.monolithicpower.com/en/products/ac-dc/led-lighting-illumination/dc-dc-lighting/vin-max-lt-24v/mp2410a.html

This IC supports an analog dimming mode. You would take the PWM out from the uC, low-pass filter it, and get nice, no-flicker dimming. Much better, less seizure-inducing.

And efficiency? It will be similar to a PWM chop due to the fact that it's a buck converter regulating the current. Plus, because you're not chopping an entire strip with 12V pulses, EMI is reduced.

hacktastical
  • 49,832
  • 2
  • 47
  • 138
  • While I prefer the efficiency of CC/CV LED dimming, it's worth noting that to achieve 0-100% dimming you have to switch to discontinuous mode when you get down to the LED's turn on voltage, and to get linear brightness you have to use a calibration table for duty cycle or it will dim on a curve. – K H Feb 16 '21 at 02:30
  • 1
    LED drivers like the one I linked work on current, not voltage. But, yes, they go into DCM mode at low current settings. That’s still better than PWM chop as the current is integrated by the inductor and bulk cap. – hacktastical Feb 16 '21 at 02:35
  • Yeah, and current control is better for LEDs, but likely not necessary if OP's strip has resistors in it. Really nice little LED driver. – K H Feb 16 '21 at 02:45
  • PWM tail lights drive me crazy, too. HOWEVER, there is some frequency at which PWM dimming becomes not noticeable. I am not sure if 400 Hz is fast enough. But 1 or 2kHz is fast enough for we humans to not notice it. – user57037 Feb 16 '21 at 03:00
  • 1
    Thank you for the suggestion. I completely agree with the expressed opinion and will definitely apply the suggested solution if I can find a cheaper driver. I'm going to accept the other answer though because it answers the actual questions. – php_nub_qq Feb 16 '21 at 06:21
  • The stroboscopic effect works at any frequency. so PWM is always noticeable in the right circumstances. – Jasen Слава Україні Mar 11 '21 at 03:38
1

Don't waste Your time!

PWM is no more efficient than just putting a resistor in series.

LED illuminance scales with current consumed, not with power consumed.

if you are chasing efficiency consider using a buck converter to reduce the voltage, but the gain may be so small as to give no significant improvement over the resistor.

schematic

simulate this circuit – Schematic created using CircuitLab

  • same brightness

  • same LED current

  • same supply current

  • same power consumption.

  • I'm interested if you could provide some sample calculations. I tried this myself but I just got lost in calculating the consumption of the gate switching.. – php_nub_qq Feb 16 '21 at 19:52
  • if PWM is 100% efficient, current through LED strip = current through supply. with a resistor current through LED strip = current through supply. – Jasen Слава Україні Feb 17 '21 at 00:40
  • @Jasen Feel free to remove the R inside the led strip, and add an LC filter at the input of the led strip, because that's how it would actually be done. You designed the circuits you show to be inefficient, so it's circular argumentation from that point onwards: you clearly got what you set out to do. But that doesn't mean that PWM is inefficient. When using the PWM with the built-in R, you're just shifting the dissipation from external to the internal resistor - yes, no big point in doing that. You *don't* have to do that, in fact :) – Kuba hasn't forgotten Monica Mar 11 '21 at 00:40
  • That would be a buck converter, not PWM, but yeah that would be more efficient. This is not a contrived example, commercialy available 12V led strips are exactly like drawn above. – Jasen Слава Україні Mar 11 '21 at 03:32