Ever watched Knight Rider — that 80s show with the talking car KITT? If you have, you probably remember the sleek red lights on the front of the car that scanned left and right. In this project, we’re going to recreate that exact effect using Arduino and a few basic components. It’s a simple, beginner-friendly project that teaches you about LED sequencing, timing, and control logic.
Whether you’re just getting into Arduino or looking for a quick weekend build, this one’s both fun and satisfying to make. Plus, it looks really cool once it’s done!

Parts Required
- Arduino Uno Starter Kit: https://amzn.to/3GKRdQx
- Bread Board: https://amzn.to/3GDwQoz
- Jumper Wires : https://amzn.to/434rudw
- 5mm LEDs Assortment Pack : https://amzn.to/3Z4RAM4
- Resistors ( 220 ohms recommended) : https://amzn.to/43igDxH
This post may contain affiliate links. If you purchase through these links, I may earn a small commission at no extra cost to you. It helps support this blog and keeps the projects coming—thanks for your support!
How it works
LEDs (light-emitting diodes) are tiny components that light up when a small current flows through them — but there’s a catch: they only work in one direction. That’s because LEDs are polarized, meaning they have a positive leg (called the anode) and a negative leg (the cathode). The longer leg is usually the positive one, and it needs to be connected to the positive side of your power source.

In our Knight Rider project, the Arduino sketch controls the blinking pattern of the LEDs, telling them when to turn on and off. But here’s something important — LEDs don’t need a lot of voltage to shine. In fact, the voltage from an Arduino pin is higher than what an LED actually needs. That’s why we use resistors. Resistors help limit the current so the LEDs don’t get overloaded and burn out.
Want to get creative? You can swap in different colors and place your LED strip anywhere — on a toy car, your bicycle, your desk, or even frame it around a speaker or picture. On an Arduino Uno, you can control up to 10 LEDs individually before you run out of digital pins.
Building the Project
Insert the LEDs into the breadboard with their shorter, negative legs in the GND rail at the top of your breadboard. Then connect this rail to GND on the Arduino.
👉 Don’t have the parts yet?
Check out this Arduino LED Starter Kit — it includes everything you need for this project and more!

Connect the LEDs in sequence to Arduino digital pins 2–9, as shown in the following circuit diagram. Place a 220-ohm resistor between each LED and digital pin, ensuring that the resistors bridge the center divide in the breadboard.

| LEDS | Arduino |
| Positive Legs | Pins 2 to 9 using Resistor |
| Negative Legs | GND |
Project Sketch
The sketch sets the pins connected to the LEDs as outputs, and then defines a function to turn all the LEDs off at the same time. This function is called in the loop cycle to turn the LEDs off, and then the LEDs are turned on one at a time—with a 200-millisecond delay between each one—to create a sweeping effect. Another loop sends the sequence back the other way.
Simulation on Tinker Cad here
// Knight Rider LED Chaser
// Inspired by the classic 80s TV series
// Rewritten and explained by Lee Curiosity
void setup() {
// Set pins 2 to 9 as outputs for the LEDs
for (int pin = 2; pin <= 9; pin++) {
pinMode(pin, OUTPUT);
}
}
// Turn off all LEDs before lighting the next one
void turnOffAllLEDs() {
for (int pin = 2; pin <= 9; pin++) {
digitalWrite(pin, LOW);
}
}
void loop() {
// Sweep LEDs from left to right
for (int pin = 2; pin < 9; pin++) {
turnOffAllLEDs();
digitalWrite(pin, HIGH);
delay(200); // LED stays on for 200 milliseconds
}
// Sweep LEDs back from right to left
for (int pin = 9; pin > 2; pin--) {
turnOffAllLEDs();
digitalWrite(pin, HIGH);
delay(200);
}
}
Troubleshooting: What to Do If the LEDs Don’t Light Up
If your code uploads successfully but the LEDs aren’t lighting up as expected, don’t panic — here are some common things to check:
- Nothing lights up at all?
Make sure the Arduino is powered on and that the GND pin is properly connected to the breadboard’s ground rail. If the ground isn’t connected, the circuit won’t complete — and no current means no light. - Some LEDs work, but not all?
Double-check the orientation of your LEDs. Since LEDs are polarized, they only work in one direction:- The longer leg (anode) should go to the positive (via resistor)
- The shorter leg (cathode) connects to GND
Also check that the resistors are fully inserted and share the same row as the correct LED leg.
- Still not working?
Make sure your wiring matches the pin numbers in your Arduino sketch. If your code defines pins 2 to 9, the LEDs need to be wired to those exact pins. - One LED still won’t light up?
It might be a burned-out LED or a bad resistor. Try swapping that LED with one that works.- If the LED works in another spot → the issue might be the resistor or the breadboard connection.
- If it still doesn’t light anywhere → the LED is probably dead. Replace it with a new one.
Recommended Kits for Beginners:
- Elegoo Uno Super Starter Kit – perfect for learning and building
- Solderless Prototyping Breadboard Kit
- LED Project Pack



