Project tutorial
Hot Wheels Finish Line and Race Timer

Hot Wheels Finish Line and Race Timer © GPL3+

A very accurate Arduino based Die-cast (Hot Wheels) finish line judge and race timer (ET) using IR LED emitters and receivers.

  • 748 views
  • 0 comments
  • 0 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

About this project

Version 2 is the further development of a Hot Wheel Race Judge/Timer. This version includes a Elapsed Time (ET) like a real drag strip.

My work was planning a team building event, a Lunch Hour Hot Wheels Tournament. Two race brackets, Single knock out. To avoid any arguments, bad feelings and wrong doing's, I offering to make a electronic finish line judge. I knew the Arduino would do the trick! Over a span of a couple weeks I went from prototype to a slick working model ready for race day!

The course was 20ft long with the finish line judge at the end! We had 26 cars enter the event. Winner gets a trophy and bragging rights! It took the entire lunch hour to get to the final 2 cars. The final race was won by a half a car length... to close for the naked eye to tell!

The project is based around the Arduino Nano, LCD screen and Gikfun IR LED emitter and receiver. These are readily available online and are easy to mount, install and wire up.

The timer starts as soon at the race gate switch is triggered. The time stops as soon as each car breaks the finish line beam. The Elapsed Time (ET) is calculated form that.

As soon as the cars breaks the IR beam the time is stoped for each lane. The timer then waits till the second car to finished. The system then awards the winner and calculates/displays the ET for both lanes. The winner LED remains on for 5 seconds then the device resets by itself and is ready to go again. There is no need to press a reset button. This makes it easy for kids to play for seamless non-confrontational action!

The IR LED emitter is powered by the 3.3V and the IR receiver is powered by the 5v from the board. The IR receivers are constantly reading a "HIGH" value until an object (a die-cast car) breaks the beam making it read "LOW". Once "LOW" is triggered, the top mounted LED for winning lane lights up.

The device is stand-alone and can be placed anywhere along the track. There is no need to modify a section of track to make it work.

Code

Hot Wheels Race TimerArduino
//By Mike Freda - April 2020
//Diecast electronic finish line
//Time when start gate is open.
//First car to break IR beam is the lane winner
//Displays Elapsed time and winner on a 16x2 LCD.
//times resets when start gate is closed.
//Calculated time is in microseconds and gets converted to Seconds when displayed. Races can be that close.
//Uses Gikfun 5mm 940nm IR LED's emitters and receivers: EK8443

#include <I2CIO.h>
#include <FastIO.h>
#include <LCD.h>
#include <LiquidCrystal.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE); // double check your LCD address first using: i2C_scanner

int analogOutPin1 = A1; // finish line beam lane 1 on A1 PIN
int analogOutPin2 = A2; // finish line beam lane 2 on A2 PIN

const int ledPin1 = 11; //lane 1 winning LED on D11 PIN
const int ledPin2 = 12; //Lane 2 winning LED in D12 PIN
int StartSwitch = 2;

int sensorValueFinish1 = 0; 
int sensorValueFinish2 = 0;
int StartState = 0;

int sensorThresh = 500; //Sets the trigger sensing threshold of the IR receivers. ~1000 = high

unsigned long timeLane1; //finish line lane 1
unsigned long timeLane2; //finish line lane 2 
float StartTime = 0;
float ET1 = 0;
float ET2 = 0;

void setup() 
{

  Serial.begin(9600);
  pinMode(StartSwitch, INPUT);
  pinMode(ledPin1, OUTPUT); //lane 1
  pinMode(ledPin2, OUTPUT); //lane 2
  digitalWrite(ledPin1, HIGH);
  digitalWrite(ledPin2, HIGH);
  delay(1000);
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, LOW);
  StartTime = 0;
    
      lcd.begin(16,2);
      lcd.setCursor(0,0);
      lcd.print("HotWheelsTimerV2");    
      lcd.setCursor(0,1);
      lcd.print("By: Mike Freda"); 
      delay(2000);
      lcd.setCursor(0,1);
      lcd.print("Ready to race...");   
}

