Need some advice to build a drag racing tree

Hi all,
ive been going nuts looking for a starter project to get some seat time with arduino and i'd like to build something that would keep my nose open so a drag tree for the up and coming season seems to be a good motivational project. i'll list my expectations so that i won't waste anyone's time. i am looking to expand the tree to a fullblown system as my knowledge and skill set advances but for now i'd like it to be basic in function.

My plan is to stage the cars with a set of sensors that will active the tree and then another set of sensors monitor or police the cars till their green lighted. I'm not sure what kind of sensors to use because i dont want to use mirrors or anything extra i want it to be all-in-one so to speak.

In the future i'd like to add things like finish line sensors and trap and finish times which would mean wifi so keeping that in mind i have two boards that i can spare or totally devote to the build 1. mini arduino pro and a mega 2560 I also would like to use a Lcd keypad sheild as a display wired if nessary but i also have a separate lcd same size and buttons to spare so if the lcd sheild is a problem i can ditch that and use the componets instead

i want the tree to beable to display by way of led and lcd which car or driver stages first and redlight.

Mirrors will be by far the simplest and most reliable way of implementing the car position sensors i.e. using a light, reflector and receiver. I assume your cars will have timing blades on them. To connect to the finish line I'd suggest a wired connection (and a long reel or wire) would be the simplest to get working. Several hundred yards of cable won't be cheap but presumably you will only need to lay it once.

Drag timing sytems usually use reflectors to reflect an infrared light beam back to a sensor. Thats what those foam blocks are at the end of the track that the cars hit from time to time, they hold the reflectors. The easiest way would be to have a laser shoot across the track to a reflector and back to a photoresistor. Then you read the amount of light hitting the photoresistor and note any changes. Large changes in light would mean the beam was broken and the car is staged. Another large change in the opposite direction would mean the car has taken off. I say to use a laser as opposed to ir because it will be much easier to line up the reflectors and sunlight wont be as much of a problem.

BTW These systems usually have two beams, a prestage and stage beam which correspond to the yellow staging lights on the top of the tree. A red light would be when the second beam is reset (no longer being broken by he cars wheels) before the start.

i almost figured there would be no sensor that would allow me to go without mirrors , we mostly race on public roads which means nothing can be mounted anywhere but i guess i can chalk outline the tree incase a car needs to pass and put it back in the same spot, as for the long cable i'd rather go wireles !!!! but that's down the line. i purposly dropped the pre-stage to simplify things it's just the buddies and i also i'm not sure if i made things clear but we are racing 1/8th scale electric cars (rc) i know traxxas has a system but i have zero time for traxxas and would like to build this for my own practice.

what type of laser/ir emitter should i be looking for and also i know i would need a collecter also x4 of each to start ?
most of the streets we race on are no wider than 30ft so the beams would need to travel atleast 14ft in broad daylight to bounce off a mirror.

At the start line, you could eliminate all the stuff about staging and just push the vehicle back against a switch so that you can detect when it leaves the line.

How far from the start line will the finish line be?

I agree with PeterH, but instead of a switch, use two laser beams. One at the start and one at the finish line. Then once the car leaves the first beam, it starts the timer and stops at the finish line. Then all you need to do is compute the time.

I think the biggest challenge is going to be designing a system that is portable enough that you can drop on the road and then be able to pick it up when a car is coming. I doubt a long cable is going to suffice unless you're willing to risk your equipment by leaving it in the middle of the road when cars drive by. Two boxes with arduinos in them that have xbees for communication may be better so you and your friend can pick them up as cars come along. Each box would have the lasers and sensors pointing out the sides and small reflectors could be put on the sides of the road to bounce the signals back.

BTW I'm into R/C cars as well so I'd love to hear how this project comes out if you follow through with it. I plan to make a personal timing system for running R/C cars in my back yard this summer.

Well this is exactly what I wanted to do.
Drag racing is not a big thing in the netherlands but that's why I want this to work!

I've made a scetch for the lighting:

// lights work

