How to Make Traffic Lights Circuit With 555 Timer
Whether you are an electronics hobbyist looking for your next weekend project, a student aiming to ace a physics lab, or just someone fascinated by how everyday automation works, building a traffic light controller is a classic rite of passage.
While modern traffic systems rely on microcontrollers, complex sensors, and networked software, you don’t need a single line of code to recreate this behavior on your workbench. Instead, we can look to the undisputed titan of analog electronics: the 555 timer Integrated Circuit (IC).
In this comprehensive guide, we will design, analyze, and build a fully functional, three-state (Red, Yellow, Green) traffic light circuit from scratch. We will combine a 555 timer with a CD4017 decade counter to create a beautifully sequenced loop.
The Core Philosophy: Why Go Analog?
In an era dominated by cheap microcontrollers like Arduinos and ESP32s, it’s easy to wonder: Why bother with discrete components? Writing digitalWrite(RED_LED, HIGH); delay(5000); is simple, but it masks the foundational beauty of electronics. By building a traffic light using hardware logic, you learn the mechanics of:
- Clock Generation: How an RC (Resistor-Capacitor) network dictates time.
- Frequency and Duty Cycles: Tuning intervals using physical components.
- Sequential Logic: How binary states shift linearly based on electronic pulses.
Understanding these concepts is what separates a programmer who plugs wires into a board from a true hardware designer.
How It Works: The Block Diagram
Before looking at the schematics, let’s understand the macro-level architecture of our circuit. The entire system relies on a two-stage process: Pulse Generation and Sequence Counting.

