dauntless75
Published © GPL3+

40 Yard Dash Tracker

Time your sprints and compete against your friends with this DIY sports timing system!

AdvancedShowcase (no instructions)17
40 Yard Dash Tracker

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Photo resistor
Photo resistor
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Resistor 220 ohm
Resistor 220 ohm
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
IR Transceiver (Generic)
×1
IR remote
Any TV remote will do
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
Breadboard (generic)
Breadboard (generic)
×1
Laser Diode, 655 nm
Laser Diode, 655 nm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Tape, Duct
Tape, Duct
Hot glue gun (generic)
Hot glue gun (generic)
Multitool, Screwdriver
Multitool, Screwdriver

Schematics

Schematics

Code

The Code:

Arduino
// IRremote - Version: Latest 
#include <IRremote.hpp>

// LiquidCrystal - Version: Latest 
#include <LiquidCrystal.h>

#define wait 10
#define margin 0.2
//macros

boolean chck = false;
unsigned int sensL;
float BaseL;
//finding the base voltage 

const int RECPIN = 13;
const int sensorPin = A0; 
//Sensor and analog pins

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
float cnt = 0;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
//LCD variables and pins 

IRrecv irrecv(RECPIN);
decode_results results;
//define which pin shall be receiving & decoding the results

void setup() {
  
  Serial.begin(9600);
  lcd.begin(16,2);
  lcd.print("Time:  ");
  //Setting up the timer (LCD).
  
  irrecv.enableIRIn();
  //Allow IR input into the transceiver
  
  }

void loop() {
    
  if(chck == true) {
    int sensorVal = analogRead(sensorPin);
    float voltage = (sensorVal/1024.0) * 5.0;
    //Calculate voltage
  
    Serial.print("Voltage:  ");
    Serial.print(voltage);
    Serial.println(); 
    //monitor analog variables.
  
  if(irrecv.decode(&results) && results.value == 0xFF38C7) { // change depending on your IR remote address.
    Serial.println(results.value, HEX);
    //check what button is pressed
     
  while (voltage + margin >= BaseL) {
    lcd.setCursor(0,1);
    lcd.print(cnt++/100);
    delay(wait);
    // the laser hasent been crossed
    
    sensorVal = analogRead(sensorPin);
    voltage = (sensorVal/1024.0) * 5.0;
    // check before continuing loop
    
  }
  cnt = 0.00;
  //reinitilize the script  
  } 
  irrecv.resume();
  delay(wait); 
} 
  else {
  BaseL = analogRead(sensorPin)/1024.0*5;
  Serial.print("Init:  ");
  Serial.println(BaseL);
  chck = true;
  //scan for a baseline light level.
  }
}

Credits

dauntless75
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.