Traffic Lights Controller using Logic Gates

In this challenge, we will design, create and test a logic gates circuit to control a traffic lights made of 3 LEDs (Red Amber Green). This challenge is designed to be completed with a logic board such as the Logic & Arithmetic board designed by the University of Southampton and the UK Electronic Skills Foundation. You will be able to complete the circuit with just the Logic & Arithmetic board. However if you have access to breadboards and LEDs you will be able to create your own Red Amber Green traffic lights for a more realistic output.

Alternatively, if you do not have access to a physical kit, you can still complete these challenges using our online logic gates circuit simulator

Traffic Lights Sequence

A UK Traffic Lights follows a sequence of four different states:
traffic-light-sequence

In order to design a logic gates circuit for our traffic lights system we will need a circuit with two inputs (J and K) and 3 outputs (X, Y and Z). Our two inputs will give 4 different states to our circuit: 00, 01, 10 and 11. The following diagram shows the expected outputs for 4 possible states (input patterns):
traffic-lights-sequence-2-inputs-3-outputs

Truth Table?

Your first task is to use the above diagram to complete the Truth Table for our Traffic Light Controller system:

Input J Input K Output X (Red) Output Y (Amber) Output Z (Green)
0 0
0 1
1 0
1 1

Logic Gates Diagrams

Using the information from the completed Truth table we can then work out the logic gates circuits needed to control each output based on the two inputs J and K.
You can try to create this diagrams by yourself using logic.ly or our online Logic Gates Diagram designer tool.

Here are the individual diagrams:
Output X: Red Light:
Red-Light-Logic-gates-Diagram
Output Y: Red Light:
Amber-Light-Logic-Gates-Diagram
Output Z: Red Light:
Green-Light-Logic-Gates-Diagram

All three diagrams can then be combined into a single diagram:
Traffic-Lights-Controller-Logic-Gates-Diagram

You can now recreate this circuit with your logic board:
traffic-light-controller-logic-board-xyz

Using RGB LEDs

The following diagram shows you how to connect your logic board to 3 LEDs on a breadboard.
traffic-light-controller-logic-board-leds

Be careful when connecting your LEDs to detect where the anode and the cathode are on each LED:
LED

Using Lego bricks…

You can also create your own traffic lights using Lego bricks and control them with your logic board!
lego-traffic-light-front
lego-traffic-light-back
lego-led


Traffic Light Sequence using Logic Gates

By combining the above circuit with a 2-bit counter circuit, we can create a fully animated traffic light sequence. Click on the diagram below to test this circuit:

Did you like this challenge?

Click on a star to rate it!

Average rating 4.2 / 5. Vote count: 54

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: ,