Building a Lap Timer using Garage Door Sensors

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

HyperSpeed

Well-Known Member
Joined
Jan 21, 2009
Messages
117
Reaction score
8
I have come to the realization that I really do need a method which is accurate down to 1/100ths(second) for a straight line distance time measurement. Essentially it's like a very short "drag strip", on dirt, for timing motocross starts on my private property.

I think probably the cheapest way to obtain the sensors is by using garage door sensors.

I would use one sensor just ahead of my front tire at the start, and the next pair of sensors 200–300ft away.

What I'm really hoping to learn about here, would be the various methods I could use to create and control the system, such as a Raspberry Pi (which i do have, the Rpi Zero W). I've never created an Rpi project yet, but I do have a triple relay controller module I soldered to the Rpi, with analog and digital Rx/tx triggering (w/ ADC ability onboard). In other words I believe I have all the controller ability needed to carry this out, I've just never set something like this up. I am electrically inclined at the more basic levels (understand basic circuitry and component uses, Ohm's law, etc).

I just need the sensors to detect 1 bike breaking plane #1 to start timing and end timing when plane #2 is broken. The sensor pairs at each plane don't need to be any further apart than a garage door, so that's not an issue, and I can run speaker wire between plane #1 & #2.

My idea is to use the sensors for relay triggering, and when the relays trigger, they will act on a (timer/stopwatch) switch to create the elapsed time reading. That was the initial idea.

The next idea I had was to simply store the triggering time data on the Rpi, and access it over WiFi to view on a nearby laptop--I could have the programming show a scrolling time of the last session pass on the laptop screen.

From my writing you might think,
"It sounds he knows what to do, what is he asking us for?"

The reality is, I do have programming experience (it's been since Pascal language that I programmed, though, heh!), and this technically would be my first RPi project. So, what I'm really hoping is that someone may have experience with this sort of thing, and could maybe suggest any sort of setup or ideas to assist in helping me achieve a properly working setup (hopefully) the first time around. I.E. maybe suggest an RPi project kit that's sold which would more or less give good instructions to follow that could be applied to my own project so I have an idea of what coding to learn and implement since I'll likely be following some general instructions that way.

Or, if you have any general suggestions or tips (better or different sensors to use, etc)--my eyes and ears will be wide open to such advice.

I'll run it all off of a 12V lithium pack, also.

Any suggestions would be highly appreciated! I'll keep you all up-to-date on how this project progresses as well. Thanks!
 
Last edited:
In my experience the Pi is overkill for this kind of project and you might be better off with something simpler, like an Arduino.

Having said that, if you want to try using the Pi I recommend using Python and something like https://raspberrytips.com/raspberry-pi-gpio-pins/ (I'm sure there are many tutorials for this kind of thing, this was just the first one I ran across.)
 
A Raspberry Pi isn't the best option here. The RPi runs a full Linux distribution which means timing isn't deterministic. Thus means if the OS is busy running an internal process, your start or stop signal may not be processed quickly and lead to uncertainty. There is also (probably) no need for a relay in this system.

I'd suggest looking at a Raspberry Pi Pico, which despite being made by Raspberry Pi, is much closer to an Arduino but you can use Python. (And cost <$5) All of the inputs are 3.3V so, I guess you'll have to translate your sensor level to this level. If you use a Pico W, you get WiFi and could add a webpage for viewing.

Edited: not Nano; should be Raspberry Pi Pico
 
Last edited:
It's overkill to be sure, but you can jam a clock module onto a pi and toss RTEMS or similar. The appealing part is the ecosystem of various premade expansion hardware.
 
It's overkill to be sure, but you can jam a clock module onto a pi and toss RTEMS or similar. The appealing part is the ecosystem of various premade expansion hardware.
3x the cost, but the RP2040 feather (https://www.adafruit.com/product/48...wQ2CHDc6uQNBA7w-3C7LqmgIbH2wFlHMaAm3lEALw_wcB) also gets you the micropython compatible microcontroller with significant hardware ecosystem.


But if you already have a raspberry pi sitting in a drawer, it's a great starting point.
 
Back
Top