STEM Home SchoolExplore. Experiment. Build. Discover.

Arduino Traffic Light Project for KS3 Students Using Tinkercad (Free, No Kit)

Free Arduino traffic light project for KS3 students using Tinkercad. No kit needed: wire 3 LEDs, type real code and follow the UK light order. Ages 11–14.

Start the activity

This Arduino traffic light project for KS3 students using Tinkercad needs no kit and costs nothing. Your child builds a real Arduino circuit on screen, types real code, and makes three LEDs follow the UK traffic light order: red, red and amber, green, amber. It works on any laptop with a web browser.

🚀 Today’s mission

Arduino traffic light project for KS3 students using Tinkercad

⏱️ 45 minutes🎓 KS3, ages 11–14💻 Free Tinkercad account🔌 No kit needed

💡 Big Idea

A microcontroller follows your instructions in order, again and again, very fast.

Real traffic lights are controlled by a small computer that switches lights on and off with exact timing. An Arduino is the same idea. You tell it which pin to switch on, and for how long. If your child has tried our Robot Programmer coding game, this is the next step: the same step-by-step thinking, now in real code.

🎯 What you will learn

  • Build a circuit: I can connect an LED and a resistor to an Arduino pin.
  • Write code: I can use pinMode, digitalWrite and delay.
  • Make a sequence: I can make lights change in the correct UK order.
  • Debug: I can find and fix a mistake in my circuit or code.

📚 New Words

Tap each card to see what the word means.

🧠 Microcontroller

A tiny computer on one chip. It runs one program over and over.

💡 LED

Light Emitting Diode. A small light that only works one way round.

🧱 Resistor

A part that limits the current, so the LED does not burn out.

🔲 Breadboard

A board with holes that connect parts without soldering.

🔌 Digital output

A pin that is either HIGH (on, 5 volts) or LOW (off, 0 volts).

⏱️ Delay

Tells the Arduino to wait. 1000 milliseconds is 1 second.

🧰 What you need

📋 You need

A laptop or computer, a web browser and a free Tinkercad account.

✅ You do not need

An Arduino board, wires or LEDs. Tinkercad simulates everything on screen.

👪 Under 13?

A parent or teacher must set up or approve the Tinkercad account.

🔬 Try It! Build the circuit in Tinkercad

How to wire the traffic light

  1. Start: Sign in to tinkercad.com. Open Circuits and click Create new Circuit.
  2. Add parts: From the Components list, drag in an Arduino Uno R3, a small breadboard, three LEDs and three resistors.
  3. Set colours: Click each LED and set the colour to red, yellow (our amber) and green.
  4. Set resistors: Click each resistor and change it to 220 Ω. Tinkercad starts them at 1 kΩ, which makes the LEDs dim.
  5. Place the LEDs: Push each LED into the breadboard. The bent leg is the positive leg (anode). The straight leg is negative (cathode).
  6. Connect the pins: Pin 12 → resistor → red LED. Pin 11 → resistor → amber LED. Pin 10 → resistor → green LED.
  7. Connect ground: Join every LED straight leg to the breadboard blue (−) rail. Then join that rail to a GND pin on the Arduino.

💻 Type the Arduino traffic light code

Click Code, then change the menu from Blocks to Text. Delete the example code and type this. Typing it, not pasting it, helps you remember it.

// UK traffic light for KS3 (Tinkercad or a real Arduino Uno)
int redLED = 12;
int amberLED = 11;
int greenLED = 10;

void setup() {
  pinMode(redLED, OUTPUT);
  pinMode(amberLED, OUTPUT);
  pinMode(greenLED, OUTPUT);
}

void loop() {
  // 1. Red: stop
  digitalWrite(redLED, HIGH);
  digitalWrite(amberLED, LOW);
  digitalWrite(greenLED, LOW);
  delay(4000);

  // 2. Red and amber: get ready
  digitalWrite(amberLED, HIGH);
  delay(2000);

  // 3. Green: go
  digitalWrite(redLED, LOW);
  digitalWrite(amberLED, LOW);
  digitalWrite(greenLED, HIGH);
  delay(4000);

  // 4. Amber: get ready to stop
  digitalWrite(greenLED, LOW);
  digitalWrite(amberLED, HIGH);
  delay(2000);
}

Now click Start Simulation. Your lights should change: red, red and amber, green, amber, and then start again.

📊 Test it: change the timings

Change one number at a time. Predict first, then test.

