Page 1 of 1

A motorcycle 'slow race' timing system

Posted: Tue Apr 01, 2008 10:05 pm
by Robertbarr
What I have in mind is a low-cost timing setup, used to measure the time between two events -- both of which would be the interruption of a light beam. Extreme accuracy isn't necessary -- 0.01 seconds would be fine, so no high-speed industrial stuff needed.

I want to measure the amount of time a motorcycle rider uses (without touching a foot to the ground) to cover a fixed distance, riding as slowly as possible, for perhaps 20 feet. In other words, a 'slow race'. You'll see these at various biker events, and it's a whole lot tougher than it looks. Here's the best I've seen in a long time:

http://www.youtube.com/watch?v=HrJvv_L8WBw

If you're a rider, you know how much skill you're looking at. If you're not, well, take my word for it.

I'm thinking of two pair of tripods, one for the start line and one for the end, with each pair holding an opto-electric device and a reflector.

I've found and tested two such devices from ebay. These are industrial controls, and really expensive when new -- about $200 a copy -- but of course on ebay they were about $12 + shipping. They are fantastic little devices, with built-in diagnostics & sensitivity adjustments, and they're tiny -- about a cubic inch, more or less.
Each produces and detects its own light beam, with the light bouncing from a reflector some 7 or 8 feet away. There are three wires for each; one's for power (I use about +16v), and ground and output. The output can be the applied voltage or zero, depending on whether the beam is or isn't being detected. They're switchable, too, so that when the beam is interrupted, you can decide if you want the +16 or zero.

ANYHOW: This provides me with a reliable, accurate source of +5 (after a voltage divider using a 10k and a 22k resistor) from the starting and ending points, at the exact time when the front tire interrupts each beam.

What I'm trying to do is find a way to use an elderly IBM laptop (770z) as the timing device. This really should be child's play: feed each +5 into one of the inputs for the parallel port's status register, start a timer when the first goes ON, and stop the timer when the second one goes ON.

All I need is a byte I can alter externally and watch from within VB. It's pretty simple...

Posted: Wed Apr 02, 2008 12:29 pm
by pebe
You mention 10ms resolution. I don't know about VB, but with QB the best timer resolution you can get using 'Timer' function is 50ms. That's running under DOS. Running under XP or WIN98 it will vary between 50ms and 100ms. You can get much better resolution by counting passes through a FOR-NEXT loop but the program will only be accurate on the machine it was written for. But there could be ways round that.

Your elderly IBM laptop will probably have a printer port and a serial port, and you can use either for inputs to your program.

Using the printer port you can use two of its five input pins to take a pulse from each sensor. If using the serial port then use the modem control pins rather that the 'rx' pin. That allows you to receive single bits - instead of having to encode and transmit a data stream.