for my studies project I need to detect a photographing smartphone via its flash.
I tried it with a LDR, but that doesn’t really work well. I can detect a flash, but also other changes in the light are detected, like when a person walks by the LDR.
I could probably work around this by using two LDRs, but maybe there’s a simpler approach. Maybe something like a phototransistor, but I don’t know how they work.
In my opinion, I don’t really need to measure a difference in lighting during a time, but maybe the amount of photons which enter the sensor or something like that?
In my opinion, I don't really need to measure a difference in lighting during a time,
You can add some kind of timing Flash durations are very short (roughly between 1/1000s and 1/20000s). It's not very likely that moving objects can allow light on the LDR and 1/1000s later block it.
So my approach would be to wait till the light hits the LDR and store the time when that happens (micros()); next wait till the light is gone and compare the time (micros() again) when this happens with the time when the light did hit the sensor. If the difference is smaller that 1/1000s, it's a flash, else it's something else.
You might want to do a bit of calibration (measuring) on the duration of the flash as the numbers that I gave are not for cell phone cameras but for flashes that attach to dSLRs and the likes.
Note that micros() rolls over after about 70 minutes; see micros() reference. If that happens while the starttime was set, you can get a false negative.
Thank you, sterretje, that’s a nice solution. I will try it out!
I feel like there also could be a solution with interrupts—I mean, so the flash triggers the interrupt, via it’s rhythm or it’s light intensity or something like that. What do you think?
aarg:
Cell phone "flash" are just white LEDs. The flash duration is never that short. The LEDs don't have enough intensity for that.
I should actually have realized that. Time to do some measurements first before using the suggestef approach. Unfortunately I don't have a very smart phone.
So it’s generally more problematic to discover a smartphone flash than a real camera flash, because the light intensity is smaller and the flashing time/burning rate is greater?