As they arrive, racers receive a car tag that includes a bar code telling their car number. As part of the check-in process, the boy puts his car on the photo stand and then scans the bar code. The RPi operates the camera and captures the photo, then uploads it to our web server, along with the car number. The receiving web server matches the car number to the racer and drives (among other things) a slide show of cars as they check in.
If you've somehow never heard of it, the Raspberry Pi is a $35 single-board computer with USB and HDMI ports. For this particular application, it's running headless (no display, no keyboard, no mouse) with a wifi dongle, bar code scanner and a USB cable running to the camera.
Bar code scanners are inexpensive; I used this particular one, but I believe most any scanner would work: http://www.amazon.com/Hi-Eshop-Automatic-Sensing-Handsfree-Adjustable/dp/B010FP9BVS?ie=UTF8&psc=1&redirect=true&ref_=oh_aui_detailpage_o03_s00
Most DSLR cameras can be operated under computer control (this is called "tethering," I think); gphoto2 is the usually-recommended software for this. I use a less-expensive Canon point-and-shoot, for which tethering wouldn't normally be an available feature; tethering is possible in this case using the excellent open-source firmware, the "Canon Hacker's Development Kit," or CHDK (http://chdk.wikia.com/wiki/CHDK), along with chdkptp running on the RPi (https://www.assembla.com/spaces/chdkptp/wiki).
I used a small C program to read the bar code scanner output; it's available at https://github.com/jeffpiazza/rpi-utils/tree/master/barcode. A shell script runs when the RPi starts up that loops continuously waiting for a new scan that starts with the letters "PWD"; when it reads one, it captures a photo (chdkptp) and uploads it to the server (curl):
Code: Select all
# Ignore error failures
while true ; do
CAR_NO=`barcode $BARCODE_SCANNER_DEV | grep -e "^PWD[0-9]*$" | sed -e "s/PWD//"`
if [ "$CAR_NO" ] ; then
PREFIX=`echo $CAR_NO | sed -e "s/\(PWD[0-9]\).*/\1/"`
# Assumes there's only one camera attached
chdkptp -c -e"rec" -e"remoteshoot Car$CAR_NO"
curl -F action=photo.upload \
-F MAX_FILE_SIZE=30000000 \
-F repo=car \
-F carnumber=$CAR_NO \
-F "photo=@Car$CAR_NO.jpg;type=image/jpeg" \
This all sounds a lot more complicated than it really is. Get in touch if I can help you with a similar project.