int led1 = 11;
int led2 = 10;
int led3 = 9;
int led4 = 8;
long start;
unsigned long druk1;
int knop1 = 3;
unsigned long stled1;
unsigned long stled2;
unsigned long stled3;
unsigned long stled4;
unsigned long stled5;

void setup() {
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(knop1, INPUT);
Serial.begin(9600); // open communication po

}

void loop()
{

if (digitalRead(knop1)==HIGH)
{
Serial.println("Start signal received");
start = millis();
stled1=start+750;
stled2=start+1250;
stled3=start+1750;
stled4=start+2250;
stled5=start+4250;
delay(250); // for debounce

}
if (millis()>=stled1 && millis()<=stled2)
{
Serial.println("led1");
digitalWrite (led1, HIGH);
digitalWrite (led2, LOW);
digitalWrite (led3, LOW);
digitalWrite (led4, LOW);
}
if (millis()>=stled2 && millis()<=stled3)
{
Serial.println("led2");
digitalWrite (led1, LOW);
digitalWrite (led2, HIGH);
digitalWrite (led3, LOW);
digitalWrite (led4, LOW);

}

if (millis()>=stled3 && millis()<=stled4)
{
Serial.println("led3");
digitalWrite (led1, LOW);
digitalWrite (led2, LOW);
digitalWrite (led3, HIGH);
digitalWrite (led4, LOW);

}

if (millis()>=stled4 && millis()<=stled5)
{
Serial.println("led4");
digitalWrite (led1, LOW);
digitalWrite (led2, LOW);
digitalWrite (led3, LOW);
digitalWrite (led4, HIGH);

}
else{
Serial.println("OFF");
digitalWrite (led1, LOW);
digitalWrite (led2, LOW);
digitalWrite (led3, LOW);
digitalWrite (led4, LOW);
}

}

This is working. You push the button and it lights up the right way.

Now for the red light - reactiontimer - time down the track etc.
I ordered some ldr's and some lasers aswell

Tried this with stuff I thought up without the hardware:

unsigned long clockstart; //start counting
unsigned long light1=500; //start counting
unsigned long light2=1000; //start counting
unsigned long light3=1500; //start counting
unsigned long reactiontimer = 1500; //reaction timer
unsigned long reactiontimerstart; //reaction timer start
unsigned long reactiontimerend; //reaction timer end
unsigned long reactiontimeelapsed; //reaction time
unsigned long tracktimestart; //Time of run start
unsigned long tracktimeend; //einde run
unsigned long tracktime; // time of run

void setup() {

Serial.begin(9600); // open communication port
pinMode(13, OUTPUT); //led pre-stage
pinMode(12, OUTPUT); //led stage
pinMode(11, OUTPUT); //geel1
pinMode(10, OUTPUT); //geel2
pinMode(9, OUTPUT); //geel3
pinMode(8, OUTPUT); //groen
pinMode(7, OUTPUT); //rood
pinMode(3, INPUT);//startknopstarter
pinMode(4, INPUT);//resetknop
}