void loop() 
{
  StartState = digitalRead(StartSwitch); //Check state of start gate. 0 = closed & 1 = open.
  if(StartState == 0)
  {
     StartTime = 0;
     ET1 = 0;
     ET2 = 0;
  }
  
  StartState = digitalRead(StartSwitch); //if start gate is trigger, race started. 1 = open.
  if(StartState == 1 && StartTime == 0)
  {
    StartTime = micros(); //use micro seconds since the races can be that close!
  }
  
  //read the analog in value of IR's:
  sensorValueFinish1 = analogRead(analogOutPin1);
  sensorValueFinish2 = analogRead(analogOutPin2);

   // remove "//" from below for Debugging and checking actual sensor values. 
   //             You may have to adjust sensorThresh value for better accuracy.
   //             The sensors should read around 900-1000 then go "low" (less than 400) when a car passes through the beam.
   //Serial.println(StartTime);
  // Serial.println(StartState);
  // Serial.print("Sensor Finish1 = " );
  // Serial.println(sensorValueFinish1);
  // Serial.print("Sensor Finish2 = " );
  // Serial.println(sensorValueFinish2);
  // delay(50);


// wait/check for the Finish Line sensors to be triggered
  
  if(sensorValueFinish1 < sensorThresh && ET1 == 0)
  {
    timeLane1 = micros();
    ET1 = timeLane1 - StartTime;
    ET1 = ET1 / 1000000;
  }

 if(sensorValueFinish2 < sensorThresh && ET2 == 0)
  {
    timeLane2 = micros();
    ET2 = timeLane2 - StartTime;
    ET2 = ET2 / 1000000;
  }


if (ET1 < ET2 && ET1 != 0 && ET2 != 0)// Set winner Lane 1, turn on winner LED
   {
   digitalWrite(ledPin1, HIGH);
   }

 if(ET1 > ET2 && ET2 != 0 && ET1 != 0) // Set winner Lane 2, turn on winner LED
   {
   digitalWrite(ledPin2, HIGH);
   }

 if(ET1 > 0 && ET2 > 0) // Race is over, display times for both lanes. // both cars have to finish to display times.
  {
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("L1" );
    lcd.setCursor(4,0);
    lcd.print("ET:");
    lcd.setCursor(6,0);
    lcd.print(ET1, 4);
    if (digitalRead(ledPin1) == HIGH)
       {
         lcd.setCursor(12,0);
         lcd.print("*WIN*");
       }
    lcd.setCursor(0,1);
    lcd.print("L2" );
    lcd.setCursor(4,1);
    lcd.print("ET:");
    lcd.setCursor(6,1);
    lcd.print(ET2, 4);
      if (digitalRead(ledPin2) == HIGH)
       {
         lcd.setCursor(12,1);
         lcd.print("*WIN*");
       }
    delay(8000);
    digitalWrite(ledPin1, LOW); //turn off lane winner LED
    digitalWrite(ledPin2, LOW); //turn off lane winner LED
    timeLane1= 0; 
    timeLane2= 0; 
    StartTime = 0;
    ET1 = 0;
    ET2 = 0;
  }

}

Schematics

Layout Drawing PDF
PDF File
Layout
Layout ver2 v26xhugqge

Comments

Similar projects you might like

Hot Wheels Finish Line

Project tutorial by MikeF1

  • 1,065 views
  • 0 comments
  • 2 respects

Arduino Hot Wheels Speed Track Part #1 - Prototype

Project in progress by Unexpected Maker

  • 3,209 views
  • 0 comments
  • 5 respects

Arduino Hot Wheels Speed Track Part #2 - Code

Project in progress by Unexpected Maker

  • 2,376 views
  • 0 comments
  • 5 respects

Hot Wheels Car Photogate

Project tutorial by nfarrier

  • 4,252 views
  • 2 comments
  • 13 respects

Renewing the Nikko Turbo 2 RC Car

Project tutorial by MarcoGPS

  • 4,457 views
  • 2 comments
  • 10 respects

Buzz Wire with Score Counter

Project tutorial by behrooz66

  • 10,692 views
  • 26 comments
  • 45 respects
Add projectSign up / Login