Make a high accuracy timing circuit using two low-cost IR sensors and an Arduino microcontroller.
This device can time the passing of an object past two checkpoints with high accuracy. Its intended use is for high school or middle school physics experiments. The speed of an object can be computed by timing how long it takes to cross the two sensors.
Your total cost can be less than $5 US if you have some basic materials available, such as a soldering station.
Bill of Materials:
http://www.aliexpress.com/item/Free-Shipping-Nano-... WARNING: They may have trouble communicating with a MAC. You may want to use official Branded Nano on Apple.
http://www.aliexpress.com/item/Free-shipping-IR-In...
http://www.aliexpress.com/item/Free-shipping-NANO-...
http://www.aliexpress.com/item/10pcs-4PIN-Single-r...
Load the attached sketch into the Arduino.
You will note that it uses the interrupts 0 and 1, which correspond to pins D2 and D3 respectively.
When the sensor attached to D2 senses a nearby object, the time is recorded.
When the sensor attached to D3 senses an object, this time is recorded.
The difference between the two times are reported on the USB/Serial port in microseconds.
If you just used the Arduino IDE to upload your sketch to the device, the easiest way to use the system is through the Arduino Serial Monitor feature. The IDE should already have the port set from the sketch upload, so just make sure that the serial monitor is set to the correct Baud rate, 115200 in the attached sketch.
Pass an object over the first sensor, and the on-board LED should light up.
Pass an object by the second sensor, and the on-board LED should turn off, and the elapsed time, in microseconds, should be printed to the serial monitor.
If you do not wish to monitor the output using the Arduino IDE Serial Monitor, there are many ways to communicate with a serial port. On Windows the putty program has the ability to communicate to the serial port. The Arduino serial port uses typical defaults, like 8-N-1, so the only setting necessary is the Baud rate of 115200. On LINUX I prefer:
screen /dev/ttyUSB0 115200
Use Ctrl-a k to kill when done.
Another common program for serial communication is cu,
cu -l /dev/ttyUSB0 -s 115200
type "~." to exit.
It can also be convenient to read the device directly after establishing proper settings:
stty -F /dev/ttyUSB0 115200
tail -f /dev/ttyUSB0
Substitute your serial device name for ttyUSB0 if your Arduino does not attach with this name. If your account is not in a group that allows access to the serial devices, often (dialout), try these commands with the sudo prefix.