Timer Trap

I’ve finished my first arduino project (code and proto are done…just working on the final PCB), and I’m on to the next. My brother in law wants me to make him a device that will measure the time it takes to travel 20 feet or so (motorcycle racing hole shots). I was thinking of using two sensors (some type of light / laser beam) that when broken would start a timer and another, 20 feet away that would stop the timer, when it was broke.

#1 I don’t want to re-invent the wheel, but I’ve searched every term I can think of and cant find anything that does it. Does anybody know of a DIY device that does something like this??

#2 This is only my 2nd “project”, so does anybody have any ideas regarding the type of sensor I should use and any caveats I should be mindful of…ie, what’s going to happen to 3-9V over a 20 foot span.

I dont mind experimenting, but I also dont mind a little help either.

Thanks a million in advance.

steve

hole shot - that’s the first to thru the first corner, right?

If the race controller has a start gate that drops, fitting a switch to that would be good.

As for the end sensor - a bright LED shining on a sensor and reflecting back (so you don’t have wires going across the track would work.

Then, just count time between one and the other.

Additional ideas:

  • use infrared leds so sunlight dosn’t swamp the sensor.
  • consider modulating the light from the leds for better noise rejection

Mad ideas:

  • Have the start and end boxes connect using a wireless system, like xbee
  • have the led sensor trigger a camera to capture the rider getting throught the corner.

Nice little project :slight_smile:

Infrared LED’s do not like sunlight.

My idea would be a cheap laserpointer hitting a LDR in a tube to shield it from ambient light.
Then use an analog pin to detect major change in light hitting the LDR when the beam is interrupted.

One problem is that it requires parts on both sides of the “track” and that the laser and LDR need to be aligned precisely.

MikMo,

I like your idea. I found a link http://unconventional-airsoft.com/2006/11/19/stealth-action-laser-tripwire-system on the web which talks about the same thing. I think I’m going to use the 16X2 LCD display from Sparkfun to display the final time. Now I have to work on the timer. I’m thinking of using a 555 IC for timing. Partly because I assume that it will be accurate, based on it’s popularity and also to teach myself how to use one.

Any opinions on the 555 or should I consider a different timer idea.

why not use the Arduino to time it? you don’t need an additional oscillator.

If you are happy with milli-second accuracy, you can use the millis() function: grab the millis() value when the race starts and again when the laser beam is broken and subtract one from the other and display it.

The time will be more accurate than can be achieved with a 555.

Mike

I always try to over think everything. You’re absolutely right BigMike. I was reading a tutorial on the 555 this morning and I don’t think it would be applicable for this. The 555 looks complicated for a newbie like me. Something better left for a future project, when I’ve got some more experience. The millis() wins.

He he.

The 555 was the very first IC I bought - I saved up my pocket money, cycled 25 miles to buy the thing from a little electronics retailer, cycled 25 miles home then put together a little circuit to flash an LED.

I never did get the LED to flash, but I did turn the 555 into a smoke generator!

Mike

Are you still working on this? This is a heck of a coincidence! I just found this forum through a search engine, and I’m trying to do the same thing.

Different aspect, though. I want to time a motorcycle traveling a distance of 20 feet as SLOWLY as possible. It takes a lot of skill to ride very slowly.

My approach is to use industrial retroreflector photoelectric sensors. These are insanely expensive, IF you need the latest and greatest, but there are perfectly good units on ebay selling for anywhere between $10 and $50 a copy. Simply amazing devices, but shop carefully. There’s a huge variety, and sort of a specialized language. Not terribly tough to research, though.

Each sensor contains both an emitter and a receiver. You put the sensor on one side of the lane, and aim it at a special reflector on the other side. They typically operate on anything from 10 to 30v DC.

This provides either a +V or Zero V at the output (your choice) when the beam is intact. When it’s broken, you get the opposite.

This is simple to interface to a laptop, via the parallel port. Just watch for the first change, start a timer, watch for the ending change, stop the timer, read the results.

Easy.

Here’s where it gets a little tricky: I don’t want to bring a laptop to poker runs, where this will be used. Too many negatives – theft, damage, reading the screen in bright sun, etc, etc. So, I thought, why not use the sensor to stop and start an inexpensive digital stopwatch? $10 at Radio Shack, and accurate to 0.01 seconds.

So. Output the +V to a reed relay, open up the stopwatch, solder 2 wires to the Start/Stop switch, and voila! A timer that starts when the motorcycle first interrupts the beam.

COMPLICATION:

The leading edge of the front tire will start the timer. Great. However, the beam will be uninterrupted (continuous) again as soon as it ‘sees’ through the front wheel. It will happen again – be blocked, then unblocked – at every spoke, and numerous other times as the bike passes the beam. This will do two things:

  1. It will goof up the timing, since the stopwatch will be Stopped every other beam pulse.

  2. IF there’s an even number of interruptions, it will leave the stopwatch ‘stopped’ when the final trailing edge of the bike clears the beam.

WHAT’S NEEDED:

A circuit that will accept the first ON/OFF pulse and ignore everything else.

I’ve succeeded doing this with relays. It’s a long story, but it works… however, it’s stone-aged, and I’d like to do the job using something a little more polished. I haven’t been able to piece together anything that will work. I thought about a cascade of 2 (maybe more) 555’s with a feedback loop that shuts off the first when the 2nd one operates once. Problem is, all I can figure out is a circuit that gives me a really long output pulse. That won’t cut it – it would be like holding the ‘START’ button down; it would be impossible to ever stop the thing. You have to release the start at least once before you can press it again to stop the timer.

I’m open to suggestions.

Please post here if you’re still working on this.

Take a look at this video I shot of my prototype. I have the LCD mounted in the lid of a plastic box (which is off of the box in the video for testing purposes). It’s hooked to an Arduino for convenience sake (it will be a bare bones board in the final version). And
it’s timing with the millis() function built into Arduino. I didnt use a 555. The laser pointers are hitting a light to voltage (LTV) converter. After giving it a lot of thought, the the LTV’s were about 3.50 each and I bet I could have just used a CDS photoresistor setup in a voltage divider circuit for less than half of that and made it work just the same. Anyhow, here’s the video.

That’s interesting, and simpler than what I’m doing right now. Of course, you’re dependent on very level and even pavement, for one thing, unless you can prop your laser pointers and receivers a bit up off the ground.

I wonder if your sensing method would discriminate between your source and the amount of reflected light typical of a poker run on a sunny day, with a zillion Harleys and ten tons of chrome accessories, etc., but if it take a laser pointer to switch, I guess that would do it.

I have yet to test mine in daylight with extraneous sources of light. The sensors I use send pulses of IR, much like a TV remote control, so it ‘knows’ to look for its own output, versus the light from another sensor in the same plant, or on the same conveyor belt.

I’ve decided to use a PICAXE-08 as a solution for now. I’ll have to research the Arduino, since there must be a good reason it’s so popular.

WHAT’S NEEDED:
A circuit that will accept the first ON/OFF pulse and ignore everything else.

You can do this in hardware or software - in hardware, you can use a d-type or a jk flip-flop. Have a, “arm” button which initialises the circuit, then when the sensor state changes the flip flop changes state again and can’t revert back unless armed again.

In software it is the same. Have an “arm” button. When pressed sets a variable to “armed”. You only take notice of the start sensor level changed when “armed”. As soon as the sensor level changes set the “armed” variable to “triggered” so that any further level changes will be ignored.

Doing it in software is favourite, in my opinion, as there are no parts to buy and it affords some flixibilty.

Mike