Help with dimming interface for LED driver

Discussion in 'The Projects Forum' started by evilc66, May 22, 2015.

  1. evilc66

    Thread Starter New Member

    May 20, 2015
    1
    0
    Hello all. I hope someone can help me out with a challenge I'm facing.

    I'm trying to build an LED driver based around the Diodes ZXLD1360 driver IC. The circuit works, as far as powering the LED up from a wide range of voltages, but I'm having a little difficulty with the dimming interface.

    Here are my requirements:
    1. LED brightness must follow incoming pwm duty cycle (i.e. 0% duty cycle = 0% output, 100% duty cycle = 100% output)
    2. Output must default to 100% output when dimming signal is removed (floating)
    3. Must be compatible with 3.3v and 5v micros
    4. Must be small, as I'm trying to keep the pcb to 13mmx13mm. I know that's tough, and will expand the board size if necessary, but I have a little room to work with.
    The big problem I'm facing with this IC is that while it will take a digital input, the output is ratiometric to the peak input voltage, regardless of the duty cycle. Normally, they ask for 0-1.25v for 0-100% output, but they do allow higher voltages (pin is 6v tollerant), meaning that a 5v pwm signal would give 400% output. While I could adjust the sense resistor to compensate, it doesn't account for the fact that it could be hooked up to a 3.3v logic signal, and as a result, would lower the output.

    A PNP transistor (2n2907, currently set up on a breadboard) between the ADJ pin and ground gives me the logic that I want, and with a pull-up resistor between emitter and base I get the response I want when the dimming signal is removed, to a degree. With this setup, the pull-up resistor is altering the voltage at the ADJ pin beyond my desired spec. With 1K on the base and 10K as the pull-up (collector ties directly to ground), pwm voltage is about 3.25v. When the input is pulled, the voltage drops to 1.44v, which is acceptable, but this gives half the output compared to when the input signal is at 100% duty cycle.

    A suggestion I was given was to add an N-channel FET (2n7000, again, on a breadboard) in front of the PNP, with the base of the PNP tied to the drain of the FET. Source is tied to ground through a 100K resistor, gate has a 100K pull-down resistor, and the gate to the micro goes through a 1K. With the FET in place, the voltage at the ADJ pin comes down to about 2.5v peak. When the input signal is pulled though, the output shuts off, and the whole circuit has about 400mV across it, effectively pulling the ADJ pin into a low state.

    One thing I had thought about doing was to keep the PNP setup, and add a 2.5v zener (with matching series resistor of course) to the incoming pwm signal as a voltage shunt. This should cap the voltage at the base of the PNP to more manageable levels, and should be voltage agnostic as far as the incoming signal is concerned. I went with 2.5v because anything less than that gets expensive really fast (a 1.25v shunt regulator would cost almost double what the entire driver BOM costs at the moment). A point of concern though was the high leakage current (seems to be common at this low of a voltage). I wasn't sure if 100uA was going to cause any problems. I have some sample parts on the way for that to test it out.

    Anyway, that's what I've tried so far, and what I've found as a result. Can anyone suggest any better alternatives? My electron-fu isn't that great, but I learn fast.

    Thanks in advance.
     
  2. DickCappels

    Moderator

    Aug 21, 2008
    2,656
    632
    Pictures/schematic please.
     
  3. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Sounds like your plans are getting somewhat complicated. I would start with the datasheet recommendation:
    ZXLD1360-datasheet-excerpt.jpg
    This circuit doesn't care what the voltage of the incoming PWM signal is (3.3V or 5V controller.) However, since this would invert the logic of the incoming PWM signal, we need to invert the PWM logic before it hits the NPN transistor shown by putting another NPN in front of it. That inverts the logic back to its proper state, but means the absence of a PWM signal would yield no LED output. To fix that, we can add a pull-up resistor to the base of the of the new NPN. I haven't tested (or even simulated) this circuit, but I think it does everything you want:
    PWM-ZXLD1360.jpg
     
  4. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    On second thought, I may have overlooked one thing. I think I addressed the operational logic and the handling of no PWM signal, and this circuit definitely won't care if the PWM input is at 3.3V or 5V, but I'm not 100% sure what the PWM source will think of the voltage in this circuit...

    I'm not sure what the microcontroller GPIO pins can handle. When the pin goes low and we've got VCC feeding into the microcontroller through R2 and R1, will it be effected by the voltage of VCC, which may be significantly higher?

    What voltage do you plan to run your board and ZXLD1360 at? Will they be running at whatever voltage the microcontroller is running at? Or will they be on their own power supply at a different voltage? Depending on how great the disparity in voltages is and how the GPIO pins handle sinking current, my circuit might need modifications to protect the microcontroller output. Either way, R1 and R2 could be set so that the current would be negligible, but I don't know if the GPIO pins care about voltage above their own power supply voltage being applied to them.

    The solution (if needed) might be as simple as a Zener diode from the junction of R1 and R2 to Ground?
     
  5. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Hmmm... now I'm thinking myself in circles.

    The more I look at it, the more I think that whatever voltage gets to the junction of R1 and R2 from VCC will have an easier path to ground through Q1 than it will through R1 and the micro's GPIO pin, and therefore the GPIO pin will never see significant voltage from this circuit.

    I'm back to feeling pretty confident that it's all right as drawn. But I'd love to hear from someone more experienced than me (which is almost anyone here!)
     
  6. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Well, my uncertainty prompted me to finally try LTspice for the first time (been meaning to do this for a while now.)

    I've simulated this circuit with both 3.3V and 5V supplies for the transistors and with PWM inputs at 3.3V and 5.0V, as well as floating input. With a floating input, the adjust pin goes to 1.25V (meaning full LED output current as set elsewhere in the ZXLD1360 configuration) and with a PWM input (regardless of whether at 3.3 or 5 volts,) the adjust pin matches the PWM signal, but at 1.25V, and with no logic reversal.

    V1 and R4 are just there to simulate the internal 1.25V reference voltage and pullup resistor described in the datasheet. Hopefully I set this simulation up correctly.

    Pretty sure this matches the OP's requirements.
    PWM-ZXLD1360.jpg
    PWM-ZXLD1360_plot.jpg
     
  7. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    There's also a really simple circuit that ALMOST works. On the high cycles, the PWM signal gets through perfectly, but on the low cycles, the adjust pin only drops to whatever the forward voltage of the chosen diode is (~110mV as drawn,) meaning the LED current will not track accurately - probably not noticeable at mid to high duty cycles, but it definitely won't be right at very low duty cycles... but it's the simplest circuit imaginable!

    PWM-ZXLD1360_diode.jpg
    PWM-ZXLD1360_diode_plot.jpg
     
Loading...