Arduino — LED Chaser (Knight Rider)
5 LEDs that light up in sequence, like KITT from Knight Rider
Arduino
LED
Array
For-loop
Animation
What you will learn
- How to declare and use an array of pin numbers
- How to step through an array forward AND backward using for-loops
- How to add a small delay between steps to make the animation visible
What you will need
| Component |
|---|
| 1× Arduino Uno R3 |
| 5× LED (any color, e.g. red) |
| 5× 220Ω resistor |
| 1× breadboard |
| 15× jumper wires |
Step by step
Take it further
- Add a 6th and 7th LED to make a longer "scanner" — try changing the delay to make it look like a real Knight Rider.
- Use PWM (analogWrite) to make the LEDs fade in and out as they sweep — a much smoother animation.
- Add a button that changes the speed of the animation (faster or slower) when pressed.
Practise it before you build it
Wire this circuit in the ThinkEdge Learn simulator first. The simulator runs a real Arduino sketch against a modified-nodal-analysis solver, so the LED on screen actually lights when the current is right — no hardware, no burnt components, and a class can try it in a browser.
Related projects
Arduino — Blink Without DelayUse millis() instead of delay() — the right way to blink
Arduino — Fade an LED with PWManalogWrite on D9 — the smoothest way to dim an LED
Arduino — Button + Buzzer DoorbellPress the button, hear a tone. The classic Arduino starter.
Arduino Nano — Temperature on Serial MonitorRead the room temperature every 2 seconds and print it
Arduino — Light-Activated Night LampLDR + LED — the LED turns on automatically when it gets dark
Simon Says — Memory GameRepeat the pattern, level by level
Guides that use this project
3 guides on the site build this project as part of a longer explanation. The guide says why the circuit works; this page says how to wire it.
ESP32-S3: What Changed and Why It Matters for Class BuildsThe ESP32-S3 adds a native USB port, Bluetooth 5 and vector instructions to the original ESP32. Here is what changed and what it means for class projects.
Raspberry Pi Pico: Why This Microcontroller Is a Teaching BreakthroughThe Raspberry Pi Pico is a 3.3 V microcontroller with programmable I/O and no radios. How its hardware differs from an Arduino Uno, and what to build with it.
Smart Lighting: The Driver, the Controller and the RadioSmart lighting is a driver, a controller and a radio. Learn PWM, current limits, MOSFET switching and flicker, then build a lamp you can query.
Where this project sits
It is also part of these lists, which is how a class usually finds it.
Try the full simulator with your class
103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. One licence covers a whole school.