Project showcase
Speeduino - Speed Tracker

Speeduino - Speed Tracker © GPL3+

Get the speed of your die-cast toy car!

  • 7,644 views
  • 24 comments
  • 49 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
LCD 20x4 with I2C module
Much more simple wiring with I2C module!
×1
IR sensor (Receive) 3 leg.
×2
IR LED
×2
Kingbright wp7113sgd
5 mm LED: Green
×1
12002 04
Breadboard (generic)
×1
Male/Male Jumper Wires
×1

Apps and online services

About this project

Get the speed of toy die-cast cars!

We, kids of all ages, enjoy playing with our fancy cars... We NEED to know how fast they run.

Seeing my eight year old boy playing with Hot Wheels cars, running fast on a speed lane and screaming loud, " This is the fastest car in the world! 300km/h!" I started wondering if I could make a device to measure the actual velocity of this wonderfull little cars. And a quick browsing on internet show this crazy thing called "Arduino."

I am a totaly numb on electronics or computing. I still not believe how easy and cheap one can start driving on this road. I did. Step by step. Reading, studying, trying, thinking. So, lets share it with people!

The idea was simple: Measure a given distance, the time when the car passes through a couple of passage sensors. By getting this data, a simple math will show the actual speed that could be presented on a LCD display for the joy of the crowd!

And that's not it! My son (I can not figure out why...) loves Legos! So I will build some kind of a "control tower" where I will install the LCD display like a big "video wall" for the crowd assisting the race, also adding a control room with some minifigures as operational staff.

The project assembled above with some Legos.

Video at YouTube.

This project works OK at the bench when you throw the car smoothly.

But in the "real world" of a Hot Wheels tracks the sensors are not fast reading enough. Please share your improvements if you find a more precise and fast code or reading sensors!

Project creator Fabio Coelho - Rio de Janeiro - Brazil Dec 2018.

Code

Speed Test - Speeduino!Arduino
Get the speed of toy die-cast cars!
/* Speed Test for Hot Wheels(R) die cast toy cars.

 IR LEDs with 220ohms resistors. IR sensor without any resistor.
 
 This project works ok at the bench when you throw the car smoothly.
 But in the "real world" of a Hot Wheels tracks the sensors are not fast reading enough. Please share your 
 improvements if you find a more precise and fast reading sensors!
 
 Project creator Fabio Coelho - Rio de Janeiro - Brazil Dec2018.
 
 Some improvements were made following inputs from fellow members at Arduino Project hub. Thank You!
 
 
 */

#include <LiquidCrystal_I2C.h>
//We use a LCD 20x4 with an I2C module. It really keeps wiring simple...
#include <Wire.h>

LiquidCrystal_I2C lcd(0x27,20,4);// I2C adress

const int ledPin = 12;
byte irPinA = 4;
byte irPinB = 5;
byte irValA;
byte irValB;
float diff; // store timeScnd minus timeFirst
float vel; // calculated speed
unsigned long timeFirst;// IR sensor at irPinA
unsigned long timeScnd;// IR sensor at irPinB
float speedConst = 453.6; // ((distance between IR sensors in mm) x 3600)/1000)to convert mm/millis to km/h) 
                          // In This project we have 126mm between IR sensors


byte customChar0[8] = { //some art for the LCD screen
B01000,
B01100,
B01110,
B01111,
B01110,
B01100,
B01000,
B00000
};

void configLCD(){ //function to config the LCD display
 
lcd.createChar(0, customChar0);
lcd.setCursor(0,0);
lcd.write(0);
lcd.write(0);
lcd.write(0);
lcd.write(0);
lcd.write(0);
lcd.setCursor(5,0);
lcd.print("SPEED TEST");
lcd.setCursor(15,0);
lcd.write(0);
lcd.write(0);
lcd.write(0);
lcd.write(0);
lcd.write(0);
lcd.setCursor(0,1);
lcd.print("P1:");
lcd.setCursor(0,2);
lcd.print("P2:");
lcd.setCursor(0,3);
lcd.print("Speed:");

}

void setup()
{
pinMode(irPinA, INPUT);
pinMode(irPinB, INPUT);
pinMode(ledPin, OUTPUT);
//Serial.begin(9600);noneededt 
lcd.init();
lcd.backlight();
configLCD();
digitalWrite(ledPin, HIGH); //Green LED HIGH: ok to next ride.

}//end setup


void loop()
{
  irValA = digitalRead(irPinA);
  irValB = digitalRead(irPinB);
 
  if (irValA == LOW){
      timeFirst = millis();
     digitalWrite(ledPin, LOW);
    delay(30);
    }
 
  if (irValB == LOW){
    timeScnd = millis();
    diff = timeScnd - timeFirst; 
    vel = speedConst / diff;//get the Speed converted from mm/millis to km/h.
    /* 
    use only if you want
        Serial.print("T1: ");
    Serial.println(timeFirst);
    Serial.print("T2: ");
    Serial.println(timeScnd);
    Serial.print("Diff: ");
    Serial.println(diff);
    Serial.print("Speed: ");
    Serial.println(vel);
    */
    
    lcd.setCursor(6, 1);
    lcd.print(timeFirst);
    lcd.setCursor(6, 2);
    lcd.print(timeScnd); 
    lcd.setCursor(6,3);
    lcd.print(vel);
    lcd.print("km/h");
       delay(5000); 
       lcd.clear();
       configLCD();
       digitalWrite(ledPin, HIGH);
        }
    
}//end Loop

Schematics

Speed Tracker - Speeduino.
Project Schematics
Speedradartrackhw w9dqp8llwu

Comments

Author

45955fc4 d95e 4439 b6db 57e4c7bb41ee
NerdFatherRJ
  • 0 projects
  • 0 followers

Additional contributors

  • Studying and learning community by Public

Published on

December 10, 2018

Members who respect this project

DefaultTjutzuDefaultDefaultDefaultDefaultDefaultSaulofilho

and 42 others

See similar projects
you might like

Similar projects you might like

Towards an Arduino-Powered Satellite Tracker

Project tutorial by Thomas Le Goff & Maxime Moury

  • 5,446 views
  • 0 comments
  • 3 respects

Unicorn Finder (Kid Tracker for Techie Parents)

Project tutorial by Team Hologram

  • 5,700 views
  • 2 comments
  • 15 respects

Guitar Speed Pick and Stomp Pedal!

Project tutorial by Marc Uberstein

  • 5,489 views
  • 8 comments
  • 32 respects

Non Optical Solar Tracker (East Tower 2.4KW)

Project in progress by Team Trouble

  • 4,593 views
  • 8 comments
  • 29 respects

Control the Speed of Brushless DC Motor Using Bluetooth

Project tutorial by mohitmehlawat

  • 3,497 views
  • 0 comments
  • 13 respects
Add projectSign up / Login