Home › Kids Robotics Projects › Magic LED Scanner
STEM electronics for ages 8+ with a grown-up helper
Magic Multi-Color LED Scanner: Build a Robot Light Array
Make a row of glowing LED columns that races back and forth like the scanning eye on a robot car. You will build the circuit with two chips, then teach it new tricks with Arduino code.
- Time: about 2 hours
- Cost: about $5–8 (₹400–600)
- Level: beginner
- No coding needed for the first build
Try the magic scanner right here
This is a live copy of the circuit you will build. Turn the speed knob (R2) and watch the lights change.
What will you learn?
Oscillators
The 555 chip is a tiny heartbeat. It sends one pulse again and again, like a drummer keeping time.
Counters
The 4017 chip counts pulses on its fingers, from 0 to 9, and lights one output for each number.
Robot lights
Real robots use light patterns to show what they are thinking: scanning, turning, or low on battery.
Code
In the level-up mission an Arduino does the job of both chips, and you can change the pattern with a few lines.
Parts list
Everything is cheap and easy to find at an electronics shop or online. Buy a few spare LEDs, because bent legs happen.
| Part | How many | Its job |
|---|---|---|
| NE555 timer chip (8 legs) | 1 | Makes the steady pulses, the heartbeat |
| CD4017 counter chip (16 legs) | 1 | Counts pulses and lights one output at a time |
| 50 kΩ trimmer knob (marked 503) | 1 | Speed control |
| 1 kΩ resistor (brown, black, red) | 1 | Keeps the knob safe at its lowest setting |
| 10 µF electrolytic capacitor | 1 | Sets the beat together with the knob. The long leg is plus (+). |
| 10 nF ceramic capacitor (marked 103) | 1 | Keeps the 555 steady |
| 220 Ω resistors (red, red, brown) | 10 | One per column, so LEDs do not burn out |
| LEDs, 3 mm or 5 mm, mixed colors | 22 + spares | The magic lights. Red, orange, yellow, green, blue, white. |
| 4 × AA battery holder with switch (6 V) | 1 | Power |
| Breadboard and jumper wires | 1 set | Build with no soldering first |
Put the same color in every LED of one column. Different colors need different amounts of push to glow, so mixing colors inside one column makes one LED hog the power.
How the magic works
Think of the 555 as a drummer and the 4017 as a robot with ten lamps. Every drum beat, the robot moves its one “on” signal to the next lamp. After lamp 10 it jumps back to lamp 1. Because only one column is on at a time and the beats are fast, your eyes see a light running along the row.
The speed of the drummer is set by the knob. The beat rate in hertz (beats per second) is f = 1.44 ÷ ((R1 + 2 × R2) × C1). With R1 = 1 kΩ, C1 = 10 µF and the knob at 20 kΩ, that is about 3.5 beats a second.
Which leg is which? The 4017 output map
| Lamp (column) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Output name | Q0 | Q1 | Q2 | Q3 | Q4 | Q5 | Q6 | Q7 | Q8 | Q9 |
| CD4017 pin | 3 | 2 | 4 | 7 | 10 | 1 | 5 | 6 | 9 | 11 |
The pins are not in numeric order. Count them carefully, or the light will jump around instead of running smoothly.
The circuit diagram
Wire-by-wire cheat sheet
NE555 (heartbeat)
- Pin 1 → GND
- Pins 4 and 8 → +6 V
- R1 (1 kΩ) from +6 V to pin 7
- Knob R2 from pin 7 to pin 6
- Pin 2 joined to pin 6
- C1 (10 µF) from pin 6 to GND, long leg on pin 6
- 10 nF from pin 5 to GND
- Pin 3 → 4017 pin 14
CD4017 (counter)
- Pin 16 → +6 V
- Pin 8 → GND
- Pin 13 → GND
- Pin 15 → GND
- Pin 14 ← 555 pin 3
- Pins 3, 2, 4, 7, 10, 1, 5, 6, 9, 11 → one 220 Ω resistor each, then to columns 1 to 10
LED columns
- Long leg (+) toward the resistor
- Short leg (−) to GND
- Up to 3 LEDs side by side in a column
- Same color inside a column
- Try heights 1, 2, 2, 3, 3, 3, 3, 2, 2, 1 for a pyramid shape
Build it step by step
Ask an adult to help with soldering irons, cutting wires and the battery. Never connect the battery to anything that is not on the diagram. If a chip or wire feels hot, switch off and unplug the batteries.
Sort your parts
Lay everything on a tray. Look for the little notch or dot on each chip. The notch end marks the top, and the legs count counter-clockwise from the top-left leg as pin 1.
Build the heartbeat (555)
Push the 555 across the middle gap of the breadboard. Add the wires and parts from the 555 card above. Use the middle leg and one outer leg of the trimmer knob.
Mini test: put an LED and a 220 Ω resistor on pin 3. When you switch on, it should blink. Turn the knob to change the blink speed. Then remove the test LED.
Add the counter (4017)
Place the 4017 on the breadboard and connect pins 16, 8, 13 and 15 as shown. Then run a wire from 555 pin 3 to 4017 pin 14.
Make your LED columns
- Pick a color for each column. A rainbow order is fun: red, orange, yellow, green, teal, blue, indigo, purple, pink, white.
- Place LEDs side by side with all long legs joined and all short legs joined.
- Make ten columns and label them 1 to 10 with tape.
Connect the ten outputs
Follow the output map: column 1 to pin 3, column 2 to pin 2, column 3 to pin 4, column 4 to pin 7, column 5 to pin 10, column 6 to pin 1, column 7 to pin 5, column 8 to pin 6, column 9 to pin 9, column 10 to pin 11. Put a 220 Ω resistor in every one of those wires. Join all short legs to GND.
Switch on and tune
Insert the batteries and flip the switch. One column should glow and the glow should run across the row. Turn the knob until the speed looks like a robot scanner.
Make it permanent (optional)
With an adult, solder the same circuit on stripboard. Use IC sockets so chips can be swapped. Heat the joint for two seconds, add solder, and let it cool without moving it. Fancy “dead-bug” builds wire the legs straight to each other, but stripboard is easier to fix.
Put it on a robot
Tape or glue the array to the front of a toy car, cardboard robot or your robot chassis. The running light becomes the robot’s scanning eye.
Fix-it table
| What you see | Try this |
|---|---|
| Nothing lights up | Check batteries, the switch and that the 555 and 4017 both have power on their top pins (8 and 16). Check LED direction. |
| Lights do not move | Check the wire from 555 pin 3 to 4017 pin 14. Test the 555 with the blinking mini test. |
| Lights jump around | You mixed up the output pins. Use the output map: 3, 2, 4, 7, 10, 1, 5, 6, 9, 11. |
| Only some columns glow | Look for a missing resistor wire or an LED turned the wrong way. |
| Too fast to see | Turn the knob toward 50 kΩ or use a bigger C1, such as 22 µF. |
| Very dim | Swap the 220 Ω resistors for 150 Ω. Do not go lower than 100 Ω. |
Level up: robot brain code
Swap the two chips for an Arduino Uno or Nano. The code below makes the light bounce from one end to the other, and a knob on A0 controls the speed.
- LED columns on pins D2 to D11
- Each through a 330 Ω resistor
- Knob middle leg on A0
- At most 2 LEDs per column
// Magic Multi-Color LED Scanner (Arduino Uno / Nano)
const byte ledPins[10] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
const int speedKnob = A0;
int position = 0; // which column is lit
int direction = 1; // +1 = going right, -1 = going left
void setup() {
for (byte i = 0; i < 10; i++) {
pinMode(ledPins[i], OUTPUT);
}
}
void loop() {
int waitTime = map(analogRead(speedKnob), 0, 1023, 30, 300);
for (byte i = 0; i < 10; i++) {
digitalWrite(ledPins[i], i == position ? HIGH : LOW);
}
delay(waitTime);
position += direction;
if (position >= 9 || position <= 0) {
direction = -direction; // bounce at the ends
}
}
Mission: add a new pattern
Mirror mode lights two columns that rush toward the middle, like robot eyes closing. Add this function and call it from loop() in place of the bounce code.
void showMirror(byte step) { // step goes 0 to 4
for (byte i = 0; i < 10; i++) digitalWrite(ledPins[i], LOW);
digitalWrite(ledPins[step], HIGH); // left light
digitalWrite(ledPins[9 - step], HIGH); // right light
}
// In loop(): go in, then out
// for (byte s = 0; s <= 4; s++) { showMirror(s); delay(120); }
// for (byte s = 3; s > 0; s--) { showMirror(s); delay(120); }
Make the scanner speed up when a button is pressed. Light all columns when a distance sensor sees a wall. Use a rainbow of colors to show the robot’s battery level.
Where robots use this idea
Scanner eyes
A moving light on a robot face shows it is searching for something.
Turn signals
A running light that sweeps left or right tells people where a robot is going next.
Status bar
Show “thinking” with a slow sweep and “done” with all columns on.
Light show
Mount it on a model car and drive it in a dark room for a night-patrol show.
Questions kids and parents ask
Can I build this without soldering?
Yes. A breadboard and jumper wires let you build the whole circuit by pushing parts into holes. Solder only when you want a permanent version.
Why use a resistor with every LED column?
An LED has almost no resistance by itself, so too much current flows and it can burn out or damage the chip. A 220 Ω resistor limits the current to a safe amount.
Can I use just one color of LED?
Yes. Blue or white LEDs look great, and the circuit works the same. Multi-color just makes it more magical.
What if I want the light to bounce without an Arduino?
Use the Arduino mission, or add 1N4148 diodes so the later outputs share earlier columns. The Arduino route is easier to learn from.
What age is this project for?
Ages 8 and up with an adult helper. Younger children can enjoy the simulator and the finished lights.
Comments
Post a Comment