I built a project using an Arduino microcontroller to manage high speed photography of an air rifle shooting targets like balloons.
I have a contact switch on the trigger. When that feeds a logic 1 into my Arduino program, I tell the camera to fire it's shutter, turn off the LED room lights, and start looking for the pellet from the air rifle to break a beam of LED light that's placed in front of the barrel of the gun. When that happens, my program times the amount of time the pellet takes to break a second beam that is exactly 2 inches past the first. My program uses the delay between the 2 events to calculate the speed of the pellet, and multiplies the by the distance to the target that I've entered into the Arduino.
At the calculated time my rig uses a solid state optio-isolator to close the contact on a flash.
Everything works well, to a point. I wrote Arduino code that deals with the i/o ports directly rather than using the Arduino functions to minimize the latency of inputs.
However, the Arduino is relatively slow, and it takes several instruction cycles to respond to a triggering event. That means that my calculated time is limited to multiples of the response time, meaning that my timing for firing the flash is often off by a small but important amount.
What I'd like to do is have a microsecond precise programmable realtime clock chip that I could trigger on a rising edge signal, have it measure the delay to the second sensor, calculate the projectile speed and the required delay until the projectile reaches the designated distance to target, and then trigger a logic 1 at that moment with microsecond accuracy.
Most real time clock chips I've seen output the time over a serial line, which would be way, way too slow for this application. Even for my air rifle application the pellet would be stuck in the "bullet trap" at the end of the target before the first time value has finished being sent to my microcontroller.
I'm currently working with air rifles, but hope to switch to .22 caliber bullets, which can move at faster than the speed of sound.
Is there some high precision programmable realtime clock chip I could use for this application? Or perhaps a circuit I could build with a quartz crystal, a digital counter, and a programmable gate array?
P.S. Here is a link to some of the results from my current setup. When it works, the results are very cool looking: