So you wanted to know what PWM is? (NEW video inside)

PEU

Flashlight Enthusiast
Joined
Feb 26, 2004
Messages
3,600
Location
Buenos Aires / Argentina (I like ribs)
This is a video of a working prototype of my upcoming flashlight converter.

One interesting detail on this video, and the reason I made a separate post for it, was provided by the digital camera I used (Lumix FZ7): the converter levels are controlled by PWM (Pulse wide modulation), if you look at the lens glow on high level you will see no gaps in it (100% duty cycle), but then when I switch to med (50%) and low (2%), you can clearly see how the glow shows the amount of ON-OFF that makes the LED dim.

This is the best visual explanation I ever saw on PWM, and it happened by simply serendipity.

Google Video Link (Better Quality)
Youtube Video Link

Enjoy it.


Pablo
 
Last edited:

PEU

Flashlight Enthusiast
Joined
Feb 26, 2004
Messages
3,600
Location
Buenos Aires / Argentina (I like ribs)
Re: So you wanted to know what PWM is? (video inside)

I added another video link Chris, it should be available pretty soon, Youtube is processing it as I write this.


Pablo
 

bombelman

Flashlight Enthusiast
Joined
Aug 26, 2005
Messages
1,751
Re: So you wanted to know what PWM is? (video inside)

yeah, really cool !!
 

highorder

Enlightened
Joined
May 17, 2006
Messages
540
Location
Michigan
Re: So you wanted to know what PWM is? (video inside)

wow. I noticed the same effect when pointing my FF3 at my Sony DCS-W50. I didnt realize what I was seeing. thanks for the enlightenment!
 

65535

Flashlight Enthusiast
Joined
Dec 13, 2006
Messages
3,320
Location
*Out There* (Irvine, CA)
Re: So you wanted to know what PWM is? (video inside)

You mean you didn't add that pink glarish line??? O btw thats damn cool what do you prefer and ultra high frequency pwm rate or a lower rate. I would assume that a super high rate would kill the led and as would a super low rate I suppose you found a safe good range? O also nice work.
 

PEU

Flashlight Enthusiast
Joined
Feb 26, 2004
Messages
3,600
Location
Buenos Aires / Argentina (I like ribs)
Re: So you wanted to know what PWM is? (video inside)

I didn't added the glare, it was the camera that saturated :)

The frequency used is 400hz and Im almost sure you can't see the flicker at this frequency, and no, the led does not suffer used this way.

The glare in the video shows the duty cycle, not the frequency, it probably shows a multiple of the frequency, the video was taken at 30 frames per second, I guess if I use 300hz for the PWM rate the glare would stand still... :thinking: I will make a new program just for this, looks like an interesting test :)


Pablo
 
Last edited:

PEU

Flashlight Enthusiast
Joined
Feb 26, 2004
Messages
3,600
Location
Buenos Aires / Argentina (I like ribs)
Yesterday by simple serendipity I discovered that when the camera saturates with the power LED glow, it shows the duty cycle of the LED being PWMed, so I made this second video to show more PWM levels.

Also by calibrating the PWM frequency with the camera frames per second I managed to almost freeze the glow (in the first video it moved)

Hope you all like it.

Youtube Video

Google video (better quality)


Here is the code I used for the video:

Code:
DEFINE OSC 4
ansel=0                     ' do not use comparator
trisio=%00000000            ' set gpio   
cmcon0=7   '12f683
frecu       con 299         ' set frequency to 299hz (tried many values)
conta       var byte
conta1      var byte

for conta=1 to 9        '0% to 90% duty cycle
    hpwm 0,conta*25,frecu
    pause 1000
next conta

hpwm 0,255,frecu        '100 duty cycle
pause 1000

for conta1=1 to 2       ' 2x up-down loops
    for conta=1 to 255
        hpwm 0,conta,frecu
        pause 10
    next conta
    for conta=255 to 1 step -1
        hpwm 0,conta,frecu
        pause 10
    next conta
    pause 100
next conta1

end


Pablo
 
Last edited:

AlexGT

Flashlight Enthusiast
Joined
Jan 15, 2001
Messages
3,651
Location
Houston, Texas
Thanks for the video!, I can see the PWM of my LH with my bare eyes when I shine it on a reflective surface during use.

AlexGT
 

georges80

Flashlight Enthusiast
Joined
Oct 23, 2002
Messages
1,262
Location
Sunnyvale, CA
AlexGT said:
Thanks for the video!, I can see the PWM of my LH with my bare eyes when I shine it on a reflective surface during use.

AlexGT

The LH runs PWM at close to 800Hz. Can't imagine too many surfaces that would allow you eyes to see the PWM unless you were moving the light around rapidly ->

You can see PWM very clearly if you have a LED light that uses it. Just set the light on low and then swing it back and forth in an arc while looking at the LED. You'll see essentially what's on the video - on/off segments.

Of course with an oscilliscope you can observe the same on/off pulse train as you vary the duty cycle.

Old strobe tricks, if you vary the PWM frequency and shine at a moving object like fan blades you can make them 'freeze', vary the frequency a little and you can make them look like they are slowly moving forwards or backwards.

george.
 

D MacAlpine

Newly Enlightened
Joined
Nov 10, 2005
Messages
167
Location
London (UK)
Love the videos, especially the title cards! (no, I'm not old enough to have seen silent films at a theatre......)

On a similar note I have noticed that the led light clusters which buses around here use for rear lights can be seen to flash on and off on video recordings. The effect is quite odd as they seem to do so at random intervals, presumably as the video frames catch the "off" portion of the duty cycle.
 
Top