Shop OBEX P1 Docs P2 Docs Learn Events
How can the intensity AND the duration of an LED light pulse be varied independently? — Parallax Forums

How can the intensity AND the duration of an LED light pulse be varied independently?

ElectricAyeElectricAye Posts: 4,561
edited 2011-06-07 10:32 in Propeller 1
I need to bombard some material samples with trains of photon pulses. The pulses will be of a given wavelength of light, and LEDs look good enough for this. The idea is to keep the total number of photons delivered per large time interval fairly constant while gradually shortening the duration of each pulse. But because the duration of each pulse is getting shorter, that means the intensity level of each pulse must be increased. I will need to make about 16 of these pulsers, and right now I'm just guessing the shortest pulse will need to be about 1 millisecond.

To vary the pulsed intensity level of each LED (a variation which happens over a period of hours or days), I need to independently vary the pulsed voltage across each LED. I'm guessing some sort of PWM method would work to provide a desired voltage but it would need some sort of circuit to filter out the PWM frequency. Downstream of the PWM frequency filter, I think I will need something to work as the on/off switch to create a fairly clean pulse for each LED. Mind you, the common technique of simply feeding PWM signals directly to an LED won't work for this because the material sample can very likely "see" the PWM flicker if it's not filtered out. I can, however, live with about 5% to maybe 10% ripple in the light output of each pulse.

The peak requirements of each LED would be 4 volts at 100mA.
EDIT: this would be only during the circa 1 millisecond pulse. For steady state, the LED would run at about 3.4 volts at 30mA.

Anyone have suggestions on how best to approach this?

Thanks

Comments

  • RaymanRayman Posts: 14,876
    edited 2011-06-07 09:10
    A low cost way is to do PWM a prop pin to set a voltage level and use an RC filter to smooth it out as required.

    Then apply this voltage through a 1k resistor to the base of a transistor to drive the LED.

    On the other hand, you can buy I2C LED drivers that should work fine in the millisecond time scale.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-06-07 09:21
    Rayman wrote: »
    ...

    On the other hand, you can buy I2C LED drivers that should work fine in the millisecond time scale.

    Thanks, Rayman. Any particular I2C chips or chip families you would recommend?
  • RaymanRayman Posts: 14,876
    edited 2011-06-07 09:31
    There's a lot to choose from... I've mostly looked at them for LCD backlighting... I suppose it mainly depends on the number of LEDs you need to drive.

    Also, some are made to drive blue LEDs even with a 3.3 V supply, so they have a boost in them...
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2011-06-07 10:06
    An op-amp+transistor current sink might do what you want. The current is regulated by feedback from the voltage across the 20Ω resistor R1, made equal to the voltage across capacitor C1 at the op-amp non-inverting input.
    currentSink.gif

    The input time constant to filter the PWM is about 100 microseconds, so it could produce a decent pulse rise and fall time for a 1ms pulse. With Prop Vdd=3.3V, the PWM density of about 60% will give a 100 mA output, and a PWM density of 18% for the 30 mA steady state.
    The output transistor could alternatively be a logic level n-mosfet. The op-amp could be a generic LM358 or quad LM324
    311 x 166 - 5K
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2011-06-07 10:14
    It seems you need a dc power source that can be varied precisely
    across a narrow range like say 1.5 to 3.5v and which can be controlled
    easily by a Prop chip.

    Once you have the variable power source you could simply use the
    Prop to switch power on/off to control the duration of pulses to your
    LEDs?

    If this is what you need then perhaps you can use items at hand to do
    it instead of buying new parts. Everyone has old low-v ac transformers
    in their junk box so perhaps you can use one to build a Prop controlled
    variable dc supply.

    Try using an optocoupler to detect zero crossing of the transformer's output
    and use the Prop to switch the transformer's output to a large filter cap at
    just the right times and for just the right duration to deliver a particular dc
    voltage. You could precisely tune this using a scope I would think. It would
    be a cheap precision prop controlled dc supply (maybe)

    If I actually knew anything about electronics I could probably come up with
    a more sensible sounding idea :-)

    I wonder what would happen if you used a uC to do this to the raw 240vac
    without any transformer? it seems like you would have a variable supply
    of enormous amperage using really cheap parts? It would also have no
    isolation from the ac power line so it would be risky..LoL
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-06-07 10:26
    I like Tracy's circuit, because LED output is more proportional to current than to voltage. If the RC time constant proves troublesome for pulsing (or if you want an even smoother output by using a larger RC value), you could stick a MOSFET between the current-sense resistor and Vss and pulse its gate. (Be sure to pick a MOSFET with a low RDS(on) at a 3.3V gate drive.) That way the rise time will be a function of the op-amp's response and not of the RC time constant. The fall time will depend on the switching speed of the MOSFET.

    -Phil
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-06-07 10:28
    Thanks y'all.

    I think I'll mark this one as solved. While I probably will leave the mega transformer solution to another day, I think I'll try out ye ole el cheapo PWM RC filter concept first, and if that isn't good enough, I'll try out Tracy's high-falutin op amp solution.

    I'm sorta sleep-kludging today... haven't had much sleep lately. :-(

    thanks again!
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-06-07 10:32
    I like Tracy's circuit...

    Yes, it's pretty nifty looking. Thanks, Phil, for the additional inputs on this.

    BTW, anyone know how to mark a posting as "Solved"?
  • RaymanRayman Posts: 14,876
    edited 2011-06-07 10:32
    For the RC filter, try a low value resistor from the Prop pin, say 100 Ohms and a fairly big capacitor, like 1 or 10 uF. That way, the drain through the 1k to the resistor to the transistor is a small load on the filter...
Sign In or Register to comment.