PhaseLights onTime in our codeYour new timeWhat happened?
1Red4000 ms (4 s)
2Red and amber2000 ms (2 s)
3Green4000 ms (4 s)
4Amber2000 ms (2 s)

🗝️ How the code makes the lights change

setup() runs once. It uses pinMode to make pins 10, 11 and 12 into outputs.

loop() runs forever. digitalWrite(pin, HIGH) sends 5 volts to switch an LED on. LOW switches it off. delay(2000) waits 2 seconds before the next line.

The 220 Ω resistor keeps the current safe. With about 3 volts across it, the current is about 3 ÷ 220 = 0.014 A, or 14 mA. That is below the 20 mA an Arduino pin is happy to give.

Same code, same order, every time. That is a sequence.

⚠️ Traffic light troubleshooting

When something goes wrong, check one thing at a time. That is how engineers debug.

One LED never lights up

It is probably the wrong way round. Turn it so the bent leg goes to the resistor side.

The LEDs are very dim

The resistors are still 1 kΩ. Change them to 220 Ω.

The wrong colour comes on

The wires and the code do not match. Check pins 12, 11 and 10 again.

An error says expected ;

A line is missing a semicolon at the end. Look at the line just above the error.

🏆 Level up for KS4

Ready for more? Try these challenges. Each one uses a new idea. For another KS3 build-and-test project, try the DIY water filter challenge.

Use a function

New idea: functions

Write one function that sets all three lights. It makes your code shorter and easier to change.

Add a crossing button

New idea: inputs

Add a push button on pin 2. Use digitalRead so the lights only change when someone presses it.

Night mode

New idea: loops

Make the amber light flash on and off 10 times, like some lights do late at night.

Here is the function idea to start you off. It replaces the old loop():

// KS4 level up: one function sets all three lights
void showLights(int red, int amber, int green, int waitTime) {
  digitalWrite(redLED, red);
  digitalWrite(amberLED, amber);
  digitalWrite(greenLED, green);
  delay(waitTime);
}

void loop() {
  showLights(HIGH, LOW, LOW, 4000);   // red
  showLights(HIGH, HIGH, LOW, 2000);  // red and amber
  showLights(LOW, LOW, HIGH, 4000);   // green
  showLights(LOW, HIGH, LOW, 2000);   // amber
}

✍️ Write it up

Your teacher may ask for a write-up. Use these five parts and keep each part short.

  1. Aim: To make an Arduino traffic light that follows the UK order.
  2. Method: I built the circuit in Tinkercad and wrote code with digitalWrite and delay.
  3. Results: Copy your timing table.
  4. Problems: What went wrong, and how did you fix it?
  5. Next step: Which KS4 challenge would you try next, and why?

🧠 Quick Quiz

Say your answer out loud. Then tap the card to check!

Which LED leg is positive?

The longer leg. In Tinkercad it is the bent leg.

What does delay(3000) do?

It waits 3 seconds.

Why do we need a resistor?

To limit the current so the LED does not burn out.

What comes after green in the UK?

Amber on its own, then red.

⭐🏆⭐

Great job, engineer!

You built a circuit, wrote real Arduino code and debugged it. That is real computing and engineering!

👪 For Grown-ups

This project fits the KS3 Computing aim of using a text-based programming language, and the KS3 Design and Technology work on electronic systems. It is a good first step before buying a kit. When you are ready, our guide to choosing a first robotics kit explains what to look for.

Not sure if your child is ready for KS3 work? The free STEM test for kids finds their level in about 10 minutes. Tinkercad is free. Children under 13 need a parent or teacher to set up or approve their account. To plan a fair test of the timings, use our free Fair Test Planner. If your child gets stuck, ask them to explain each line of code out loud. Most mistakes appear when they do.

Questions parents ask

Do I need to buy an Arduino for this project?

No. Tinkercad Circuits simulates the Arduino Uno, the LEDs and the resistors in your web browser, so the whole project is free. If you buy an Arduino later, the same code and wiring will work on the real board.

Is this Arduino traffic light project right for KS3?

Yes. It suits students aged 11 to 14. It uses text-based code, a simple circuit and a clear sequence. KS4 students can use the Level up challenges for more stretch.

Why does the code use red and amber together?

In the UK, traffic lights go red, then red and amber, then green, then amber, then red again. Red and amber together means stop and get ready.

What resistor should I use with an LED on an Arduino?

Use 220 ohms. It keeps the current at about 14 mA, which is safe for both the LED and the Arduino pin.

Did you finish?

Press the button to collect your Code Creator badge.