Introduction: DIY Arduino Slot Car Timer and Lap Counter

It is great to be back to Instructables! Since 2018 I have dedicated my time to many of my other hobbies including Slot Car Racing. After building this great circuit I thought it worthy to share with the World so others can benefit. The best place for that of course is Instructables.com.


The goal of this Instructable was to build a lap timer and lap counter for my son's Carrera 1:43 slot car set. While the mechanical lap counter worked as it should we wanted to start logging the lap times of cars. Therefore, the hunt for a timing solution. Since most of my time and money has been dedicated to my 1:32/1:24 track setup, I needed an inexpensive solution. As an Arduino hobbyist, I already had all the pieces and parts to make this happen. Great economical solution!

This circuit will...

  • Display best lap time
  • Display current lap time
  • Display total laps traveled

This setup can realistically be used in any slot car lap timing and counting scenario. Feel free to try it on your 1:32 or 1:24 scale track as well. Simply replace the magnet switch test setup with any number of other sensors. As you will see I opted to go with an Opto IR Sensor instead of magnetic reed switch for more reliable results. As the guide blade passes through the slot sensor it will register the completion of your lap and display lap time.

After you get this running design your own custom box or mounting system and enjoy your racing.

Supplies

Most of what you will need for this project will be found in the ELEGOO Mega R3 Project The Most Complete Ultimate Starter Kit w/ TUTORIAL Compatible with Arduino IDE from Amazon. You just can't beat the price at only $65.99 compared to buying components separately.

$65.99 at the time of this post, in my opinion, is a great purchase and product as I have been using these kits for personal use and with my 7th and 8th grade students for years.


The above items with * are all included in the ELEGOO Mega R3 Project The Most Complete Ultimate Starter Kit w/ TUTORIAL Compatible with Arduino IDE from Amazon . Exactly why I suggest buying the kit if this is your first attempt using a the Arduino microcontroller boards.

If you choose to use the magnet reed switch, I do not recommend those encased in glass as they are very fragile and susceptible to breakage.

In my video demonstration I have embedded IR Infrared Slotted Optical Optocoupler Module Speed Measuring Sensor 3.3V to 5V Photo Interrupter Sensors into the track instead of the reed switches.

Since the magnet reed switch is dependent on a strong magnetic pull, I found that 1:43 cars do not have a strong enough magnet to give reliable results. Therefore, I swapped them out for the slotted sensors that are installed into the groove of the track as you will see in upcoming images.

I did have better success with the magnet reed switches running 1:32 cars which have stronger magnetic pull.


  • LaptimerTimerCounter.ino linked below.
  • Note: Arduino sketch provided by Patrick Sturm.
  • Patrick's original sketch and wiring diagram for the Arduino Uno can be found at GitHub
  • Patrick's Uno diagram did not work 100% for the Mega 2560 which I use, therefore I did a new diagram for this instructable.
  • Wiring Diagram

No tools were needed as everything is plug and play.


Of course don't forget your favorite slot car track, controllers, and cars!

Step 1: Build Component Layout

  1. If you purchased the mounting board, mount your controller board with the screws and screw driver provided with the mounting board.
  2. Mount your breadboards with the adhesive backing provided on the breadboards.
  3. Place your piezo buzzer, potentiometer, push button, and reed switches in these approximate locations. You can choose to make it as compact as you wish. This is just how I liked doing it. Following the wiring diagram is more crucial
  4. Place your magnet reed switches
  5. NOTE: LED is not pictured, but you can place it beneath the push button for now.

Step 2: Wiring It All Up

As already mentioned this wiring diagram is designed with use of the Mega 2560 R3 board. If you want to use the Uno board go to GitHub to see sketch author's Uno diagram. When I used the Uno diagram with the Mega board the push button would not reset, and the potentiometer reset but would not let display work properly.

Therefore, a custom wiring diagram for the Mega 2560 R3 board.

Follow the diagram exactly and you will have a functional lap timer and counter. The Devil is in the Detail of any Arduino with proper connections in your circuit. If it doesn't work, double check and triple check everything. Especially that all wires and components are seated correctly.

Step 3: Testing With Magnet

  1. Connect Mega 2560 to a power source
  2. To the computer using your USB power cord
  3. Wall wart power supply
  4. Battery pack.
  5. Push reset button on breadboard and hold for 2 seconds
  6. Wait for the LCD to display the welcome message.
  7. Wait for zeros to show
  8. Pass a magnet over the reed switches to activate and begin counting laps.
  9. Push reset button to reset back to zeros.

Video provided below.

Step 4: Car With Slot Sensor

As I mentioned previously, I was not happy with the reliability of the reed switches installed in the track. The triggering of the laps and time was very sporadic at best with 1:43 cars. The 1:32 scale cars probably had about a 90% success on triggering lap count and time.

Therefore I changed to the Opto Slot Sensors listed in the supplies section of this Instructable. Success has jumped to about 98% with 1:43 scale cars and 99% with 1:32 scale slot cars.

Installing the Opto Slot Sensors

  • Choose track piece to install sensors
  • Remove metal rails
  • Cut out plastic slot groove to insert sensor from bottom
  • Cut metal rail to fit sensor in place
  • Insert and superglue sensor in place
  • Replace metal rails

Connecting Sensors to Circuit

  • Connect VCC on sensor to positive rail on breadboard
  • Connect GND on sensor to negative row on breadboard
  • Connect Signal on sensor to pins 2 or 3 respectively on Mega 2560 R3
  • Connect to your track setup
  • Press reset button at the beginning of each race and have fun

Step 5: Summary

My last Instructable was back in 2018. Wow how time flies by. I guess my passion for slot cars in the winter and outdoor activities the rest of the year has taken its toll on my sharing with the Instructables community. Well here you go... I'm Back!

I was brought back to the Instructables.com site after looking back over some units I had taught in grades 6-8 in my computer technology class. I actually had an Instructables unit for a couple years in my classes. Take a look at some of my students projects. Maybe it is time to revisit the Instructables unit?

Anyways, while reviewing the site I just had to check out the contests. I see that instead of gift like prizes Instructables is now awarding with Amazon gift cards. Wow! Any win of a contest could really help with all my money pit hobbies. Especially slot car racing! I am sure someone will benefit from this Instructable. I hope it is you.


Regards!

DiyWaterDog

Clocks Contest

Participated in the
Clocks Contest