Measuring PWM?

I noticed on CPF that some are able to measure PWM by using a piece of software called Soundcard Oscilloscope.

It works by using the line in of your soundcard to measure PWM.

The details of how this is done are very sketchy on CPF (the thread is quite old with dead links). They mention using a seperate LED for some reason.

Any ideas how you would use this program and method to measure PWM in our lights?

I don't know anything about software scopes but it should work.

The princple is that all diodes are light sensitive, even ones that are meant to emit light.

As proof of concept I dug out a red 5 mm led from my junk box and shone a flashlight on it while it was connected it to my old Telequipment oscilloscope.

The trace isn't the shape I had expected but c'est la vie. The period is 90 microseconds and the amplitude is 90 mV. I leave it as an exercise to show that the frequency is a bit over 11 kHz

Hope this helps, Go for it and report back.

Cheers,
Angus

It might be a long shot...

The software is intended to analyze captured sounds. My ultrafire c3 emits sound in every mode it is turend on. The lower the mode is the more it is audible. A good microphone is probably enough to pick even the tiny anomalies we don't usually hear. I understand that what i hear from the c3 is in the range of 1-5kHz. That might also be the pwm of the led driver.

I watched X-files yesterday evening so please be nice with me if this sounds too science fiction...

ScullytheytookmysisterFoy!

Where did i have misplaced my studio grade mic... ?!?

It isn't the sound emission but the PWM producing audio-frequency pulses - which is what soundcards read and write. The trick is getting it to a voltage that the card can understand or cope with. The forward voltage of most LEDs is in that range. You feed the driver output to the LED into the Mic input. Not a good idea for high-power drivers but XR-E drivers shouldn't fry the card.

At least that's how I've always understood how they work.

Best to use a well protected and very cheap sound card to try this.

Try moving the flashlight during a predetermined exposure on your camera. Then count the number of individual segments created for that particular timelength (exposure).

For instance if the exposure is 1/4 of a second and it yields 25 segments then the frequwency is 100 per second.

Does this help or are you after something else?

Hadn't thought of that one. Good idea!

No No No

Don't take anything apart.

Just connect a light sensor to the input of your soundcard. In this case your light sensor happens to be a led. That's all.

The AC voltage needed by the soundcard is generated by the led alone. Leds can work either way: electricity-to-light and light-to-electricity.

Just shine the flashlight onto the led. As I mentioned in a previous post the led will generate an AV voltage in the neighborhood of 90 mV and 90 mV is absolutely the perfect voltage for a sound card.

Nothing will be fried. A piezo microphone puts out voltages in the same ballpark. Have you ever seen the output from a microphone fry anything?

Remember, you don't take your light apart! You just shine it on your light sensor. Clear?

Cheers,
Angus

I don't know much about any of this, but if you divide 1 second by 90 microseconds you get 11111.111... In other words there should be about 11,111 pulses per second, or 11Khz.

So i should get a mono jack and solder a generic let to it and use that as the sensor?

yes

Ideally you should use shielded cable, perhaps from an old microphone. Its plug might even be the right size.

Alternatively twist the wires together. You want to minimise AC hum and other electrical noise.

Cheers,
Angus

I never knew that an LED was light sensitive, the method all makes sense to me now. Thanks angusinalberta.

There was also some reference that you can also use a solar cells (such as those found in calculators) as they are more sensitive.

I may give the LED method a shot at the weekend.

Thanks Angus. I always love DIY meters for something! Being able to hook them on a PC even is even better! I make my own using STP cat 6 cable i have laying around and grounded one side should be pretty okayish (will use only 1 twisted pair of the 4, many do very stupid things with those cables...). Anyway... any LED in particular that works better in this application or should i try a few then decide myself? :)

There are quite a few things you can do that take advantage of that little bonus feature of LEDs like this sort of thing

I took few measurements with soundcard oscilloscope program and small green diode as sensor. After reading results I finally understand pwm problems with led flashlights. PWM frequency is just one part of the problem, other one is small duty cycle percentage, which in combination with low PWM frequency is responsible for that nasty flickering feeling.

Few examples:

Dealextreme UltraFire P10 with XP-G R4 warm (no visible flickering)

Hz Duty % approx. Current
High 7819 65 1350 mA
Mid 7826 50 820 mA
Low 7826 20 290 mA
Strobe 5,1 50

Jaws light with AMC7135 AK-47 driver and xr-e q5 3-mode (no visible flickering)

Hz Duty % approx. Current
High 4514 80 990 mA
Mid 4528 30 300 mA
Low 4520 5 40 ma
Strobe n/a n/a

Dino Direct C8 with SG PCB (barely visible flickering on med. terrible on low)

Hz Duty % approx. Current
High 197,8 85 2700 mA
Mid 199 40 1210 mA
Low 200 5 120 mA
Strobe 9,9 50


Manafont Trustfire TR-3T6 3x18650 (barely visible flickering on med and slightly worse on low)

Hz Duty % approx. Current
High n/a n/a 1570 mA
Mid 122,9 40 700 mA
Low 147,5 10 180 mA
Strobe 7,9 50

Manafont SkyRay P10 with XP-G R5 with AMC7135 based driver (no visible flickering)

Hz Duty % approx. Current
High n/a n/a 1030 mA
Mid 123,7 50 510 mA
Low 123,7 25 250 mA
Strobe 7,5 50

KD 105C 8xAMC7135 driver powering 3x xp-g R5 in parallel (no visible flickering)

Hz Duty % approx.
High 4640 85
Mid 4651 45
Low 4654 20
Strobe 7,5 40

Hey guys, I'm looking to build this cable over the weekend but using solar cell that was removed from calculator. The highest voltage I measured was around 3v, would that be ok for this set up?

Also, I see the wiring diagram above but I don't think I have a mono jack so:

  1. do I just simply wire the stereo cables together (matching the colors)?
  2. does polarity of solar cell matter?

Thx!,
Tim

Manafont Ultrafire 3-Mode T6 P60 Dropin
http://www.manafont.com/product_info.php/ultrafire-cree-t6-3mode-memory-led-dropin-module-42v-max-p-5178

High-Mode: Direct Drive; No PWM

Medium-Mode: PWM, 30% Duty @ 128.53Hz

Low-Mode: PWM, 5.2% Duty @ 131.72Hz

Numbers are close.. I took them with the crappy little 250Mhz scope in my lab, but for these purposes, they're plenty close enough...

PPtk