void displayResult()
{
float h,m,s,ms;
unsigned long processortime;
reactiontimeelapsed=reactiontimerend-reactiontimerstart;
processortime=reactiontimeelapsed%3600000;
processortime=processortime%60000;
s=int(processortime/1000);
ms=processortime%1000;
Serial.print("Raw elapsed time: ");
Serial.println(reactiontimeelapsed);
Serial.print("Reactiontime: ");
Serial.print(s,0);
Serial.print("s ");
Serial.print(ms,0);
Serial.println("ms");
Serial.println();
}
void displayResult2()
{
float h,m,s,ms;
unsigned long processortime2;
tracktime=tracktimeend-tracktimestart;
processortime2=tracktime%3600000;
processortime2=processortime2%60000;
s=int(processortime2/1000);
ms=processortime2%1000;
Serial.print("Raw elapsed time: ");
Serial.println(tracktime);
Serial.print("Tracktime: ");
Serial.print(s,0);
Serial.print("s ");
Serial.print(ms,0);
Serial.println("ms");
Serial.println();

}
void loop()
{

if(analogRead(0) > 750)
{
digitalWrite(13, HIGH);
} else{
digitalWrite(13, LOW);
}
if(analogRead(1) > 750)
{
digitalWrite(12, HIGH);
} else{
digitalWrite(12, LOW);
}
if(digitalRead(3)==HIGH && digitalRead (12)==HIGH) //button pushed and stage is lit
{
Serial.println("Start signal received");
delay (250); //debounce
clockstart=millis();
}

if (clockstart = clockstart+500)
{
digitalWrite (11,HIGH);
Serial.println("Light one");
}
if (clockstart < clockstart+1000)
Serial.println("Light two");
{
digitalWrite (10,HIGH);

}
if (clockstart < clockstart+1500)
Serial.println("Light Three");
{
digitalWrite (9,HIGH);

}

if(analogRead(2) > 750 && clockstart < reactiontimer) //reaction time laser
{
Serial.println("To soon!!!"); // Laser broken before green light
Serial.println("BYE RUN!!!"); // Laser broken before green light
digitalWrite (7, HIGH); //red light
digitalWrite (9, LOW);
digitalWrite (10, LOW);
digitalWrite (11, LOW);
}
if(clockstart == reactiontimer) //start
{
Serial.println("GO!!!"); // Laser broken after green light
digitalWrite (8, HIGH);
digitalWrite (9, LOW);
digitalWrite (10, LOW);
digitalWrite (11, LOW);
reactiontimerstart=millis();
}
if (analogRead(2) < 750) //reactiontimerlaser broken
{
reactiontimerend=millis();
displayResult();
tracktimestart=millis();
}
if (analogRead(5) < 750) //end laser
{
tracktimeend=millis();
displayResult2();
}
if (digitalRead(4) == HIGH)
{
clockstart=0; //start counting RESET
reactiontimerstart=0; //reaction timer start RESET
reactiontimerend=0; //reaction timer end RESET
reactiontimeelapsed=0; //reaction time RESET
tracktimestart=0; //Time of run start RESET
tracktimeend=0; //einde run RESET
tracktime=0; // time of run RESET

}

}

This needs some extra code to work I guess..
Any help would be appreciated

1 Like

Hi, A couple of things to think about:

  • Light Dependent resistors are not "wicked fast" and you would be better served by phototransistors or photodiodes.
  • Small lasers like these are very low-cost and easy to use. See http://arduino-info.wikispaces.com/BrickStarterSetComponents (Laser Module)
  • Since you need "something" between the cars at the start, to separate the car beams, it would be easier to have simple battery-powered center lasers with no mirrors, aimed at the sides.

Hopefully you guys are running the "new" 1/10 mile distance rather than the 1/4 mile with terminal speeds of 80-100 MPH...

Hi Terry,

I'm using the laser indeed. Seems a bit easier indeed. My coding sucks but I assumed someone made a working arduino set already....
Would be so cool to have a full working set-up

How is this? Holiday and no arduino at hand. This should make the lights work and the foul light for just one lane

// lampen werken verder nog niets
 
int led1 =  13;  //pre stage
int led2 =  12;  //stage
int led3 =  11;   //geel1
int led4 =  10;   //geel2
int led5 = 9; //geel3 
int led6 = 8; //groen
int led7 = 7; //rood

long start;
unsigned long druk1;
int knop1 = 3;
unsigned long stled1;
unsigned long stled2;
unsigned long stled3;
unsigned long stled4;
unsigned long stled5;

      
 
void setup() {
   pinMode(led1, OUTPUT); 
   pinMode(led2, OUTPUT); 
   pinMode(led3, OUTPUT); 
   pinMode(led4, OUTPUT);
   pinMode(led5, OUTPUT);
   pinMode(led6, OUTPUT);
   pinMode(led7, OUTPUT);
   pinMode(knop1, INPUT); 
   Serial.begin(9600); // open communication port
   Serial.println ("Copyright Kevlar King");
    
    
   
   
 }
 
