Lap timer for slot car racing.
It shows a semaphore to start, then times all laps on each lane until a given number of laps or reset button is pressed, then shows mean and best lap as well as total time to complete 20 valid laps. Tested on Carrera Go! Ferrari Edition (1:43).
Hit the start/reset button. A semaphore will be shown. Time will start when lights are all off and a high tone will be the GO! signal. Everytime the sensor senses the passage of the car, the lap time will be recorded and shown and the time will reset to 0. When the maximum number of laps has been reached (set to 20), the mean and best lap times are shown as well as the total time to complete 20 valid laps. To end before the maximum number of laps is reached, hit the start/reset button (will not include the current lap).
A valid lap consists of two passes through the start grid. Hence, the very first pass through the start is not counted as a lap. Invalid laps are those for which the sensor has been activated too quickly (< 1s) or when a lap took too long, e.g., when car went off track. I considered an average time of 2.7 s to complete the track so a valid lap is below 2.7+5s. The final time considers valid laps and 5s added to every invalid lap. The timing ends when 20 valid laps are completed. If the time passes 60s without activating the corresponding sensor, the timing will end for that lane.
The summary screan displays:
mean
mean time on lap for valid lapsbest
best valid laptot
total time to complete 20 valid laps (or until reset)+
invalid lap penalties to be addedfin
final time including penalties
The schematic has been largely taken from the Crystal Ball project of the Arduino Uno Kit and modified. It mounts a 2-rows LCD and a potentiometer for contrast regulation. I use the button in the project to start and reset the timer. I added two sensors to sense the passage of the cars. I also added the piezo to emit sounds during semaphore at every lap.
I started with an infrared obstacle avoidance module which mounts proximity sensors. Not the best perhaps but after tuning sensitivity to decently high, it seems to do the job when positioned close to the track. I used Lego to position two of them on top of each lane. A better option would be to use reed sensors mounted underneath the track under each lane. They are extremely fragile but their sensitivity is close to perfection since they nicely sense the engines magnets. Unfortunately I found it a bit hard to mount them underneath the track so the Lego one was a quicker solution. Even better would perhaps to use hall effect sensors. They have a virtually infinite lifetime and they are extremely compact to be easily embedded in the track. I was very surprised to find out that the ones I bought had very low sensitivity, especially for one of the cars. As of now, and to my disappointment, the working solution is to use proximity sensors mounted on top of the lanes with Lego. Bulky but working.