- The Pulse Generator (555 Timer): Operating in Astable Mode, the 555 timer acts as the “heartbeat” or clock of the circuit. It continuously outputs high and low voltage square waves without any human intervention.
- The Sequencer (CD4017 Decade Counter): The counter receives these clock pulses. Every time the pulse shifts from low to high, the CD4017 moves its output to the next pin in sequence (from Output 0 to Output 9).
- The Logic Matrix (Diodes): In a standard traffic light, the Red and Green lights stay on longer than the Yellow light. Because the CD4017 steps through its outputs at a uniform speed, we use a simple steering network made of diodes to group multiple counter outputs together, keeping the Red and Green LEDs illuminated for multiple clock cycles.
Required Components and Tools
To build this project, you will need the following components. They are highly common and can be found in any basic electronics starter kit.
Integrated Circuits
- 1x NE555 Timer IC: The clock generator.
- 1x CD4017BE CMOS Decade Counter IC: The sequential step controller.
Resistors (0.25W Carbon Film)
- 1x 1kΩ Resistor (R1): Limits current to the 555 threshold network.
- 1x 100kΩ Potentiometer (VR1): Variable resistor to adjust the speed of the traffic lights.
- 3x 330Ω Resistors (R2, R3, R4): Current-limiting resistors to protect our LEDs.
Capacitors
- 1x 10µF Electrolytic Capacitor (C1): Determines the base timing interval (rated for 16V or higher).
- 1x 0.01µF Ceramic Capacitor (C2): Decoupling noise filter for the 555 control pin (labeled 103).
Semiconductors & Displays
- 6x 1N4148 Fast Switching Diodes: (Or standard 1N4007 diodes) Used to combine sequential outputs.
- 1x 5mm Red LED
- 1x 5mm Yellow LED
- 1x 5mm Green LED
Hardware & Power
- 1x Solderless Breadboard: Half-size or full-size.
- Solid-Core Jumper Wires: Pre-cut multi-colored wires make tracking connections significantly easier.
- Power Supply: A stable 9V battery or a 5V breadboard power module.
Deep Dive into Component Mechanics
To build with confidence, you must understand your building blocks. Let’s demystify our two principal chips.
1. The 555 Timer (The Brains of Time)
The 555 timer is a highly stable controller capable of producing accurate time delays or oscillation. In this project, we configure it in Astable Multivibrator Mode, meaning it has no stable state. It autonomously toggles between HIGH and LOW voltage outputs indefinitely.
- Pin 1 (GND): Ground reference (0V).
- Pin 2 (Trigger): Initiates the timing cycle. When it drops below 1/3 of the supply voltage (VCC), the output goes HIGH.
- Pin 3 (Output): This is where our square wave clock pulse emerges.
- Pin 4 (Reset): Active-low reset pin. We tie this to VCC to keep the chip running continuously.
- Pin 5 (Control): Accesses the internal voltage divider. We ground it via a small 0.01µF capacitor to prevent external electrical noise from disrupting the timing.
- Pin 6 (Threshold): Monitors the voltage across our timing capacitor. When it rises above 2/3 VCC, the output goes LOW.
- Pin 7 (Discharge): Connected internally to a transistor that drains the timing capacitor to ground once the threshold is reached.
- Pin 8 (VCC): Positive supply voltage (supports 4.5V to 15V).
2. The CD4017 Decade Counter (The Sequential Engine)
The CD4017 is a CMOS structure chip with a built-in 5-stage Johnson counter. It features 10 decoded outputs (Q0 through Q9).
When a clock pulse transitions from LOW to HIGH (a rising edge) at Pin 14, the currently active output drops to 0V, and the next subsequent output springs to life (VCC).
- Pins 1–7, 9–11 (Outputs Q0 to Q9): These pins go HIGH one at a time in chronological order.
- Pin 8 (VSS): Ground connection.
- Pin 13 (Clock Inhibit): Grounding this pin enables the counter to accept clock inputs. If it goes HIGH, counting freezes.
- Pin 14 (Clock): This receives the square wave signal from Pin 3 of our 555 timer.
- Pin 15 (Reset): Resets the sequence back to Q0 when it receives a HIGH signal.
- Pin 16 (VDD): Positive supply voltage.
The Theoretical Mechanics: Calculating the Speed
The rate at which your traffic lights cycle depends on how quickly the 555 timer charges and discharges the 10µF capacitor (C1). The charge paths are determined by R1 and your potentiometer (VR1).
The duration where the clock signal stays HIGH (Thigh) is calculated using:
Thigh = 0.693 x (R1 + VR1) x C1
The duration where the clock signal stays LOW (Tlow) is determined only by the path through the discharge pin:
Tlow = 0.693 x VR1 x C1
The total time for one complete cycle (the Period, T) is:
T = Thigh + Tlow = 0.693 x (R1 + 2VR1) x C1
By turning the potentiometer dial (VR1), you modify the resistance value within this equation. Increasing the resistance stretches the period, slowing down the transition of your traffic lights. Decreasing it speeds them up, turning your traffic pattern into a rapid formula race layout.
Step-by-Step Circuit Design
Let’s lay down the step-by-step assembly process. Ensure your power supply is completely disconnected while placing components to avoid accidental short-circuits.
Step 1: Powering the Rails
- Insert your 555 timer and CD4017 chips across the center dividing channel of your breadboard, leaving ample room between them. Ensure the notch/dot markers face to the left.
- Connect the top and bottom horizontal rails of your breadboard together: connect Red (+) to Red (+), and Black (-) to Black (-).
Step 2: Wiring the 555 Timer Clock
- Connect Pin 1 to the Ground rail.
- Connect Pin 8 to the Positive power rail (VCC).
- Connect Pin 4 (Reset) directly to VCC.
- Place a 1kΩ resistor (R1) between Pin 7 and $V_{CC}$.
- Connect your 100kΩ Potentiometer (VR1): Connect the center wiper terminal to Pin 6, and one of the outer pins to Pin 7.
- Bridge Pin 2 (Trigger) directly to Pin 6 (Threshold) using a small jumper wire.
- Insert your 10µF capacitor (C1): Connect its longer, positive lead to Pin 6 and its shorter, striped negative lead to the Ground rail.
- Place the 0.01µF capacitor (C2) between Pin 5 and the Ground rail.
At this point, the 555 timer is fully functional as an oscillator. When powered, Pin 3 will emit a steady, adjustable pulse stream.
Step 3: Wiring the CD4017 Decade Counter
- Connect Pin 16 (VDD) to the Positive power rail.
- Connect Pin 8 (VSS) to the Ground rail.
- Connect Pin 13 (Clock Inhibit) to the Ground rail to keep the chip permanently active.
- Run a jumper wire from Pin 3 of the 555 Timer to Pin 14 (Clock Input) of the CD4017.
Step 4: Building the Traffic Sequence Logic Matrix
In a real-world 10-step sequence, we want an illumination ratio that mimics actual road conditions:
- Green Light: Active for 4 cycles.
- Yellow Light: Active for 2 cycles.
- Red Light: Active for 4 cycles.
To make this happen without cross-wiring outputs into a short-circuit, we use 1N4148 signal diodes. Diodes act like electronic one-way valves; they allow current to flow from the chip to the LED, but prevent electricity from flowing backward into adjacent counter pins.
Map out your diode matrix according to the output configurations below:
- Green LED Management (Outputs Q0, Q1, Q2, Q3):
- Connect the anode (non-striped side) of Diode 1 to Pin 3 (Q0).
- Connect the anode of Diode 2 to Pin 2 (Q1).
- Connect the anode of Diode 3 to Pin 4 (Q2).
- Connect the anode of Diode 4 to Pin 7 (Q3).
- Tie the cathode ends (striped sides) of all four of these diodes together into a single blank terminal row on the breadboard.
- Yellow LED Management (Outputs Q4, Q5):
- Connect the anode of Diode 5 to Pin 10 (Q4).
- Connect the anode of Diode 6 to Pin 1 (Q5).
- Tie the cathode ends of these two diodes together into a separate blank terminal row.
- Red LED Management (Outputs Q6, Q7, Q8, Q9):
- Since we have run out of pins and want to loop right back to the beginning after the sequence, we will tap into the remaining sequence slots. However, we can also simplify our resetting behavior.
- Connect Pin 5 (Q6), Pin 6 (Q7), Pin 9 (Q8), and Pin 11 (Q9) to the Red LED terminal zone via your remaining diodes.
- Alternative Short-Cycle Method: If you prefer a faster loop, you can connect Pin 5 (Q6) directly to Pin 15 (Reset). This makes the Red light illuminate for only one cycle before instantly clearing the chip back to Q0 (Green). To implement the full 4-2-4 cycle smoothly, however, let the counter cycle naturally all the way to Q9, and wire the reset pin (Pin 15) straight to the ground rail so it loops automatically upon overflow.
Step 5: Connecting the LEDs
- Connect the unified cathode node of your Green-group diodes to the anode (long leg) of your Green LED. Connect the short leg of the LED to ground through a 330Ω resistor.
- Connect the unified cathode node of your Yellow-group diodes to the anode of your Yellow LED. Connect its short leg to ground through a 330Ω resistor.
- Connect the unified cathode node of your Red-group diodes to the anode of your Red LED. Connect its short leg to ground through a 330Ω resistor.
Testing and Calibration
Double-check every single pin connection against your schematic before plugging in your battery. Ensure no stray component leads are touching each other.
Once satisfied, connect your 9V power supply:
- The Green LED should light up immediately, staying illuminated for a few noticeable moments.
- The sequence should then cleanly jump down to the Yellow LED, staying lit for roughly half the duration of the green light.
- The sequence will finally switch to the Red LED, lingering before snapping directly back to the Green LED to begin the process anew.
Take a screwdriver or your fingers and gently rotate the dial of the potentiometer (VR1). Observe the change in behavior. If turned one way, the lights should cycle with frantic speed; turned the other way, they will ease into a slow, realistic automated cadence.
Troubleshooting Common Errors
If your circuit isn’t behaving perfectly right away, don’t worry! Troubleshooting is an essential part of electronics engineering. Use the diagnostic matrix below to fix common issues:
| Symptom | Probable Cause | Corrective Action |
| All LEDs remain completely dark. | Total loss of power or incorrect ground distribution. | Check that the power rails are energized. Verify that Pin 1 of the 555 and Pin 8 of the 4017 are properly connected to the negative rail. |
| One LED turns on but stays frozen. | The 555 timer is failing to oscillate, or the counter clock input is disconnected. | Check the jumper connecting Pin 2 and Pin 6 on the 555 timer. Ensure the wire running from 555 Pin 3 to 4017 Pin 14 is firmly seated. |
| LEDs blink out of order (e.g., Red then Green then Yellow). | Counter pins are misidentified. | The physical pin order of the CD4017 does not match its logical output order. Verify that your diodes track the specific pin list layout carefully rather than their numerical line sequence on the chip. |
| The LEDs are extremely dim. | Current-limiting resistors are too high, or supply voltage is low. | Ensure you are using 330Ω resistors (Orange-Orange-Brown) for the LEDs, not 10kΩ or 100kΩ variations. |
| Multiple LEDs glow weakly at the same time. | Diodes are placed backward. | Ensure the black or silver orientation stripes on your 1N4148 diodes point toward the LEDs, away from the counter chip pins. |
Expanding the Project: Next Steps for Customization
Once you master this baseline configuration, the fun part of analog electronics begins: modifying the system to suit your own ideas. Here are a few ways to level up your traffic light circuit:
1. Add a Pedestrian Push-Button
Real traffic lights don’t just loop indefinitely; they react to crosswalk requests. You can add a momentary push-button switch connected to the 555 timer’s control path or thresholds, forcing the clock to skip ahead or cycle down rapidly when pressed.
2. Upgrade to a Dual-Intersection Model
To simulate a true four-way crossroad intersection, you can use the remaining outputs of the CD4017 counter to drive a duplicate set of Red, Yellow, and Green LEDs configured inversely. When Intersect A is Green, Intersect B must receive a mirrored feed directing its corresponding Red sequence to stay active.
3. Drive High-Power 12V LED Arrays
Want to construct a large-scale display for a room decoration or an outdoor installation? The outputs of the CD4017 cannot supply enough current to drive high-voltage lamps directly without burning out.
However, you can connect the counter outputs to the gates of N-Channel MOSFETs (like the IRF540N) or individual channels of a relay board. This lets your low-voltage logic control high-power 12V or even 120V LED lamps safely.
Conclusion
By completing this project, you have constructed a fully working automation sequence using fundamental electronic building blocks. You have harnessed the astable timing mechanics of the legendary 555 timer and tamed the shifting properties of the CD4017 decade counter using a custom-built diode logic steering grid.
This hands-on process gives you a deep, practical understanding of clock signals, digital transitions, and logic isolation—skills that will serve you well in all your future electronics projects. Gather your tools, wire up your board, and enjoy watching your custom hardware manage traffic right on your desk!
Frequently Asked Questions
Can I run this traffic light circuit on a 12V power supply instead of 9V?
Yes, both the NE555 and CD4017 ICs can safely operate up to 15V, though you may need to increase the LED resistor values to prevent them from burning out.
Why do the traffic lights skip or blink erratically when I power it on?
This is usually caused by electrical noise or a floating pin, which can be fixed by ensuring the CD4017’s clock inhibit (Pin 13) is firmly grounded.
How can I make the Red or Green lights stay on even longer without changing the clock speed?
You can increase the duration of a specific light by routing more sequential outputs from the CD4017 to that light’s LED using additional diodes.

Author
Alex Klein is an electrical engineer with more than 15 years of expertise. He is the host of the Electro University YouTube channel, which has thousands of subscribers.