void loop()
 {
 if(analogRead(0) < 750){
 digitalWrite(led1, HIGH);
 }  else{
 digitalWrite(led1,LOW);
 } 

if(analogRead(1) < 750){
 digitalWrite(led2, HIGH);
 } else{
 digitalWrite(led2, LOW);
 } 
 
   if (digitalRead(knop1)==HIGH && digitalRead(led2)==HIGH )
   {
    Serial.println("Start signal received");
    start = millis();
    stled1=start+750;
    stled2=start+1250;
    stled3=start+1750;
    stled4=start+2250;
    stled5=start+4250;
    
    delay(250); // for debounce
    
            
   } 
   if (millis()>=stled1 && millis()<=stled2)
   {
     Serial.println("On your marks");
      digitalWrite (led3, HIGH);
      digitalWrite (led4, LOW);
      digitalWrite (led5, LOW);
      digitalWrite (led6, LOW);
      digitalWrite (led7, LOW);
   }
   if (millis()>=stled2 && millis()<=stled3)
   {
     Serial.println("Ready");
     digitalWrite (led3, LOW);
     digitalWrite (led4, HIGH);
     digitalWrite (led5, LOW);
     digitalWrite (led6, LOW);
     digitalWrite (led7, LOW);
     
   }
   
 if (millis()>=stled3 && millis()<=stled4)
   {
     Serial.println("Set");
     digitalWrite (led3, LOW);
     digitalWrite (led4, LOW);
     digitalWrite (led5, HIGH);
     digitalWrite (led6, LOW);
     digitalWrite (led7, LOW);
     
   }
 
   
 if (millis()>=stled4 && millis()<=stled5)
   {
     Serial.println("GO!!");
     digitalWrite (led3, LOW);
     digitalWrite (led4, LOW);
     digitalWrite (led5, LOW);
     digitalWrite (led6, HIGH);
     digitalWrite (led7, LOW);
     //delay (5000);
   }
   
    if (millis()>=start && millis()<=stled5 &&  analogRead(2) < 750) 
   {
     Serial.println("To soon!!");
     digitalWrite (led3, LOW);
     digitalWrite (led4, LOW);
     digitalWrite (led5, LOW);
     digitalWrite (led6, LOW);
     digitalWrite (led7, HIGH);
     
   }
   else{
    
     digitalWrite (led3, LOW);
     digitalWrite (led4, LOW);
     digitalWrite (led5, LOW);
     digitalWrite (led6, LOW);
     digitalWrite (led7, LOW);
 }
   
 }

Moderator edit: And no CODE TAGS at hand, it would seem.

Slowly

I think the biggest challenge is going to be designing a system that is portable enough that you can drop on the road and then be able to pick it up when a car is coming.

Hi, is what we are helping you to do legal?
Public roads, drag racing?

In Australia it most certainly is illegal!!

Tom..... :slight_smile:

TomGeorge:
In Australia it most certainly is illegal!!

What law would they be breaking? It seems a bit draconian to make it illegal for kids to play in the street.

Hi, this will be my last post on this subject,
-who guarantees the safety of the cars? (who has the job of telling parents their kid is dead?)
-who guarantees the safety of the observers? (who has the job of telling parents their kid is dead?)
-who guarantees the safety of property? (would you like to have a car smash though your house and family?)
-in Austrtalia Street Drags are illegal.

Tom....

TomGeorge:
Hi, this will be my last post on this subject,
-who guarantees the safety of the cars? (who has the job of telling parents their kid is dead?)
-who guarantees the safety of the observers? (who has the job of telling parents their kid is dead?)
-who guarantees the safety of property? (would you like to have a car smash though your house and family?)
-in Austrtalia Street Drags are illegal.

Tom....

Do you realize we're talking about scale model cars here? These are hardly putting life and limb at risk.

i almost figured there would be no sensor that would allow me to go without mirrors , we mostly race on public roads which means nothing can be mounted anywhere but i guess i can chalk outline the tree incase a car needs to pass and put it back in the same spot, as for the long cable i'd rather go wireles !!!! but that's down the line. i purposly dropped the pre-stage to simplify things it's just the buddies and i also i'm not sure if i made things clear but we are racing 1/8th scale electric cars (rc) i know traxxas has a system but i have zero time for traxxas and would like to build this for my own practice.

I think you forgot to bold this part too i also i'm not sure if i made things clear but we are racing 1/8th scale electric cars (rc)