Measuring the duration of a flash

styrophil

Member
I'd be interested if anyone has ideas on how to measure the duration of a camera flash. The duration is normally taken to be the time it takes for the flash to rise to 25% of peak power and then drop down to the same level again. Timings are often in the region of 10 microseconds. Accuracy would need to be about +-10% and could be averaged over a number of tests.

You can see some related info and graphs here...

Discharge Curves For Electronic Flash

I can't imagine that there is a Picaxe only solution to this but is there some suitable circuit that could be used. I understand that the best way is probably to use a scope but I'm thinking of a more portable solution.

Any ideas welcome.
 

alband

Senior Member
If you have some for of light sensor (simple LRD might do?) there are lots of options.

You could attached the output of the sensor to a picaxe pin then use the "pulsin" command to give you a figure. (perhaps use the "setfreq" command to get the correct acuracy).

You could attached the sensor to an oscilloscope is you have one (if you don't there are a few free PC "soundcard oscilloscopes" out there - what I use).
 

BeanieBots

Moderator
An LDR won't even know the flash has happened. They are far too slow.
Use a photo transistor as suggested by Rick.

Timing will be tricky with a PICAXE.
At regular clock speeds (4Mhz) the pulsin has a resolution of 10uS.
Even at 16Mhz you will only be able resolve down to 2.5uS increments.

I'd go for a harware counter clocked at say 20Mhz (0.05uS resolution) and use the PICAXE to read the value and report back to a display.

At those sort of time frames you will need to take great care not to introduce any stray capacitance on your sensor and connections.
Carefully read the datasheet of any sensor you consider to make sure it has adequate response.
 

hippy

Ex-Staff (retired)
You'd have to look at what can be achieved by externally clocking an internal timer by configuring SFR's appropriately, or use an external counter.

http://www.picaxeforum.co.uk/showthread.php?t=12769

It should be possible to use a PICAXE to measure time to an accuracy of 1us or better.

A separate issue is how you are going to build the flash detector hardware itself and what its response and decay times are.
 

fernando_g

Senior Member
a CdS resistive photocell would be too slow. You really need a phototransistor. If the phototransistor does have a base lead (preferred) connect a 100k ~ 470k resistor to ground.

Triggering on the risetime should be a piece of cake. But how about the fall time? As the scope images clearly show, the output decays exponentially because of the capacitor discharge, so you need to use a PICAXE pin with Schmitt trigger input.

Hippy compiled such a list, which shows which pins for which PICAXE have ST inputs.
 

eclectic

Moderator
Not perfect by any means,
but just to see if it would work. :)

BPW34. Anode to +5v
Cathode > 10k > Input 0
and to >100k > gnd

Old Sigma EF-430 flashgun

Code:
#picaxe 28x2
#no_table

let dirsB = %11111111
let adcsetup = 0
symbol Flashpulse = w0
symbol counter    = w1
symbol Runtotal   = w2
symbol average    = w3 

main:
pulsin C.0 ,1 , Flashpulse

