The project is for an arduino to detect a flash from a cameras flashlight. From looking online it looks like a phototransistor would work as theyre fast.
Can the sensitivity be programmed in or does a potentiometer need to be used instead?
The project is for an arduino to detect a flash from a cameras flashlight. From looking online it looks like a phototransistor would work as theyre fast.
Can the sensitivity be programmed in or does a potentiometer need to be used instead?
I guess the first thing is you need to know the difference between a camera flashlight and any other flashlight? What is it really that you are wanting to build?
The arduino is to control a motor that turns. I need the arduino to detect a picture has been taken with a flash. If it doesnt detect the flash then dont continue moving motor until it has.
The flash is from a flashgun, specifically Sony HVL-F42AM.
So, what is unique about that particular light from that particular device? I think you are assuming something more than is possible.
Not sure what you mean Paul_KD7HB. Its a flashgun like any other flashlight used for photography. The arduino just needs to be able to detect the flash (will be in a darkened room).
Get one of each and try it, I can't think of a reason it won't work.
I recommend using a photodiode, as the flash duration can be as short as 1/4000 of a second in certain ranges. While CDS cells are convenient, they are far too slow for this application.
This link might be helpful: Hobby Circuit - XENON Lamp Flash Detector, designed by David A. Johnson, P.E Hobby Circuit - XENON LAMP FLASH DETECTOR, Circuit designed by David A. Johnson, P.E.designed by David A. Johnson, P.E.
You might look for "optical slave circuit". These are devices that fire a second flash when they detect that the first flash has fired. How much will the ambient light change when your device is in use? Will it be outdoors?
Interesting on the "optical slave circuit". Looks like they use phototransistors as well. Ill try a couple and see how I get on. This will be indoors with low ambient light.
Thanks for the Xenon lamp flash detector stuff. Could be useful.
I doubt anybody else would be sure either. Optical slave triggers have been around for decades. I understand they use a phototransistor. About the only problem they have is being triggered by somebody else's flash. Not likely to apply here.
a cameras flashlight.
Oh come on Paul. A CAMERA flash. Very bright (at least above
ambient), very short-duration flash, usually from a Xenon Flash Tube (camera phones may use ultra-bright LEDs, with a longer and not as bright flash.)
Manual flashes tend to run about 1 ms in duration.
"Automatic" strobes can vary the flash duration to control exposure, sometimes getting down to 0.1ms or less.
There used to be a very simple "slave flash" circuit that used a LASCR ("Light Activated Silicon Controlled Rectifier") for flash detection, but I haven't seen an LASCR at dealers in ... decades. I'd assume that the light-detecting part of them is similar to a silicon photodiode, so a an silicon phototransistor or photodiode will probably work if properly biased (but phototransistors tend to have a wide range of sensitivities, and I don't know which specific ones might be most applicable.)
At least that means you probably don't need the sort of "as short as possible" response that you would need for a "slave flash" or other device that needed to operate while the camera shutter was still open...
You were very specific in identifying which light was to be detected. How do you think the detection will work? Is it intensity of light. Is it intensity and very short pulse? IS there a ingle light pulse or multiple flashes that appear to merge into one? What other lights will be interfering with the detection?
If an Arduino is to be used, and it's indoors, I wonder if something simple could be used to trigger a falling edge interrupt. You want it to pull D2 low when the flash fires, but not in ambient light. Maybe something like this:
As long as you test for increase in light level only while the servo is NOT moving, any sensor will work. An LDR may be the easiest to program for.
It turns out you don't need to use a phototransistor. A normal green LED will also work as a photodiode - not as well as a real photodiode, but well enough for this purpose. So you can drive the base of an NPN transistor through a reverse-biased green LED. The transistor will sink very little current in normal indoor lighting, but when exposed to camera flash the transistor turns on. Here's the circuit:
I set up my scope and tried this out with an off-camera flash set to the lowest power, and it produced a sharp falling edge all the way to ground, which lasted about 40us - perfect to produce an interrupt. The 33K resistor was intended to replicate what an internal pullup resistor would be, so you can probably do away with the external resistor and just set the pinMode to INPUT_PULLUP. But the external resistor would let you adjust the sensitivity of the setup. You could even use a pot for that. A higher resistance value would make it more sensitive to flash, but also lower the voltage a bit in normal light. Using the 33K, normal ambient light reduces the voltage on the pin from 5V to about 4.9V. A 100K resistor dropped it to about 4.7V, which of course is still HIGH.
You would need to experiment in the actual setup to see what will work, but I suspect this would do just fine.
A red LED might also work, but green is closer to the 5600K of most flashes, so it should produce more current.
Then your ISR could just save the current millis time, so your main loop can see when the last flash took place.
I guess I should add that I did check to see if a base resistor is needed for the above circuit. With the flash set to maximum power, and close to the LED, I only got about 0.9mA of base current with a 10 ohm resistor in series. In practice I assume the base current would be a lot less than that. So I don't think a resistor is needed.
What you did not consider is the length of time the light is being produced. Your meter cannot properly detect the current that is only there for a fraction of a millisecond.
I didn't use a multimeter to get the current. I used my scope, and captured the voltage drop across a 10-ohm resistor I inserted between the LED and the transistor base. So I did capture the entire curve of the current flow.
Excellent!