Announcement

Collapse
No announcement yet.

PWM LED Driver DIY - looking for comments and criticism

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PWM LED Driver DIY - looking for comments and criticism

    So some of you might remember when I did this project



    Which I then ended up using this dimming circuit to drive the panel.

    The problem with that circuit is that after it switches on, it starts out at a fairly high voltage and then there really isn't any "sweep" of value range before it just jumps to the highest value making the circuit pretty much useless and it's only gotten worse in that behavior over time.

    So since I have a grip of 555 timers, I decided to see what I could find on the web for any decent PWM schematics that are centered on the 555 timer... this is the circuit that I ended up going with after breadboarding it ... because it has a nice range to it and it doesn't introduce any audible noise in the circuit itself EXCEPT at very low levels - and it's subtle enough that it's almost not even noticeable.



    What I'm looking for with this post is a couple of things:

    1) Comments or criticisms on the circuit design itself? Anything that anyone can spot that I need to be aware of or any potential issues that I need to mitigate somehow?

    2) Does anyone know how I can get more "LOW END" out of this circuit? I Would like to be able to turn it down a little bit lower than it can go now .. though that's not a deal breaker for me, it would just be a nice to have.

    Thanks,

    #2
    Re: PWM LED Driver DIY - looking for comments and criticism

    “ The problem with that circuit is that after it switches on, it starts out at a fairly high voltage and then there really isn't any "sweep" of value range before it just jumps to the highest value making the circuit pretty much useless and it's only gotten worse in that behavior over time.”

    I have you tried a multi turn pot this might be a solution to the issue that you are having with PWM controller that you are using or is it a design issue with the circuit
    9 PC LCD Monitor
    6 LCD Flat Screen TV
    30 Desk Top Switching Power Supply
    10 Battery Charger Switching Power Supply for Power Tool
    6 18v Lithium Battery Power Boards for Tool Battery Packs
    1 XBox 360 Switching Power Supply and M Board
    25 Servo Drives 220/460 3 Phase
    6 De-soldering Station Switching Power Supply 1 Power Supply
    1 Dell Mother Board
    15 Computer Power Supply
    1 HP Printer Supply & Control Board * lighting finished it *


    These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

    1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
    2 Hem Saw Computer Stack Board

    All of these had CAPs POOF
    All of the mosfet that are taken out by bad caps

    Comment


      #3
      Re: PWM LED Driver DIY - looking for comments and criticism

      I think the TIP120 is too slow for higher frequency PWM. It might be limiting the low end or narrow PWM as you call it because it takes a long time to turn off. The R2 8kΩ is a bit high value, for high speed you want that value lower maybe try 2.2kΩ and that would tell you if the TIP120 is a slacker.
      I would use instead a power mosfet and lower R2 from 8kΩ to 22-100R for the high speed gate drive.
      555 timer does like capacitance on its power, so 0.1uF and say 10uF are typical so it does not misbehave due to noise on 12V power.

      Comment


        #4
        Re: PWM LED Driver DIY - looking for comments and criticism

        Originally posted by sam_sam_sam View Post
        have you tried a multi turn pot this might be a solution to the issue that you are having with PWM controller that you are using or is it a design issue with the circuit
        All I know is that the issue with it has gotten worse over time. Meaning that the amount of voltage "sweep" has gotten smaller and the distance from the turn on point to when it goes to max voltage is also a shorter distance in the turn of the pot.

        I've tried more than one of those from Amazon - they're just cheap pieces of crap or they don't work work well for this circuit anyways. The POT from that circuit happens to work great for this new 555 based circuit.

        Comment


          #5
          Re: PWM LED Driver DIY - looking for comments and criticism

          Originally posted by redwire View Post
          I think the TIP120 is too slow for higher frequency PWM. It might be limiting the low end or narrow PWM as you call it because it takes a long time to turn off. The R2 8kΩ is a bit high value, for high speed you want that value lower maybe try 2.2kΩ and that would tell you if the TIP120 is a slacker.
          I would use instead a power mosfet and lower R2 from 8kΩ to 22-100R for the high speed gate drive.
          555 timer does like capacitance on its power, so 0.1uF and say 10uF are typical so it does not misbehave due to noise on 12V power.
          Interesting thought on the off time for the TIP120 I'll try it with a mosfet and see if that changes anything. I think the 8k was the original point of output where you would just connect a single LED to demonstrate that the circuit works I didn't think it would have any impact really on a transistor in a strictly on / off situation since the voltage at that point in the circuit will always be either 0 or something close to 12 volts ... cant remember ... I originally built this circuit about two weeks ago.

          Though a lower value will certainly affect the current between the emitter and the base, right? and when we're after more speed, more current is better?

          Comment


            #6
            Re: PWM LED Driver DIY - looking for comments and criticism

            Originally posted by redwire View Post
            I think the TIP120 is too slow for higher frequency PWM. It might be limiting the low end or narrow PWM as you call it because it takes a long time to turn off. The R2 8kΩ is a bit high value, for high speed you want that value lower maybe try 2.2kΩ and that would tell you if the TIP120 is a slacker.
            I would use instead a power mosfet and lower R2 from 8kΩ to 22-100R for the high speed gate drive.
            555 timer does like capacitance on its power, so 0.1uF and say 10uF are typical so it does not misbehave due to noise on 12V power.
            SO lowered the gate resistor to 220 and tried an IRF540 Mosfet but no change in terms of the noise ... I did try an RC filter at the output and that made a huge difference ... at the cost of brightness though.
            Last edited by EasyGoing1; 07-20-2022, 11:25 PM.

            Comment


              #7
              Re: PWM LED Driver DIY - looking for comments and criticism

              You hear a squeal or whistle? That is the PWM frequency. You'd have to increase it above hearing, to say 20kHz. Lower the cap size on pin2 from 30nF to say 10nF to increase the frequency. You can measure it at pin 3.
              I suggested changing to a mosfet to fix the low end problem, but it can take the higher speed ok.

              Comment


                #8
                Re: PWM LED Driver DIY - looking for comments and criticism

                i would have used a microcontroller - just saying
                A/D input from the pot (or buttons/rotary encoder) PWM output in hardware
                amazing what is in these 8pin chips for a $ these days!

                Comment


                  #9
                  Re: PWM LED Driver DIY - looking for comments and criticism

                  555 runs up to 18V and will directly drive a mosfet, it's kinda simple and fun.
                  If OP is into embedded MCU's it is an option, 8-bit MCU's need extra hardware and e.g. Attiny stock is decimated due to the semi shortages.
                  But it wouldn't fix the Darlington speed issue. For a light fixture, I'm ok using one IC.

                  Comment


                    #10
                    Re: PWM LED Driver DIY - looking for comments and criticism

                    Originally posted by stj View Post
                    i would have used a microcontroller - just saying
                    A/D input from the pot (or buttons/rotary encoder) PWM output in hardware
                    amazing what is in these 8pin chips for a $ these days!
                    That's still an option, and I have a few attiny's in the bin.

                    Comment


                      #11
                      Re: PWM LED Driver DIY - looking for comments and criticism

                      Originally posted by redwire View Post
                      Attiny stock is decimated due to the semi shortages.
                      I've got a few from a project I did last year where I ordered a quantity of them.

                      Comment


                        #12
                        Re: PWM LED Driver DIY - looking for comments and criticism

                        So I set up a test using an Ardunio Nano, which is the same as the Attiny85 in all the specs that pertain to this use case.

                        What I like about the microcontroller setup, is that I can get a much wider sweep in the brightness levels if I tweak the conversion values from a POT... which Ill explain:

                        When these MCs read an analog value, and you sweep the voltage from 0 to 5 volts, the values it reads range from 0 to 1024.

                        HOWEVER, when you set an output pin to a PWM value, you can only set the output pin from a value of 0 to 254.

                        In this case, using this LED panel where I'm using a MOSFET to vary 19 volts to the panel, there is a point very early in that 0 to 254 range where it just jumps from dim to bright, and that number is right around a PWM value of 15. and after a PWM value of about 175, the difference in brightness isn't really noticeable at all.

                        However, when I read the values from the POT (which is a range of 0 to 1024), I can make the range of 0 to 500 sweep the output from 0 to 15, and this definitely gives me more granular control over the dimmer levels.

                        What I don't like about the base Arduino MCs is that their ADCs have a small resolution and so even a PWM out value going from say 2 to 3 is a larger brightness jump than say going from 5 to 6 etc.

                        I have other micro controllers that have as much as 4 times the resolution, which would make those PWM increases much smaller, but they only support a 3.3v output and this MOSFET can't really saturate fully until you hit it with 4 to 5 volts.

                        But on the overall - the MC solution is much better than the 555 timer.

                        Comment


                          #13
                          Re: PWM LED Driver DIY - looking for comments and criticism

                          To test my theory on the PWM resolution, I tried the same setup but with a Teensy 4.0 microcontroller, which has a 10-bit ADC (vs the 8-bit on the Arduino) and it lets me set the PWM frequency, and when I set the resolution to 10 bits and the frequency to 146484.38 Hz (based on a chart he has on the Teensy website), the results are night and day (no pun intended).

                          With the Teensy, I get a true - almost analog feeling - sweep of range from 0 to max voltage and the brightness intensity appears to be a straight linear progression through the different voltage values. Whereas with the Arduino's lower resolution, the brightness jumps at different values and even small changes on the POT can cause large jumps in brightness in the output.

                          The downside of the Teensy is that at max value, I'm only getting 16 volts to the panel when I need to be getting as close to 19 as possible, so I'm not getting max brightness out of it.

                          I think my options for solving that problem is to find a MOSFET that can fully saturate at 3 volts OR up the power supply, but it would be easier I think to find a more suitable MOSFET.

                          Also, I get no noise at all with the Teensy, which I'm assuming is because of the high modulation frequency... even at the dimmest setting, it's as quiet as a church mouse.

                          Does anyone know of any MOSFETS that will saturate at 3 volts?
                          Last edited by EasyGoing1; 07-23-2022, 07:03 AM.

                          Comment


                            #14
                            Re: PWM LED Driver DIY - looking for comments and criticism

                            int ledPin = 5; // PB0 OC0A ATTiny25-85
                            int analogPin = 2; // PB3 ADC3 ATTiny25-85
                            int val = 0;

                            void setup() {
                            analogReference(DEFAULT);
                            pinMode(ledPin, OUTPUT);
                            }

                            void loop() {
                            val = analogRead(analogPin);
                            analogWrite(ledPin, val / 4); // ADC=10bit, PWM=8bit
                            }
                            a snip from a project of mine
                            Attached Files
                            Last edited by stj; 07-23-2022, 07:17 AM.

                            Comment


                              #15
                              Re: PWM LED Driver DIY - looking for comments and criticism

                              Well, I found a MOSFET that has a Vgs of 2.5V, but even with that MOSFET, the max output I'm getting using a 19V power supply is just over 16 volts.

                              So I used the bench power supply and found the source voltage that gives me 19V at the panel and that was when I set the bench PS to 22 volts.

                              Then I used a Lux meter held at about 3 feet away from the light source to see the difference in LUX from an 18v source to a 22V source and the difference is about 800 Lux ... so it swings from about 1,000 to 1800 lux.

                              Not quite sure what I can do except maybe swap out the resistors on the LED panel and go to a 24 source since I don't assume it will be easy to find a 22V power supply on Amazon in the sub $20 range.

                              Comment


                                #16
                                Re: PWM LED Driver DIY - looking for comments and criticism

                                Originally posted by stj View Post
                                a snip from a project of mine
                                This is the code I used for the ATTiny test.


                                Code:
                                const int POT = 3;
                                const int OUT = 1;
                                
                                #define READ analogRead(POT)
                                
                                void adjust() {
                                  auto value = (int) map(READ, 0, 1024, 0, 254);
                                  analogWrite(OUT, value);
                                }
                                
                                void setup() {
                                  pinMode(POT, INPUT);
                                  pinMode(OUT, OUTPUT);
                                }
                                
                                void loop() {
                                  adjust();
                                }
                                Very similar in terms of the net results.
                                Last edited by EasyGoing1; 07-23-2022, 08:39 AM.

                                Comment


                                  #17
                                  Re: PWM LED Driver DIY - looking for comments and criticism

                                  you should be switching the ground pin of the leds - thats why your having mosfet issues

                                  Comment


                                    #18
                                    Re: PWM LED Driver DIY - looking for comments and criticism

                                    Originally posted by stj View Post
                                    you should be switching the ground pin of the leds - thats why your having mosfet issues
                                    What do you mean "switching the ground pins" ?

                                    You talking about moving the panel over to the Collector side of the MOSFET?

                                    Comment


                                      #19
                                      Re: PWM LED Driver DIY - looking for comments and criticism

                                      Spoke too soon about the 22v power supplies ... Amazon has a couple of options within budget:

                                      Option 1

                                      Option 2

                                      Option 3

                                      Comment


                                        #20
                                        Re: PWM LED Driver DIY - looking for comments and criticism

                                        Your best option is number 2 mainly the output of switching power supply
                                        9 PC LCD Monitor
                                        6 LCD Flat Screen TV
                                        30 Desk Top Switching Power Supply
                                        10 Battery Charger Switching Power Supply for Power Tool
                                        6 18v Lithium Battery Power Boards for Tool Battery Packs
                                        1 XBox 360 Switching Power Supply and M Board
                                        25 Servo Drives 220/460 3 Phase
                                        6 De-soldering Station Switching Power Supply 1 Power Supply
                                        1 Dell Mother Board
                                        15 Computer Power Supply
                                        1 HP Printer Supply & Control Board * lighting finished it *


                                        These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                                        1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                                        2 Hem Saw Computer Stack Board

                                        All of these had CAPs POOF
                                        All of the mosfet that are taken out by bad caps

                                        Comment

                                        Working...
                                        X