Introduction: Arduino Drag Race Light Tree
I'm new to Arduino so I was excited to try this out. I also Drag race 1/24 scale slotcars. I built a homemade 24' drag strip to practice. I need the tree to be the same as the race track so my reaction time might improve. I'm not sure if I have the timing right, but it's getting close. See the video below.
The Arduino = Arduino UNO purchased at Radio Shack
The Breadboard= Radio Shack (not necessary, but I already made the prototyping stand. https://www.instructables.com/id/Acrylic-Arduino-Prototyping-Stand/)
LEDs and jumper wires = you guessed it... Radio Shack
The power source is Altoids charger that supply's 5v to the Arduino board ( https://www.instructables.com/id/Another-Altoids-Ipod-Charger/)
You can also use a 9v battery with resistors that are appropriate or use usb from laptop or desk top computer.
The software I used I downloaded from http://arduino.cc/en/Main/Software
I understand there are many ways one can do this. I chose to build it this way because this is what I had.
I connected the jumper wires to the #2,4,6,8,10 pins found on the Arduino board and the long leg of the Led are placed in line with the end of the red jumper wires on the breadboard.
.
The ground pin is located above the #13 pin (GND) on the Arduino board.
The Code I wrote is a modified version of the blink example:
/*
Blink
Turns on an LED on for 1 second, then off for 1 second.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(2, OUTPUT);
pinMode(4, OUTPUT);
pinMode(6, OUTPUT);
pinMode(8, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
digitalWrite(2, HIGH); // White Led on for 1 second
delay(1000);
digitalWrite(2, LOW); // LED turns off for 1/2 second
delay(500);
digitalWrite(4, HIGH); // Yellow led on 1/2 second
delay(500);
digitalWrite(4, LOW); // LED turns off for 1/2 second
delay(500);
digitalWrite(6, HIGH); // Yellow Led on for 1/2 second
delay(500);
digitalWrite(6, LOW); // LED turns off for 1/2 second
delay(500);
digitalWrite(8, HIGH); // Yellow Led on for 1/2 sec
delay(500);
digitalWrite(8, LOW); // LED turns off for 1/2 second
delay(500);
digitalWrite(10, HIGH); // Green Led on for 2 seconds
delay(2000);
digitalWrite(10, LOW); // Green LED turns off for 3 seconds
delay(3000);
}
The Arduino = Arduino UNO purchased at Radio Shack
The Breadboard= Radio Shack (not necessary, but I already made the prototyping stand. https://www.instructables.com/id/Acrylic-Arduino-Prototyping-Stand/)
LEDs and jumper wires = you guessed it... Radio Shack
The power source is Altoids charger that supply's 5v to the Arduino board ( https://www.instructables.com/id/Another-Altoids-Ipod-Charger/)
You can also use a 9v battery with resistors that are appropriate or use usb from laptop or desk top computer.
The software I used I downloaded from http://arduino.cc/en/Main/Software
I understand there are many ways one can do this. I chose to build it this way because this is what I had.
I connected the jumper wires to the #2,4,6,8,10 pins found on the Arduino board and the long leg of the Led are placed in line with the end of the red jumper wires on the breadboard.
.
The ground pin is located above the #13 pin (GND) on the Arduino board.
The Code I wrote is a modified version of the blink example:
/*
Blink
Turns on an LED on for 1 second, then off for 1 second.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(2, OUTPUT);
pinMode(4, OUTPUT);
pinMode(6, OUTPUT);
pinMode(8, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
digitalWrite(2, HIGH); // White Led on for 1 second
delay(1000);
digitalWrite(2, LOW); // LED turns off for 1/2 second
delay(500);
digitalWrite(4, HIGH); // Yellow led on 1/2 second
delay(500);
digitalWrite(4, LOW); // LED turns off for 1/2 second
delay(500);
digitalWrite(6, HIGH); // Yellow Led on for 1/2 second
delay(500);
digitalWrite(6, LOW); // LED turns off for 1/2 second
delay(500);
digitalWrite(8, HIGH); // Yellow Led on for 1/2 sec
delay(500);
digitalWrite(8, LOW); // LED turns off for 1/2 second
delay(500);
digitalWrite(10, HIGH); // Green Led on for 2 seconds
delay(2000);
digitalWrite(10, LOW); // Green LED turns off for 3 seconds
delay(3000);
}

Participated in the
Arduino Challenge
19 Comments
11 years ago on Introduction
Also you can add the red "foul" light and a photocell for the pre stage and stage lights
Reply 2 years ago
how do you add foul light please?
Reply 11 years ago on Introduction
I would like to add the foul light. I am still learning how this works. I'm hoping to use larger lights as well.
11 years ago on Introduction
Super cool. I was going to make one. Had one instructable in progress before I saw this one but deleted it. might go back and work on it again. I wanted lights for both tracks and test for early start.
Reply 4 years ago
Red = Foul / Crossed starting line before green
Reply 11 years ago on Introduction
That would be great. I am so new to this that I had to start as easy as possible.
I hope you do finish yours so I can learn from it.
Reply 11 years ago on Introduction
Looks like your doing pretty well.
5 years ago
I understand this is an old post but....
Wondering what your current version is like. Would like to implement for same purpose. 132 Drag Racing!
6 years ago
I need something like this for a prototype in a 12VDC application. I want to activate 4 solenoids the same way the yellow lights work and then I want them to activate in reverse. it would be great to be able to control the speed. do you know how to do it?
8 years ago on Introduction
Can this be scaled up to maybe 1/8 Scale ?
11 years ago on Introduction
and some 220 Ohm too so the leds will last longer.
Reply 8 years ago on Introduction
the leds aren't lit for long enough in the code to harm the leds they need extended periods of overcurrent to fry! Cheers
11 years ago on Introduction
Here is the same code but with some modifications. I have change the timing and adde another white led I have been drag racing almost all of my life (EVOs, Hondas, RX7's) and I think It looks more closer to the real "Tree Light". And I do not want you to think that you are wrong on your instructurable. I just want to help you making the best Tree Light for your practices. ;)
First I add another white led. That one is Pre Stage (Pin 2) and the second one is for the Stage (Pin 3). Then I have change timing in between the leds so here is the code:
/*
Blink
Turns on an LED on for 1 second, then off for 1 second.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(6, OUTPUT);
pinMode(8, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
digitalWrite(2, HIGH); // White Led on for 2 second Pre Stage
delay(2000);
digitalWrite(2, LOW); // LED turns off for 1/2 second
delay(5);
digitalWrite(3, HIGH); // White Led on for 1 second Stage
delay(1000);
digitalWrite(3, LOW); // LED turns off for 1/2 second
delay(5);
digitalWrite(4, HIGH); // Yellow led on 1/2 second
delay(500);
digitalWrite(4, LOW); // LED turns off for 1/2 second
delay(5);
digitalWrite(6, HIGH); // Yellow Led on for 1/2 second
delay(500);
digitalWrite(6, LOW); // LED turns off for 1/2 second
delay(5);
digitalWrite(8, HIGH); // Yellow Led on for 1/2 sec
delay(500);
digitalWrite(8, LOW); // LED turns off for 1/2 second
delay(5);
digitalWrite(10, HIGH); // Green Led on for 5 seconds
delay(5000);
digitalWrite(10, LOW); // Green LED turns off for 5 seconds
delay(5000);
}
ENJOY DRAG RACING
Reply 11 years ago on Introduction
I will definitely use this and try to figure out the photocell. Eventually I would like to add a stopwatch that starts and stops for each car. I know it can be done, but still way over my head for now. Thanks for your input.
Reply 11 years ago on Introduction
for the stop watch you can use an bicycle odometer that can measure time and miles theyre cheaper @ wallmart
11 years ago on Introduction
....And at the finish line install a photocell with another ATtiny Arduino to see who won. you need :
â¢220-Ohm resistor
â¢LED
â¢Photocell
â¢10k resistor
here is the Sketch:
int photocellPin = 0;// Photocell connected to analog pin 0
int photocellVal = 0; // define photocell variable
int ledPin = 9;// LED connected to digital pin 9
int ledState = 0;//state of the led
int fadeDown = 30;//delay per fade
int fadeUp = 20;//delay per fade
int minLight = 100;//min light threshold
int maxLight = 100;//max light threshold
void setup() {
//Serial.begin(9600);
pinMode(photocellPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
photocellVal = analogRead(photocellPin);
if (photocellVal < minLight and ledState == 0){
fadeLed(1);
//Serial.println("fade up");
}
else if (photocellVal > maxLight and ledState == 1){
fadeLed(0);
// Serial.println("fade down");
}
}
void fadeLed(int num){
if (num == 1){
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
analogWrite(ledPin, fadeValue);
delay(fadeUp);
}
ledState = 1;
}
else{
for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) {
analogWrite(ledPin, fadeValue);
delay(fadeDown);
}
ledState = 0;
}
}
11 years ago on Introduction
AND.... for this project If I were you I should buy an ATtiny 45/85 arduino IC so you don't have to sacrifice your regular Arduino and you can continue doing projects. ATtiny is perfect for this project I have tried with that code I have post. ;)
11 years ago on Introduction
The connections are not clear and where is the GND and 5V connection
just a comment but it looks great your project
Reply 11 years ago on Introduction
Good point! I will update it this evening. Thanks!