Shop OBEX P1 Docs P2 Docs Learn Events
Fading LED without PWM? — Parallax Forums

Fading LED without PWM?

xesxesxesxes Posts: 9
edited 2010-01-29 23:38 in BASIC Stamp
Greetings all, after some searching I can't seem the find any methods for Fading LED's in and out without using PWM. I am working on some lighting for a movie prop, and the PWM is causing noticeable flicker on camera (in the dimmer ranges). We are driving some powerful LEDs through a luxdrive.com buckpuck. The driver has a control lead that we can manually control with a 5k Pot. Any help would be greatly appreciated.

Thank you very much.

Comments

  • ercoerco Posts: 20,256
    edited 2010-01-28 19:13
    The long way around is to rotate your existing pot with a Stamp-controlled servo.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-01-28 19:31
    Can't you use an op-amp as an adjustable voltage? Basically, you need a D-to-A converter (like a resistor + capacitor) to give you your desired output-voltage (for the wiper on the 5K pot) and an op-amp to buffer that voltage.

    Somebody more knowlegeable than me will have to verify this.
  • xesxesxesxes Posts: 9
    edited 2010-01-28 19:53
    I'm not a big electronics person, I do ok at programing the logic. But when it comes to capacitor and formulas my head starts to spin. Could you explain to me how an "op-amp" works and how it affects this? I am guessing the resistor and capacitor are to smooth out the square wave?
  • JDJD Posts: 570
    edited 2010-01-28 19:58
    Xesxes,

    You could also use the digital potentiometer to control the LED. However, the digital pot that we have is a 10 KΩ; but you could control it with a microcontroller enabling you to program the LED. There is an example of using the AD5220 digital pot in What's A Microcontroller? text [noparse][[/noparse]chapter 9]. Here is a link for your review.

    What's A Microcontroller? Text:
    http://www.parallax.com/Portals/0/Downloads/docs/books/edu/Wamv2_2.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • skylightskylight Posts: 1,915
    edited 2010-01-28 20:21
    looking from a different direction use the shutter function on your camera to compensate for the flicker
  • eod_punkeod_punk Posts: 146
    edited 2010-01-28 23:24
    Maxim IC has some 10k, 50k, and 100k dual digital potentiometers. you can request some free samples at this URL.
    https://shop.maxim-ic.com/storefront/searchsample.do?menuitem=Sample&event=SampleSearchLoad

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is no problem that can't be solved with a suitable amount of explosives!

    EOD Memorial
  • xesxesxesxes Posts: 9
    edited 2010-01-29 00:27
    so I have ordered some digital Pots from digi-key that should be here tomorrow. I bought some AD522's, however the Pot I'm trying to replace is a 5k. Soooo I also ordered some of these...

    http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf

    They seem pretty cool, they use serial to increment or decrement the wiper. And from what I can tell you can read the wipers location and set a specific location. But I am trying to figure out how I would wire it up and send commands to it. So that when they arrive I can dive right in and see if it is my flicker solution. So basicly I am asking if some of you fine folks could take a look at the datasheet and give me a nudge in the right direction. I am gettting confused with the memory location and errcmd bit settings.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-01-29 20:31
    erco said...
    The long way around is to rotate your existing pot with a Stamp-controlled servo.

    Wow, that's awesome! So what if I want to use a ten turn pot???? smilewinkgrin.gif
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-01-29 20:38
    Well, you could use a continuous rotation servo -- but when modified for 'continuous' use, you lose absolute positioning, so you'll need to measure the resistance or something to know when to stop turning.
  • skylightskylight Posts: 1,915
    edited 2010-01-29 20:56
    what make of camera is being used? using the shutter speed function would save any mods
  • xesxesxesxes Posts: 9
    edited 2010-01-29 22:03
    no Idea what camera it is, this is a prop for a major motion picture... :[noparse]:coy:[/noparse]: and we are just the prop shop hired to make the props. On the topic of the digtal pot I got, I have to use ShiftIn and Shiftout to communicate with it but I can't figure out how to read what it tells me, am I capturing the right bits etc.
  • CampeckCampeck Posts: 111
    edited 2010-01-29 23:38
    What Allanlane said...

    http://forums.parallax.com/showthread.php?p=875428

    Did you see this thread? By applying a PWM command to the input of the RC network the capacitor gets charged to a voltage with 255 steps. or 8 bit. (At least with a BS2 it does...) Then the OPamp buffers that to provide current to the transistor which if you pick correctly could power your high power LED's. Maybe a darlington pair?

    This code should then fade the LED in and out with no flicker...

    FOR counter = lowlevel TO highlevel
    PWM pin, counter, time
    NEXT

    FOR counter = highlevel TO lowlevel
    PWM pin, counter, time
    NEXT

    Time needs to be established by the RC network as in the analog and digital parallax book as:
    4 * R * C = time in milliseconds.

    And the lowlevel needs to be put right where the LED starts to come on.

    and Highlevel's max should be 255

    Post Edited (Campeck) : 1/29/2010 11:44:45 PM GMT
Sign In or Register to comment.