Car Taillight (Led Chaser) With Indicator Buttons

by 710801 in Circuits > Arduino

413 Views, 2 Favorites, 0 Comments

Car Taillight (Led Chaser) With Indicator Buttons

Mighty Waasa-Duup (1).png

Hi, my name is Yashan and for my final project, I am making a car tail light LED chaser with Indication Buttons. My project is based on the Audi taillights, I didn't follow the same pattern but went for a similar design. In this circuit the two taillights light up one by one and turn off one by one and will do that continuously, the indicators at the bottom start off red but with the push of a button will blink in blue. For this project, I had to use 3 different Arduino Uno's and had 2 codes. I coded the push buttons to control the RGB Led's, you can choose which colours you want the Led to be when the button is pushed and when it is not pushed. Now that you know what the circuit does and how it works let's move onto the next step.

Supplies

LED (Red) x 26

Resistors (2x 10K ohms, 4x 1k ohms)

LED RGB x 2

Push button x 2

Arduino Uno x 3

Breadboard x 3

Assembling the Circuit Part 1/2

Mighty Waasa-Duup (1).png
Screenshot 2022-01-13 8.33.44 PM.png
Screenshot 2022-01-13 8.33.53 PM.png
Screenshot 2022-01-13 8.34.01 PM.png

I recommend starting from the top right breadboard. In the top right breadboard, I used 13 red leads and connected the anode to the positive row on the top of the breadboard, also known as the power rail. If you're unfamiliar with the anode and cathode of a led, the anode has a longer leg and the cathode has a shorter leg with a flat face. Since I built the circuit on TinkerCad, I had to use a wire to connect it to the terminal ports. The terminal ports are 10 rows labelled from A-J and are divided by the center divider. Once you've set up the LEDs, you can place a resistor on the positive power rail connecting to the terminal ports. Now that you've got the components of the first breadboard setup, it's time to start the wiring. First, connect the end of the resistor that isn't connected to the positive rail to the GND port on the Arduino Uno. Connect a wire from the 5v port to the positive power rail to give it power. Now, from left to right, connect each lead from port 13 to port 1. I placed the wires in the same column as the end of the led, so the breadboard didn't look as if they were clustered. Once you're done with your first breadboard, your breadboard should look like the breadboard on the top right of the picture above. Now you can start the breadboard on the top left, to set it up, you do the exact same as you did for the previous breadboard, but when connecting the led's to the breadboard, instead of going left to right, you go right to left, starting from port 13 to 1. Your farthest right LED should be connected to port 13.

Assembling the Circuit 2/2

Mighty Waasa-Duup (1).png
Screenshot 2022-01-13 8.34.01 PM.png

To start this step, you should have the top two breadboards completed. For this circuit, I used a small breadboard, but you can use any sized breadboard. First, place your RGB LEDs on opposite sides of the breadboard on the terminal strip. Now place 2 push buttons in between the two RGB LEDs. Now place a 1,1K ohm resistor under the 2nd pin on both LEDs and another 1,1K ohm resistor in the same column as the bottom left port connecting to the positive power rail. Now that you've put all the components on the breadboard, you can start wiring. Connect the GND port to the negative power rail and the 5v port to the positive power rail. I connected a wire from the powered positive rail to the non-powered positive rail and the powered negative rail to the non-powered negative rail, so you can use any spot on the power rail. For the left, RGB connect the red pin, which is the first pin/very left pin, to port number 13, connect the blue pin, which is the third pin, to port number 12, and connect the green pin, which is the fourth pin/very right pin, to the 11th port. For the right RGB, connect the red pin to port 3, the blue pin to port 2, and the green pin to port 1. Now connect a wire from the left push button to port 10 and connect a wire from the right push button to port 8. It's time to start coding.

Code 1/2

Screenshot 2022-01-13 10.01.32 PM.png
Screenshot 2022-01-13 10.02.21 PM.png
Screenshot 2022-01-13 10.02.42 PM.png
Screenshot 2022-01-13 10.03.08 PM.png

This code is used for the top two Arduino Uno's. To start the code off you need to assign integers which are written as "int" in code. Void Setup is used to assign values to the integers, for example, "pinMode(led1, OUTPUT)". Void Loop is the sequence that you want to be repeated. I created Void "car-light" so I can create a sequence for the car light and then place it into the loop so it can repeat it. When you see "digitalWrite(led12, HIGH);" in the code, you might be a little confused when I write High it makes sure the led doesn't turn on and when I do LOW it makes sure it turns on. I used the delay function so the led lights turned on one by one and not all at once which would ruin the effect for the tail light.

Code 2/2

Screenshot 2022-01-13 10.36.56 PM.png
Screenshot 2022-01-13 10.37.41 PM.png
Screenshot 2022-01-13 10.38.04 PM.png

This code is for the Indicator lights. I used Void Setup to the initial value of the integers, I put the push button as an input because the push button is giving the information while the led is outputting the information. Then in the code, I used the void loop function so it can repeat the sequence, in this code I used if and else statements. I used if statements for the push button. If I don't push the push button the RGB Led will stay red but when the RGB led is pressed it will flicker in blue.

Preview

Led Chaser With Audi Car tail light effect

This is what the circuit should look like and work like once you are done.