You could use IR gate sensors like
these to detect when the finish line is crossed.
It will be no use for precise timing, but it should do for a video replay of free-running video of the finish.
Relay output is easy to connect to the GPIO.
I got a couple of these and tried them out triggering my DSLR (Canon 350D) through the shutter release socket.
They need 12 - 24V so I connected them to two 9V batteries in series (get some wire-ended battery clips).
The beam is modulated and filtered and seems quite immune to sunlight and showerproof.
I would suggest setting the beam a few seconds before the finish line (3 seconds, say) and set a script to start raspivid recording for, say, 6 seconds. Once raspivid returns call mplayer (or other) to play the clip with repeat and slow speed.
Code: Select all
mplayer -speed NUMBER file.ext
NUMBER < 0.01 - 100
Something like: (Untested!)
Code: Select all
#!/bin/bash
#AF
gpio mode 3 in
while :
do
TRIG=`gpio read 3`
if [[ $TRIG == 1 ]]
then
#echo "Triggered"
raspivid -o finish.h264 -t 8
mplayer -speed 0.25 finish.h264
mplayer -speed 0.25 finish.h264
exit
fi
done
You run a risk that 30 frames per second may not happen to catch the exact line crossing, but for a school / scouts race it should do.
You could use twi sensor beams, one to start recording and the other to measure the approximate time to crossing the line, so that you can replay a shorter part of the clip with some confidence that it will show the key moments.
I suggest you include a replay button that re-runs the full recording, if required.
The good thing is it's really quick and cheap to try out.