If flashpulse > 1 then
counter  = counter +1
runtotal = runtotal + flashpulse
average  = runtotal / counter
sertxd (cr,lf, #flashpulse,"  ",#average,cr,lf)
endif
goto main
Cheaposcope display.

It obviously won't catch a single flash every time,
but might help.

Next post shows output from the
“stroboscope” mode.
 

Attachments

Dippy

Moderator
Is this a general purpose any-old camera flash tester.
Or a special rig for one type of camera flash?

"The duration is normally taken to be the time it takes for the flash to rise to 25% of peak power and then drop down to the same level again"

- do you really mean the time between 25% of peak on the leading edge to 25% of peak on the falling edge?

i.e. start timing at 25% then until it drops again to 25% of peak?


How are you going to determine 25% of peak intensity with PICAXE?

Unless you do a pile of samples you can't tell the peak intensity before its happened.
If you can't detect peak intensity accurately and consistently then how can you work out 25% as your start point.
Unless you have it in some calibrated jig and do a lot of setting up then you'll have a problem.
Hence my first question above.


If you can be happy with an arbitary start-stop point then I'm sure PICAXE can do it.
The posts above prove it.
You may wish to use a fast comparator input for consitency. You may want schmit.

But for a specific and fairly accurate Peak/4 (as you mentioned in your original post) for tesing any old flashgun I doubt if you have a chance with PICAXE unless you have extra hardware.

I have to question gently the use of a photo-transistor. Yes, obviously an LDR is hopeless, but consider a photo-diode plus op-amp.

If your flash drives the photo-tr into saturation then you will not be able to detect the absolute peak.
If you can't detect that then you can't work out 25% of it.
Some phot-trans are a bit slow for this work, you'd have to check carefully.
All in all for a general purpose device a sutiable small photodiode would be better.


For a reliable portable solution for press-the-tit-and-get-a-result without much external hardware I would suggest a dsPIC.
 

styrophil

Member
Thank you all for the replies.

Dippy - Yes that's the time from 25% on the rising edge to 25% on the falling edge, and yes again I can't see how you can do it with a Picaxe without additional hardware. Perhaps my original question should have been that, assuming I am using a picaxe just as a master controller and to output readings to a LCD what additional hardware should I be looking at. I am sure that the posters here might have some ideas about specialist circuits/chips.

One possibility does spring to mind. Flash guns have fairly consistent power output so it would be possible to measure the peak output over, say, ten shots and then set a level for the rising and falling edge level at peak/4. Next you do another 10 shots measuring the timing interval. How you turn the peak measurement into a trigger level for the timing measurements I have no idea.

And once again yes it would need to be a general purpose device for all normal camera hot shoe mounted flash guns. It wouldn't be too hard to make a small rig that would hold the flash gun a predetermined distance from the sensor(s).

Eclectic - Interesting idea. If you have the same Sigma EF-430 as the one sitting on my desk could you set the output to 1/16 power and try your readings again. I'd be interested to know if if the duration detected is noticeably shorter than the duration at full power. I'll try the same thing here as I have the same kit and we can compare readings. Might take me a few days as I'm trying to get all my other stuff out of the way and write some course notes for next term!
 

eclectic

Moderator
Sigma EF-430 Super (c. 12 years old)
Full power (full circle) then 1/16 power.

Full = ~3000x 5 microsec (15ms)
1/16 = ~ 150 x 5 microsec (0.75 ms)
 

Attachments

styrophil

Member
A genuine question if I may.....why?
Well it's related to my flash trigger thing.

Camera manufacturers do not provide information on the duration of the burst of light from their flash guns. Well actually some do but they are not all measured in the same way and they don't supply the data for every power level.

If you want to take a photograph of a brief event the way to do it is to turn the power down on your flash gun which reduces the duration of the flash (I'm simplifying for brevity).

The question arises "Which flash gun is best for my needs?" I might be better off buying an old Vivitar 283 than a brand new Nikon SB-900.

There is no readily available comparison I can find anywhere. I can't buy all the flash guns in the world and test them on a scope at work. (I've just had an e-mail from work along the lines of "Did we really need two more SB-900 flashes?")

If I can make 4 or 5 relatively inexpensive units (read sub £50 each) and send them out into the wild then I can get people to send back the data and I can combine multiple readings for multiple flashes into a big table.
 

eclectic

Moderator
@styrophil

Following posts 12 and 13
a Nikon SB-600 at 1/64 power

= ~155 x 5 microseconds ( ~ 0. 775 ms)

So, similar to the Sigma at 1/16

e
 

hippy

Ex-Staff (retired)
It seems to me that the only reliable way of doing this is high-speed analogue sampling, determining the peak, finding the 25% points and then finding the timing between them. Such sampling ( 100kHz for 10us accuracy ) is going to require fast ( and probably expensive ) hardware.

Measuring the peaks over a number of samples will only give reliable results if the flash is locked at a fixed distance so peak will not changed when the 25% points have been set and timing using those settings is then performed. Otherwise it's not clear what you are actually measuring and results tend to move into the 'meaningless' category.

The former gives a point-and-flash test with the results averaged out, the second seems a much more complicated setup.

Easiest solution seems to be to take the detector input into a good digital scope, use its capability to determine min and max, move the measuring cursors to the 25% points and read off the time between them which a decent scope will have calculated for you. I suspect that's how people are doing their measurements at present.

You could probably use a PC-based scope and a PC application to do all that automatically. Ship out a detector, PC scope and CD, then get your answers back.
 

BeanieBots

Moderator
I'm no expert in photography but I know enough to know that duration is only a small part of the equation.

This scenario comes to mind. One flash of duration X gives a certain result.
Ten thousand units all triggered together, have an identical duration but would significantly increase exposure!

Hippy mentioned analogue measurements. I think this would be the required approach. Possibly a combination of both digital for duration and integrated analogue for 'power density'.

I've done a similar project for measuring spark energies which might be appropriate here. The basics was to use a fast A2D which was clocked directly into SRAM. This could then be read at leisure much like a DSO.
 

Dippy

Moderator
I think in addition to the analogue sampling I mentioned in Post #9 it would be an easy task to integrate the numbers to provide a total energy value.

Maybe you could use the method described by (I think) Wolfy to get fast sampling - mostly hardware. Then analyse the results.
I think the hardware is probably along the lines described by BB.

Quite a task for PICAXE plus hardware. Not for the faint-hearted and I think others will have to provide a circuit design and code for you.

Mathematically, all this is quite easy. And most of the electronics is fairly straight forward in principle.
Though, from scratch, it would take a lot of fiddling. Maybe Wolfy's circuit can be adapted? I really can't remember.

I know what my first step would be, but it's not rel to PICAXE.

Good luck with this project.
 

fernando_g

Senior Member
Some (quite interesting) rise and fall time comparisons among different devices:

CdS photocell 9P9002: Tr= 60 ms, Tf= 25 ms
Phototransistor Ledtech UT1893: Tr= 15us, Tf= 15 us (over 1600X faster)
Photodiode Vishay BPV22NF: Tr= 100 nS, Tf = 100 ns (over 150X even faster)


Please note that some phototransistors and photodiodes have a visible light filter molded in, which will allow only IR light to be detected....
 
Last edited:

Rickharris

Senior Member
I guess if you make a pin hole camera from a small tin or film cassette (REMEMBER THEM?) then mount it on a rotating arm - control the speed with a picaxe so you know how fast it is going. The in the dark let off your flash - The duration cn be calculated by measuring the arc of light.
 

inglewoodpete

Senior Member
I'm not an expert in this field but the concern I have with using the rising and falling 25% points for determining the flash duration is: "Is the phototransistor operating within is linear region?"

If the phototransistor staturates at the peak of the flash, which I suspect it would, how can the 25% points be calculated? You would be measuring the transistor's performace, not the flashgun's.
 

boriz

Senior Member
Rick. Similar to what I was thinking....

A simple DC electric motor with a paper disk on it that is half black and half white. Many methods are available for measuring RPM. The method is simple:

In a dark room, place a camera on a tripod facing the top of the disk, spin the disk up to speed, open the camera shutter, trigger the flash, close the shutter, upload the picture to your PC, using your favourite graphics software highlight and measure the movement angle of the black/white dividing line, calculate flash duration.

That’s gotta be the cheapest method. Probably the method I’d use.
 

Dippy

Moderator
IPete: That's what I already said in Post #9.
For a general purpose device, which will need a wide dynamic range, I sincerely believe a photo-trans is unsuitable.

How are you going to measure intensity levels with a rotating doo-dah and digicam?
It's a lovely school demo but not really suitable for a wave-it-around portable device.

Fast multiple sampling has loads of benefits.
1. Post processing.
2. 'Saturation' detection.
3. (Potentially) Pulse shape display on a GLCD.

I guess the bottm line is how much effort can be given over to this project and electronic/programming skills.
 

styrophil

Member
Many thanks for all the replies so far.

Many ideas to think about here. Thank you all for your ideas and particularly to Eclectic for the measurements which were very interesting.

I really didn't anticipate this level of interest so thank you all for the time and interest.

I've now got lots of ideas to try out and I'll let you know how I do.

I've been a bit busy the last few day but I'll try putting something together soon.
 

boriz

Senior Member
If the spinning disk is not fast enough for a good reading, try this:

Mount a tiny mirror on the motor shaft and place the flash so that it is reflected off this mirror onto a white screen. Set up to photograph the ‘streak’ made by the flash, on the screen. With a long enough streak, you should be able to get some good ‘brightness curve’ info using a graphics package.
 

eclectic

Moderator
@Styrophil

Further thoughts on flash measurement.
All tests using AXE091 board 18X and 28X2

Calibration:
A simple program, to make a “flashgun”.
Code:
#picaxe 18x
main:
pulsout 4,10
pause 500
goto main
via resistor > Ultrabright LED.
The pulse checked on an uncalibrated 'scope at 100μs.

In my earlier posts, I used a 100k resistor on the BPW34.
The measured value of the 100μs LED pulse was very high.
I've now changed the resistor to a 4k7.
Much better.

Four new EF430 readings so far;

Calibration and Strobe. (attached)

“Full-circle” = ~ 3000 * 5 = ~15 ms
“1/16 circle” = ~100 * 5 = ~ 500 μs / 0.5 ms

e(and OE)
 

Attachments

fernando_g

Senior Member
phototransistor's response

For whatever it is worth, please find attached file, where I measure the response speed of a phototransistor.
I employed the manufacturer's suggested circuit (collector to +5, emitter through a 100 ohm to gnd, base open).

The yellow trace is the LED's drive voltage, the resistor was adjusted to provide a current of about 10 mA and illuminates the phototransistor. A logic low means the LED is on.

The red and blue traces are the phototransistor's response. The former is the response to an infrared LED, the latter to a white LED, which are virtually identical. Please note the vertical value for these traces, it is only 200 mV/div.

What this is telling me that a phototransistor may add some error to the measurement, but you may compensate from that if the error remains constant.

Also the voltage swing is not enough to trigger the PICAXE reliably. You may need a fast comparator ahead of it, to convert it to the proper signal swing.
 

Attachments

Top