T ThinkEdge Learn

Arduino Mega — Traffic Light Controller

A full intersection with pedestrian crossing — and a buzzer

Arduino Mega State machine LED Button
Arduino LED project · Tier 3 · Combined Projects · Intermediate · 40 min · Arduino Mega

What you will learn

What you will need

Component
1× Arduino Mega 2560
6× LED (2 red, 2 yellow, 2 green for the two car traffic lights)
2× LED (red + green for the pedestrian signal)
1× button
8× 220Ω resistor
1× breadboard
12× jumper wires

Step by step

Take it further

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.

Open the interactive lab See plans for your class

Related projects

Simon Says — Memory GameRepeat the pattern, level by level Arduino Mega — 4-Servo Robot ArmDrive 4 servos at once for a pan-tilt-gripper-tilt arm Arduino Mega — Multi-Sensor Data HubRead 3 sensors at once and stream them to the Serial Monitor Arduino Mega — 10-LED Bar GraphLight up an LED "bar" that grows with the analog input Arduino — Two-Player Reaction BattleTwo players, two buttons — fastest finger wins Police SirenAlternating red + blue LEDs with a wailing 600–1500 Hz buzzer

Guides that use this project

19 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.

Arduino Projects for BeginnersTen Arduino projects for beginners that really work, in the order that makes them easiest, with the parts each one needs and the mistake that catches people out. Humanoid Robots: Balance First, Walking SecondWhat makes a humanoid robot work: inverted-pendulum balance, joint torque budgets and centre of mass, plus the Arduino projects to get you there. Robotics and Autonomous Systems: The Four Sub-AreasRobotics and autonomous systems split into perception, planning, control and SLAM. Here is what each needs, and which parts an Arduino can reach. Autonomous Vehicles: What the Car Actually SensesAutonomous vehicles fuse lidar, radar, cameras and ultrasonics into one picture of the road. Here is what each sensor is good at, and how to build the loop. 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. What an AI Agent Actually IsAn AI agent is a loop of model calls, tools and memory. Learn how that loop maps onto the sense, decide, act cycle of a robot you can build this term. AI Swarm: Many Small Robots, Three RulesA swarm is not a clever algorithm, it is three local rules. Learn separation, alignment and cohesion, then build them as if-statements on an Arduino. DGX Spark: What the Hardware Actually IsDGX Spark packs a 20-core Arm CPU and a Blackwell GPU into 128 GB of shared memory. Here is what it buys you, what it costs, and where it does not help. RTX 5080: The Card, the Numbers, the CaveatRTX 5080 specs and price: 16 GB of GDDR7, 360 W of board power and a $999 launch price that no longer matches the street. Here is who should buy one. AGI: Artificial General Intelligence, PreciselyAGI means a system that can do any cognitive task a human can and transfer what it learns. It does not exist yet, and here is how you would know if it did. AI in the Classroom: What to Allow and What to StopAI in the classroom works when the policy is specific. Here is what AI genuinely helps with, the rules that keep it honest, and what a school should not upload. Tinkercad CircuitsTinkercad Circuits is a free browser simulator for Arduino. What it teaches well, where it stops, and why it is a good first step before a real board. arduino.cc and the Official Arduino Resourcesarduino.cc is the official Arduino site: the language reference, the board specs, the library registry and the free learning resources worth using in class. Air Taxis and eVTOL AircraftAir taxis and eVTOL aircraft explained: the lift configurations, why certification is the real constraint, and what the physics demands of them. FPV Drones ExplainedHow an FPV drone works: the camera, video link, goggles and flight controller that make it fly from the pilot's own point of view. FPV Drone SimulatorsFPV drone simulators let you practise the exact physics of flying before spending money on crashes. What they model accurately, what they skip, and how to pick one. How a Drone Flight Controller WorksInside a drone flight controller: sensor fusion, the PID loop, the rate profile and the mixer. The algorithms behind every drone, explained from first principles. Drone Defence and Interceptor DronesHow drone defence works: why interceptors are cheaper than missiles, how the physics of the engagement works, and why airports are hardest to defend. Sting Interceptor Drones ExplainedHow the Sting interceptor drone works: a small, fast, camera-carrying multirotor flown into a target by an operator. The physics, the engineering and the economics.

Where this project sits

It is also part of these lists, which is how a class usually finds it.

Arduino LED projects for beginners36 projects in this list Arduino push button projects for beginners14 projects in this list

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.