Klarus
Results 1 to 30 of 30

Thread: DIY led driver

  1. #1

    Default DIY led driver

    I need a 12v 5a led driver, and I'm thinkingof making one with the LM2678 switching regulator. How would I do constant current Just set the regulator to 12.1v and then use a resistor?

  2. #2

    Default Re: DIY led driver

    Check out this PDF. There are several variations of this circuit floating around.

    http://www.ottomat.hu/Kapcsrajzok/aramgenerator3.pdf

    I've tried to built it several times and failed to get the full 3A output. If you have a good understanding of OP AMPS, then it shouldn't be a problem.

    Another option is to use the switching regulator to drop voltage to a few parallel low dropout LED drivers.

  3. #3

    Default Re: DIY led driver

    I'm thinking I might use 14 7135s in parallel. I'm using 5xcree xml easy white leds, I could power it off of a 4s lifepo4 pack which would give around 12.8-12v for much of its life.

  4. #4

    Default Re: DIY led driver

    Quote Originally Posted by Hmmm View Post
    I'm thinking I might use 14 7135s in parallel. I'm using 5xcree xml easy white leds, I could power it off of a 4s lifepo4 pack which would give around 12.8-12v for much of its life.
    And have 14 points of failure? Why not get one or two normal drivers?

  5. #5
    Flashaholic*
    Join Date
    Dec 2008
    Location
    Sydney, Australia
    Posts
    1,064

    Default Re: DIY led driver

    I'd rethink that as well. With a fully charged pack you're dissipating something like 12 W of power through the 7135s. Very wasteful and more than a bit toasty. Why not just buy a TaskLED H6CC instead?
    Finning does help dissipate heat. This is why the fins are removed before cooking fish. Otherwise it will throw off the heat and not reach the proper cooking temperature. --Duglite

  6. #6

    Default Re: DIY led driver

    really? Nominal 3.6, but that drops quickly to 3.2 and the forward voltage is 11.7 the TaskLED H6CC is pretty expensive.

  7. #7

    Default Re: DIY led driver

    at 3.6v its 82 percent efficient with 7135 drivers, but at 3.2v its 88 percent efficient and once its down to 3v its 97.5 percent efficient. Its distr ibuting 11 watts at 3.6 volts per battery, but that is about the same as the H6CC

    Most normal drivers don't power cree xml easy white leds if i understand currently.
    also the h6cc needs a full volt of voltage drop.
    Last edited by Hmmm; 06-09-2012 at 08:48 PM.

  8. #8

    Default Re: DIY led driver

    I've been thinking about controlling it with an attiny chip. I think I'll have a thermistor next to the leds to check the temperature and three modes. It will switch through them based on presses. The first mode will apply voltage to all 14 7135 chips vdd, the second mode will apply power to 7 amc 7135 chips vdd, the third mode will apply power to 3 of them.

    I just had a novel idea. From my understanding pwm does not increase efficiency of the leds, it just decreases power draw. I could however connect a pot to a larger attiny chip and have 14 "steps", I would ivied the pot into 14 steps, the top having all 14 of the 7135 chips being powered, and the bottom only having 1. This would wallow the efficiency to increase as the power dropped. How does this sound?

  9. #9
    Flashaholic* uk_caver's Avatar
    Join Date
    Feb 2007
    Location
    Central UK
    Posts
    1,300

    Default Re: DIY led driver

    If you have 5xXML what supply voltage and circuit arrangement were you thinking of, how were you thinking of using a step-down converter, and what LED current were you hoping to get?

    In your second post you talk of a 4s lithium pack but I can't quite see how that fits with 5xXML and a buck converter.

  10. #10

    Default Re: DIY led driver

    Quote Originally Posted by Hmmm View Post
    I've been thinking about controlling it with an attiny chip. I think I'll have a thermistor next to the leds to check the temperature and three modes. It will switch through them based on presses. The first mode will apply voltage to all 14 7135 chips vdd, the second mode will apply power to 7 amc 7135 chips vdd, the third mode will apply power to 3 of them.

    I just had a novel idea. From my understanding pwm does not increase efficiency of the leds, it just decreases power draw. I could however connect a pot to a larger attiny chip and have 14 "steps", I would ivied the pot into 14 steps, the top having all 14 of the 7135 chips being powered, and the bottom only having 1. This would wallow the efficiency to increase as the power dropped. How does this sound?
    And so you will need 14 FETs (or 28 if using N-P FET pair) to switch power to 14 7135s... Talk about increasing board space...

    Quote Originally Posted by Hmmm View Post
    I could however connect a pot to a larger attiny chip and have 14 "steps"
    smallest attiny with ADC is about 3mm x 3mm size. Remember that you have 14 7135s and 14 (or 28) FETs. Overall pot idea is good but WHY you don't go proper driver route instead of 7135s...

  11. #11

    Default Re: DIY led driver

    I thought I could just switch the power to the vdd.

    I have very low voltage overhead. Could you explain to me a proper driver route? It would appear I would need a buck/boost driver to use a proper route. ALso at 1a current the easywhite leds vf is about 12.5. Couldn't I just switch power to the vdd of the 7135 chips? have the attiny apply power or not and tie the grounds?

    Please help me understand. I have not done a lot of electronics. For testing i'm using a NFET and a transistor as a constant current source, however direct4l off the batteries, the leds do not turn on. I'm using a boost converter for testing, but Its too big for a light and then I have the inefficiency of boosting and then regulating and burning off the extra voltage as heat.
    Last edited by Hmmm; 06-12-2012 at 11:22 AM.

  12. #12

    Default Re: DIY led driver

    @caver I have 5 cree xml easywhite 12v leds. I would wire them in parallel. I'm hoping to run them at 1 amp each, for 5 amps total, all in parallel. I will most likely run then slightly below that incase the vf is different on them so if one is a current hog it doesn't go over spec. at 1 amp the vf is about 12.5 volts. The other option is to wire them all in series and power them with a boost converter. I don['t want to use a prebuilt driver like the hyper boost.
    Last edited by Hmmm; 06-12-2012 at 11:42 AM.

  13. #13
    Flashaholic* uk_caver's Avatar
    Join Date
    Feb 2007
    Location
    Central UK
    Posts
    1,300

    Default Re: DIY led driver

    Quote Originally Posted by jpou View Post
    And so you will need 14 FETs (or 28 if using N-P FET pair) to switch power to 14 7135s...
    Not really - the MCU can drive 7135s directly, if they're connected conventionally on the low side of the LEDs and any turned on together can have their Vin pins connected together, driven by a single MCU output.
    The current required is minimal so an MCU should be able to handle a decent number (as suggested by the various Chinese drivers with an MCU driving numerous 7135s).

    In any case, to turn on any number from 1 through 14 of 14 output-paralleled 7135s would only take 4 outputs, driving 1,2,4,7 chips respectively, and turning them on in a slightly modified binary pattern (take desired number, output directly if 7 or less, otherwise add 1 and output).

  14. #14
    Flashaholic* uk_caver's Avatar
    Join Date
    Feb 2007
    Location
    Central UK
    Posts
    1,300

    Default Re: DIY led driver

    [deleted]
    Last edited by uk_caver; 06-12-2012 at 11:45 AM.

  15. #15
    Flashaholic* uk_caver's Avatar
    Join Date
    Feb 2007
    Location
    Central UK
    Posts
    1,300

    Default Re: DIY led driver

    Quote Originally Posted by Hmmm View Post
    @caver I have 5 cree xml easywhite 12v leds. I would wire them in parallel. I'm hoping to run them at 1 amp each, for 5 amps total, all in parallel. I will most likely run then slightly below that incase the vf is different on them so if one is a current hog it doesn't go over spec. at 1 amp the vf is about 12.5 volts.
    Ah - I'd been thinking or regular XM-Ls - my mistake.

    With the NFET circuit, how much voltage overhead should it be taking to turn on?

  16. #16
    Flashaholic* uk_caver's Avatar
    Join Date
    Feb 2007
    Location
    Central UK
    Posts
    1,300

    Default Re: DIY led driver

    As for using 7135s, it does seem like the potential voltage overhead on fresh cells could be a bit large.

    What capacity do you have for cooling the LEDs/driver?

  17. #17

    Default Re: DIY led driver

    I haven't tested the minimum required to turn on, but it is more than 1 volt. I'm right now running it sat about 18 volts, just for testing. I don't have a definite plan for cooling yet, however I plan on making a housing on a lathe and cutting fins going from the front to the back on my high school's mill or my hand router with a jig to fit on my wood lathe which has indexing. I'm thinking it will automatically step down output as temperature increases above a certain threshold. I've though about it and if I used 7135 chips I would have 14 levels, 1 through 14 chips active. As temperature increases It would lower the levels until he temperature levels out. I thought of pwming between active chip levels, but I don't think it is neccesary.

  18. #18

    Default Re: DIY led driver

    the discharge curve of a lifepo4 is about:

    i ordered 10 a123 batteries from ebay, but I dobt they are really a123. i'll do a discharge test soon.
    But much of the life is between 3 and 3.25 volts depending on my batteries discharge curve.
    Little of it is at the full 3.6 volts fresh off the charger.

    I'll run some thermal tests in solid works once I get it setup on my compeer and reinstall windows.
    Last edited by Hmmm; 06-12-2012 at 12:24 PM.

  19. #19
    Flashaholic* uk_caver's Avatar
    Join Date
    Feb 2007
    Location
    Central UK
    Posts
    1,300

    Default Re: DIY led driver

    I guess with a total voltage that low (I really have been somewhat distracted today), 7135s probably would be OK, and would certainly give smooth-ish control, though turning on 1 through 14 of them might give a limited number of effective steps (the difference between 'N on' and 'N+1 on' or 'N+2 on' might be pretty hard to see for larger values of N).

    If you had a spare output, you could turn on the 7135s in clusters of 1,1,2,4,and 6 and with PWM control for one of the '1' outputs, you could get continuous control over the whole range while having most operating levels being PWM free, and have the ability to dim right down to zero.

    If you're controlling via a pot, it might be worth trying to make the overall 'feel' linear even if that involves some post processing of the pot result, or some pre-mangling of the pot input voltage (it's surprising what a resistor or two can do to nonlinearise a linear pot).

  20. #20

    Default Re: DIY led driver

    I was considering pwm control between levels and then switching to more 7135s at a lower pwm for higher levels, but i'm not sure If I will do that. Smooth control would look nice. I can control all of the "linearness" when programming, I think.

    That second idea sounds very interesting. I think I understand what you are talking about. I would pwm only one of the 7135 chips and the rest would be either on or off. That sounds very good and would help with efficiency.

    Am I correct that with this low of a difference between supply and output voltage a linear regulator like a 7135 is a good choice?

  21. #21

    Default Re: DIY led driver

    /*
    Analog input, analog output, serial output

    Reads an analog input pin, maps the result to a range from 0 to 255
    and uses the result to set the pulsewidth modulation (PWM) of an output pin.
    Also prints the results to the serial monitor.

    The circuit:
    * potentiometer connected to analog pin 0.
    Center pin of the potentiometer goes to the analog pin.
    side pins of the potentiometer go to +5V and ground
    * LED connected from digital pin 9 to ground



    */




    const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
    const int analogOutPinPWM = 0;
    const int analogOutPin13 = 13;
    const int analogOutPin12 = 12;
    const int analogOutPin11 = 11;
    const int analogOutPin10 = 10;
    const int analogOutPin9 = 9;
    const int analogOutPin8 = 8;
    const int analogOutPin7 = 7;
    const int analogOutPin6 = 6;
    const int analogOutPin5 = 5;
    const int analogOutPin4 = 4;
    const int analogOutPin3 = 3;
    const int analogOutPin2 = 2;
    const int analogOutPin1 = 1;// Analog output pin that the LED is attached to


    int sensorValue = 0; // value read from the pot
    int outputValue = 0; // number of 7135 chips "on"
    int pwmValue =0; // percent pwm of the 1 7135 that is pwmed, 0 to 255
    int pwmRateConverter(int x, int y){
    //method to determine pwm value for all cases besides 0; ---------> important ------->this relies on t map() truncating any value from the conversion, instead of roudning


    int result;
    result = x-map(outputValue, 0, 14, 0, 255);
    return result;
    }
    void setup() {
    // initialize serial communications at 9600 bps:
    Serial.begin(9600);
    //add method set all low
    //method to determine pwm value for all cases besides 0; ---------> important ------->this relies on t map() truncating any value from the conversion, instead of roudning


    }


    void loop() {
    // read the analog in value:
    sensorValue = analogRead(analogInPin);
    // map it to the range of the analog out:
    outputValue = map(sensorValue, 0, 1023, 0, 14);

    // change the analog out value:
    switch (outputValue) {
    case 0:
    pwmValue = map(sensorValue, 0, 1023, 0, 255)
    analogWrite(analogOutPinPWM, pwmValue);
    //add method set all pins except pwmValue to low
    break;
    case 1:
    digitalWrite(analogOutPin1, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 2:
    digitalWrite(analogOutPin2, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 3:
    digitalWrite(analogOutPin3, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 4:
    digitalWrite(analogOutPin4, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 5:
    digitalWrite(analogOutPin5, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 6:
    digitalWrite(analogOutPin6, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 7:
    digitalWrite(analogOutPin7, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 8:
    digitalWrite(analogOutPin8, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 9:
    digitalWrite(analogOutPin9, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 10:
    digitalWrite(analogOutPin10, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 11:
    digitalWrite(analogOutPin11, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 12:
    digitalWrite(analogOutPin12, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;
    case 13:
    digitalWrite(analogOutPin13, HIGH);
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    break;






    // wait 2 milliseconds before the next loop
    // for the analog-to-digital converter to settle
    // after the last reading:
    delay(2);
    }

  22. #22

    Default Re: DIY led driver

    does this look right? nvm, that is not very good.
    Last edited by Hmmm; 06-13-2012 at 09:01 AM.

  23. #23

    Default Re: DIY led driver

    possible head design:


    the solid block in the center is threaded in. the circuit board will be on one side and the leds will be heatsinkedon the other side.

    its maglite compatible.
    Last edited by Hmmm; 06-13-2012 at 10:08 AM.

  24. #24

    Default Re: DIY led driver

    /*
    Analog input, analog output, serial output

    Reads an analog input pin, maps the result to a range from 0 to 255
    and uses the result to set the pulsewidth modulation (PWM) of an output pin.
    Also prints the results to the serial monitor.

    The circuit:
    * potentiometer connected to analog pin 0.
    Center pin of the potentiometer goes to the analog pin.
    side pins of the potentiometer go to +5V and ground
    * LED connected from digital pin 9 to ground



    */




    const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
    const int analogOutPinPWM = 0;




    int sensorValue = 0; // value read from the pot
    int outputValue = 0; // number of 7135 chips "on"
    int pwmValue =0; // percent pwm of the 1 7135 that is pwmed, 0 to 255
    int pwmRateConverter(int x, int y){
    //method to determine pwm value for all cases besides 0; ---------> important ------->this relies on t map() truncating any value from the conversion, instead of roudning


    int result;
    result = x-map(outputValue, 0, 14, 0, 255);
    return result;
    }
    void setup() {
    // initialize serial communications at 9600 bps:
    Serial.begin(9600);
    //add method set all low
    //method to determine pwm value for all cases besides 0; ---------> important ------->this relies on t map() truncating any value from the conversion, instead of roudning


    }


    void loop() {
    // read the analog in value:
    sensorValue = analogRead(analogInPin);
    // map it to the range of the analog out:
    outputValue = map(sensorValue, 0, 1023, 0, 14);

    // change the analog out value:
    if (outputValue=0) {

    pwmValue = map(sensorValue, 0, 1023, 0, 255)
    analogWrite(analogOutPinPWM, pwmValue);
    //add method set all pins except pwmValue to low
    }
    else
    {
    pwmValue =pwmRateConverter(pwmValue, outputValue);
    analogWrite(analogOutPinPWM, pwmValue);
    digitalWrite(outputValue, HIGH);
    for (c=1, c<=outputValue, c++)
    {
    digitalWrite(c, HIGH);
    }
    }



    // wait 2 milliseconds before the next loop
    // for the analog-to-digital converter to settle
    // after the last reading:
    delay(2);
    }

  25. #25

    Default Re: DIY led driver

    any help?

    i've tested it alittle and it is very bright, but the throw is pretty horrible.

  26. #26
    Flashaholic* Changchung's Avatar
    Join Date
    Oct 2005
    Location
    Where the night is too short...
    Posts
    2,085

    Default Re: DIY led driver

    I am using a couple of this with good results; ebay Item number: 190539571799 4amp max
    Zebralight Spark Princeton Inova Petzl Maglite Bushnell 4 XM-L MagMod and a lot of Cree XM-L Lights Nitecore i4 Intellicharger Intl-outdoor 3400 Panasonic 3100 Bare and protected Samsung 3000 Sanyo 2600
    Please, respect the planet, dont kill animals...

  27. #27

    Default Re: DIY led driver

    I've looked at thoe, but they are rather large and too close to the input voltage. I would need a buck boost driver. To drive it all in series I would need one that could boost to near 70v do those exist? Besides the hyper boost?

  28. #28

    Default Re: DIY led driver

    If you want to DIY your own 5A driver, this post has all the details for attiny controlled series regulator with multiple current levels
    http://www.candlepowerforums.com/vb/...d.php?t=201383

    Build a Basic uC 3 Level Led Driver - A Tutorial

    The basic circuit can be used to control milliamps to amps. I have used it for a 5A led driver.

    There are also extensions to this project to control it from a mobile phone. OR you can just use the RS232 interface to help you debug the code.

    I use a logarithmic scale for the current steps to get a set of levels the look 'linear' to the eye. At the very low levels you need a well damped control or you will get flickering due to current measurement noise.

    My website has details on reducing the flicker.
    Last edited by mpf; 06-23-2012 at 06:39 AM.

  29. #29

    Default Re: DIY led driver

    That looks like it will have the same problem of input voltage being too close to output.

    This is my code plan ofr the driver:

    /*
    Analog input, analog output, serial output

    Reads an analog input pin, maps the result to a range from 0 to 255
    and uses the result to set the pulsewidth modulation (PWM) of an output pin.
    Also prints the results to the serial monitor.

    The circuit:
    * potentiometer connected to analog pin 0.
    Center pin of the potentiometer goes to the analog pin.
    side pins of the potentiometer go to +5V and ground
    * LED connected from digital pin 9 to ground


    */


    const int analogInPin = A5; // Analog input pin that the potentiometer is attached to
    const int analogOutPinPwm = 3; // pin 3 is available for pwm
    const int digitalOutPin13 = 13;
    const int digitalOutPin12 = 12;
    const int digitalOutPin11 = 11;
    const int digitalOutPin10 = 10;
    const int digitalOutPin9 = 9;
    const int digitalOutPin8 = 8;
    const int digitalOutPin7 = 7;
    const int digitalOutPin6 = 6;
    const int digitalOutPin5 = 5;
    const int digitalOutPin4 = 4;
    const int digitalOutPin3 = 0;
    const int digitalOutPin2 = 2;
    const int digitalOutPin1 = 1;// Analog output pin that the LED is attached to

    double pwmPercent=0;
    int i;
    int sensorValue = 0; // value read from the pot
    int outputValue = 0; // number of 7135 chips "on"
    int pwmValue =0; // percent pwm of the 1 7135 that is pwmed, 0 to 255

    void setup() {
    // initialize serial communications at 9600 bps:
    Serial.begin(9600);


    pinMode(digitalOutPin1, OUTPUT);
    pinMode(digitalOutPin2, OUTPUT);
    pinMode(digitalOutPin3, OUTPUT);
    pinMode(digitalOutPin4, OUTPUT);
    pinMode(digitalOutPin5, OUTPUT); '
    pinMode(digitalOutPin6, OUTPUT);
    pinMode(digitalOutPin7, OUTPUT);
    pinMode(digitalOutPin8, OUTPUT);
    pinMode(digitalOutPin9, OUTPUT);
    pinMode(digitalOutPin10, OUTPUT);
    pinMode(digitalOutPin11, OUTPUT);
    pinMode(digitalOutPin12, OUTPUT);
    pinMode(digitalOutPin13, OUTPUT);
    }

    void loop() {
    // read the analog in value:
    sensorValue = analogRead(analogInPin);
    // map it to the range of the analog out:
    outputValue = map(sensorValue, 0, 1023, 0, 14);
    pwmPercent = ((double)map(sensorValue, 0, 1023, 0, 14)-outputValue)*100;

    // change the analog out value:

    switch (outputValue) {
    case 13:
    digitalWrite(digitalOutPin13, HIGH);
    case 12:
    digitalWrite(digitalOutPin12, HIGH);
    case 11:
    digitalWrite(digitalOutPin11, HIGH);
    case 10:
    digitalWrite(digitalOutPin10, HIGH);
    case 9:
    digitalWrite(digitalOutPin9, HIGH);
    case 8:
    digitalWrite(digitalOutPin8, HIGH);
    case 7:
    digitalWrite(digitalOutPin7, HIGH);
    case 6:
    digitalWrite(digitalOutPin6, HIGH);
    case 5:
    digitalWrite(digitalOutPin5, HIGH);
    case 4:
    digitalWrite(digitalOutPin4, HIGH);
    case 3:
    digitalWrite(digitalOutPin0, HIGH);
    case 2:
    digitalWrite(digitalOutPin2, HIGH);
    case 1:
    digitalWrite(digitalOutPin1, HIGH);
    case 0:
    pwmValue = map(pwmPercent, 0, 100, 0, 255);
    analogWrite(analogOutPinPwm, pwmValue);
    //add method set all pins except pwmValue to low
    break;

    }

    i=outputPin;
    while (i<=13)
    {
    digitalWrite(i, LOW);
    i++;
    }
    // wait 2 milliseconds before the next loop
    // for the analog-to-digital converter to settle
    // after the last reading:
    delay(2);
    }


    Could you tell me if this looks like it will work? I think it should.


    I'll upload a schematic tomorrow.

  30. #30

    Default Re: DIY led driver

    I'm facing 2 problems. I thought the vdd pin of the amc 7135 would switch the led on and off. It isn't if I tie it high or to ground. The other problem is when I connect the led to my cree easwhite led it gives less than 1ma nomatter how i attach the vdd pin.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •