Skip to content

Project 1.1.7: Car front and rear lights

Description This is a project that exposes you to programming four LEDS to turn on at the same time.
Use case At night, we mostly see cars having two lights in front of them turned on at the same time, and at this same time, the two red LEDS at the back too are also on. This project has similar usage and interface.

Components (Things You will need)

LED Arduino Uno Arduino USB Cable Breadboard Jumper Wires

Building the circuit

Things Needed:

  • Arduino Uno = 1
  • Arduino USB cable = 1
  • White LED = 1
  • Red LED = 1
  • Yellow LED = 1
  • Green LED = 1
  • Red jumper wires = 1
  • Blue jumper wires = 1
  • Black jumper wires = 1
  • Green jumper wires = 1
  • Purple jumper wires = 1
  • Orange jumper wires = 1
  • Brown jumper wires = 1

Mounting the component on the breadboard

Mounting the component on the breadboard

Step 1: Take the breadboard, the white LED and insert it into the vertical connectors on the breadboard.

LED fixed on breadboard.

NB: Make sure you identify where the positive pin (+) and the negative pin (-) is connected to on the breadboard. The longer pin of the LED is the positive pin and the shorter one, the negative PIN.

WIRING THE CIRCUIT

Step 2: Connect one end of red male-to-male jumper wire to the positive pin of the white LED on the breadboard and the other end to hole number 6 on the Arduino UNO.

LED fixed on breadboard.

Step 3: Connect one end of the blue male-to-male jumper to the negative pin of the white LED on the breadboard and the other end to GND on the Arduino UNO.

LED fixed on breadboard.

Step 4: Take the red LED and insert it into the vertical connectors on the breadboard.

LED fixed on breadboard.

Step 5: Connect one end of the black male-to-male jumper wire to the positive pin of the red LED on the breadboard and the other end to hole number 5 on the Arduino UNO.

Step 6: Connect one end of the black male-to-male jumper wire to the positive pin of the red LED on the breadboard and the other end to hole number 5 on the Arduino UNO.

LED fixed on breadboard.

Step 7: Connect one end of the white male-to-male jumper wire to the negative pin of the white LED on the breadboard and the other end to GND on the Arduino UNO.

LED fixed on breadboard.

Step 8: Take the yellow LED and insert it into the vertical connectors on the breadboard.

LED fixed on breadboard.

Step 9: Connect one end of the green male-to-male jumper wire to the positive pin of the yellow LED on the breadboard and the other end to hole number 4 on the Arduino UNO.

LED fixed on breadboard.

Step 10: Connect one end of the purple male-to-male jumper wire to the negative pin of the yellow LED on the breadboard and the other end to GND on the Arduino UNO.

LED fixed on breadboard.

Step 11: Take the green LED and insert it into the vertical connectors on the breadboard.

LED fixed on breadboard.

Step 12: Connect one end of the orange male-to-male jumper wire to the positive pin of the green LED on the breadboard and the other end to hole number 3 on the Arduino UNO.

LED fixed on breadboard.

Step 13: Connect one end of the brown male-to-male jumper wire to the negative pin of the green LED on the breadboard and the other end to GND on the Arduino UNO.

LED fixed on breadboard.

make sure you connect the arduino usb use blue cable to the Arduino board.

PROGRAMMING

Step 1: Open your Arduino IDE. See how to set up here: Getting Started.

Step 2: Type the following codes in the void setup function as shown in the image below.

pinMode(6,OUTPUT);
pinMode(5,OUTPUT);
pinMode(4,OUTPUT);
pinMode(3,OUTPUT);

LED fixed on breadboard.

NB: pinMode will help the Arduino board to decide which port should be activated. The code below will turn off the three light bulbs.

Step 3: Type the following codes in the void loop function.as shown in the image below;

digitalWrite(6,HIGH);
digitalWrite(5,HIGH);
digitalWrite(4,HIGH);
digitalWrite(3,HIGH);
LED fixed on breadboard.

_NB: To turn this LEDS off, you can change the “HIGH” in the ode into “LOW” _

Step 4: Save your code. See the Getting Started section

Step 5: Select the arduino board and port See the Getting Started section:Selecting Arduino Board Type and Uploading your code.

Step 6: Upload your code. See the Getting Started section:Selecting Arduino Board Type and Uploading your code

OBSERVATION

LED fixed on breadboard.

CONCLUSION

In conclusion, the project involving the simultaneous turning on of four LEDs without any blinking showcases a foundational grasp of parallel LED control. By activating all four LEDs concurrently, learners gain insight into basic circuitry connections and the principle of simultaneous output coordination. This project serves as a cornerstone for more intricate electronics endeavors while underscoring the significance of synchronized actions, laying the groundwork for further exploration in electronics and creative applications.