Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
MikeF1
Published © GPL3+

Hot Wheels Finish Line

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

IntermediateFull instructions provided3,519
Hot Wheels Finish Line

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Gikfun IR LED's
×4
5 mm LED: Green
5 mm LED: Green
×2
Through Hole Resistor, 390 ohm
Through Hole Resistor, 390 ohm
×2
Resistor 10k ohm
Resistor 10k ohm
×2
Through Hole Resistor, 30 ohm
Through Hole Resistor, 30 ohm
×2
Hook Up Wire Kit, 22 AWG
Hook Up Wire Kit, 22 AWG
×1

Hand tools and fabrication machines

Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

Circuit Diagram

Circuit and Component Layout

Code

IR_Finish_Line

Arduino
//By Mike Freda - March 2020
//Diecast electronic finish line
//First car to break IR beam is the lane winner
//Uses Gikfun 5mm 940nm IR LED's emitters and receivers: EK8443

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

const int ledPin1 = 11; //lane 1 winning LED
const int ledPin2 = 12; //Lane 2 winning LED

int sensorValueFinish1 = 0;
int sensorValueFinish2 = 0;

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

void setup() 
{
  Serial.begin(9600);
  pinMode(ledPin1, OUTPUT); //lane 1
  pinMode(ledPin2, OUTPUT); //lane 2
  digitalWrite(ledPin1, HIGH); //Flashes Winner LED's
  digitalWrite(ledPin2, HIGH);
  delay(2000);
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, LOW);
}

void loop() 
{
  //reads the analog in value:
  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.print("Sensor Finish1 = " );
   //Serial.println(sensorValueFinish1);
   //Serial.print("Sensor Finish2 = " );
   //Serial.println(sensorValueFinish2);
   //delay(50);

// wait/check for the finish sensors to be triggered
  
  if(sensorValueFinish1 < sensorThresh && digitalRead(ledPin2) == LOW) //Lane 1 is winner
  {
   digitalWrite(ledPin1, HIGH); //turn on lane 1 winner LED
   delay(5000);
   digitalWrite(ledPin1, LOW); //turn off lane 1 winner LED
  }

  if(sensorValueFinish2<sensorThresh && digitalRead(ledPin1) == LOW) //Lane 2 is winner
  {
   digitalWrite(ledPin2, HIGH); //turn on lane 2 winner LED
   delay(5000);
   digitalWrite(ledPin2, LOW); //turn off lane 2 winner LED
  }
}

Credits

MikeF1
1 project • 5 followers

Comments