✨ Use RCAPP and get 5% off 👇
Skip to content
Free Delivery on Orders Above Rs 999/- Pan-India
Cash on Delivery Available for Orders above Rs.500/- and Upto Rs 3000/-
SAVE more when you BUY more. Upto 30% Off on BULK PURCHASE
GST Invoices for Your Business
Dedicated Technical Support Team
Safely Delivering Genuine Products PAN INDIA

Traffic Signal Using Arduino Uno – Beginner Project (

Traffic Signal Using Arduino Uno – Beginner Project (
D
Written By Daniel D'Souza
📅 Updated on 17 Jun 2026
Summarize with AI
✅ Prompt copied

Summary

This Arduino project tutorial presents a simple and enjoyable traffic light project suitable for beginners. This project involves using Arduino to create a traffic light simulation that requires minimal code and basic circuit setup. The included video tutorials provide step-by-step instructions, making them accessible even to those new to Arduino projects. The code's internal timer ensures that the traffic light simulation continues until the Arduino is powered off. Whether you're new to Arduino or looking for a fun, hands-on project, these tutorials provide a fun exploration of programming and electronics. Join us on our journey to light up the roads with this exciting traffic light project!

INTRODUCTION

Welcome to the exciting journey through Arduino projects! In this demo, we'll show you how to create a simple yet fun traffic light using Arduino, a fantastic project for beginners. By combining a simple circuit and a little code, you can replicate the functionality of a traffic light in a fun and engaging way. The step-by-step video tutorial below guides you through each step of this project, making it accessible even to those just starting out with Arduino. Get ready to dive into the world of programming and electronics as you bring this awesome traffic light project to life. Let’s light the way together!

Components and Supplies

Arduino Uno R3 Board compatibleArduino Uno R3 Board compatible

    Arduino Uno R3 Board compatible

    Arduino Uno R3 Compatible Board  The Arduino Uno R3 CH340G ATMEGA328P Development Board is more than just a microcontroller board; it's a gateway to endless possibilities in the world of electronics and programming. For hobbyists, students, and makers, it stands out as the best Arduino...
    Rs 347/-
    Rs 347/-
    Rs 699/-
    Save Rs 352/-
    GL12 840 Points Solderless Breadboard for Large Prototyping - Electronic Components -RobocrazeGL12 840 Points Solderless Breadboard for Large Prototyping - Electronic Components -Robocraze

      GL12 840 Points Solderless Breadboard

      GL12 MB102 840 Points Solderless Breadboard Introducing the GL12 840 Points Breadboard at Robocraze! This solderless breadboard is an essential tool for any electronics engineer or hobbyist. It allows you to make temporary prototypes for your electronics projects, making it perfect for experimenting with...
      Rs 61/-
      Rs 61/-
      Rs 90/-
      Save Rs 29/-
      Jumper Wire Set - M2M, M2F, F2F (40 pcs each) – Ideal for Arduino & prototyping. Electronic Components - RobocrazeJumper Wire Set - M2M, M2F, F2F (40 pcs each) – Ideal for Arduino & prototyping. Electronic Components - Robocraze

        Jumper Wire Set - M2M, M2F, F2F (40 pcs each)

        Jumper Wire Set - M2M, M2F, F2F (40 pcs each) These DuPont jumper wires for electronics is a premium quality wire manufactured by using quality assured material and advanced techniques, which make them up to the standard in this highly challenging field. This 120pcs...
        Rs 139/-
        Rs 139/-
        Rs 169/-
        Save Rs 30/-
        5mm Round Red Diffused LED (Pack of 10) – Soft-glow LED for circuits & lighting - Electronic Components - Robocraze5mm Round Red Diffused LED (Pack of 10) – Soft-glow LED for circuits & lighting - Electronic Components - Robocraze

          5mm Round Red Diffused Led (Pack of 10)

          5mm Red Led (Pack of 10) A Red light-emitting diode (LED) is a semiconductor light source. LED's are used as indicator lamps in many devices and are increasingly used for other lighting. It looks like a white led and illuminate's blue light. When a...
          Rs 13/-
          Rs 13/-
          Rs 14/-
          Save Rs 1/-
          5mm Green LED (Pack of 10) – High-intensity LED for circuits & Arduino projects - Electronic Components - Robocraze5mm Green LED (Pack of 10) – High-intensity LED for circuits & Arduino projects - Electronic Components - Robocraze

          5mm Green Led (Pack of 10)

          5mm Green Led (Pack of 10) A Green LED( Light-Emitting Diode) is a semiconductor light source which can create green lighting , LED's are used as indicator lamps in many devices and are increasingly used for other lighting. The series is specially designed for...
          Rs 15/-
          Rs 15/-
          Rs 19/-
          Save Rs 4/-
          5mm Yellow LED (Pack of 10) – Durable & bright LED for electronic applications - Electronic Components - Robocraze5mm Yellow LED (Pack of 10) – Durable & bright LED for electronic applications - Electronic Components - Robocraze

            5mm Yellow LED(Pack of 10)

            5mm Yellow LED (Pack of 10) A yellow light-emitting diode (LED) is a semiconductor light source. LED's are used as indicator lamps in many devices and are increasingly used for other lighting. It looks like a white led and illuminate's blue light. When a...
            Rs 30/-
            Rs 30/-
            Rs 44/-
            Save Rs 14/-

            COMPONENTS

            To create the traffic signal using Arduino UNO you need the following components:

            Arduino UNO

            Arduino uno is an open-source microcontroller based on the processor ATmega 328P.

            6 Analog pin inputs, 14 digital pins, a USB connector, a power jack and an ICSP (in-circuit Serial programming) header.

            One of its notable features is the USB interface, enabling easy programming and serial communication. The board can be powered via USB or an external supply (7-12V), with an onboard voltage regulator ensuring a stable 5V supply. A reset button allows for program restarts, and built-in LEDs, including a power indicator and one on pin13, offer visual feedback.

            5mm LED RED, YELLOW & GREEN

            Breadboards and Jumper Wires

            Used to create temporary circuits and connect things that don’t have connections.

            Connections

                                             LEDs

                                   ARDUINO UNO

                           GND pin of all LED

                                              GND

                           RED LED VCC PIN

                                               PIN 9

                           YELLOW LED VCC PIN

                                               PIN 8

                           GREEN LED VCC PIN

                                               PIN 7

             

            Ensure that the connections are made accurately on the Arduino this table serves as a quick reference guide for setting up the circuit.

            ARDUINO CODE

            
            int red = 9;
            
            int yellow = 8;
            
            int green = 7;
            
             
            
            void setup(){
            
             
            
              pinMode(red, OUTPUT);
            
              pinMode(yellow, OUTPUT);
            
              pinMode(green, OUTPUT);
            
             
            
            }
            
             
            
            void loop(){
            
              digitalWrite(red, HIGH);
            
              delay(20000);
            
              digitalWrite(red, LOW);
            
             
            
              // Yellow stays on for 2 seconds
            
              digitalWrite(yellow, HIGH);
            
              delay(2000);
            
              digitalWrite(yellow, LOW);
            
             
            
              digitalWrite(green, HIGH);
            
              delay(20000);
            
              digitalWrite(green, LOW);
            
            }
            

            CODE EXPLAINATION

            1. Variable Declarations: int red = 9;int yellow = 8;int green = 7; These lines declare three integer variables red yellow and  green and assign them the pin numbers where the respective LEDs are connected.
            2. Setup Function: pinMode(red, OUTPUT); pinMode(yellow, OUTPUT);pinMode(green, OUTPUT); These lines configure the pins connected to the LEDs as output pins, allowing us to control the LEDs.
            3. Loop Function: digitalWrite(red, HIGH), delay(20000); digitalWrite(red, LOW); This sequence turns on the red LED, waits for 15 seconds, and then turns it off. digitalWrite(yellow, HIGH); delay(2000); digitalWrite(yellow, LOW); This sequence turns on the yellow LED, waits for 2 seconds (as per the modification), and then turns it off. digitalWrite(green, HIGH);delay(20000); digitalWrite(green, LOW); This sequence turns on the green LED, waits for 20 seconds, and then turns it off.
            4. Looping: - Since this code is within the loop()function, it repeats these actions indefinitely, cycling through turning on each LED for a specific duration and then turning it off.

            OVERALL FUNCITONALITY

            The overall functionality of the project is to simulate a basic traffic light system using Arduino and three LEDs of different colours: red, yellow, and green. The program follows a predefined traffic light sequence commonly found at intersections. The main functionalities can be summarized as follows:

            1. Traffic Light Control: The program controls the illumination of the red, yellow, and green LEDs to replicate the standard traffic light phases: red for stopping, yellow for caution, and green for go.
            2. Sequential Operation: The traffic light operates in a sequential manner, transitioning through the standard traffic light cycle: red, yellow, green, and back to yellow.
            3. Timing Control: Precise timing is implemented using the delay function to simulate the duration of each phase (e.g., 15 seconds for red, 20 seconds for green, 1 second for yellow).
            4. Repetition: The entire sequence of red, yellow, green, and yellow is repeated in a continuous loop, creating a realistic simulation of a traffic light's cyclical behavior.
            5. Configurability: The code allows for easy adjustments to the durations of each phase, making it adaptable to different traffic scenarios or user preferences.

            CONCLUSION

            In conclusion, the Arduino-based traffic light simulation project successfully emulates the fundamental functionality of a traffic light system. By controlling three LEDs – red, yellow, and green – in a sequential manner, the program replicates the typical traffic signal phases. The code incorporates precise timing through delays, allowing the simulation to mirror the durations associated with each phase.

            The project's simplicity and configurability make it an excellent starting point for educational purposes or prototyping in the field of traffic control systems. The sequential operation and repetition in a loop provide a realistic simulation of a traffic light's cyclical behaviour. Moreover, the ability to easily adjust the timing parameters allows for customization, enabling developers to tailor the simulation to specific scenarios or preferences.

            While this project serves as a foundational framework, it can be expanded upon for more sophisticated applications. Integration with sensors, additional LEDs, or communication modules could enhance the project's capabilities, making it suitable for broader smart city initiatives or traffic management systems. Overall, the project demonstrates the versatility of Arduino in creating tangible simulations for educational and practical purposes, laying the groundwork for further exploration and innovation in the realm of traffic control and smart city technologies.

            Excerpt

            Learn how to build a traffic signal using Arduino Uno. A simple beginner-friendly project with circuit explanation and code for hands-on learning.

            Frequently Asked Questions

            1. What is the objective of traffic light controller using Arduino?

            The objective of a traffic light controller using Arduino is to efficiently and effectively regulate the flow of vehicles at intersections. This device utilizes advanced technology, specifically microcontrollers, sensors, and programming codes, to ensure smooth traffic movement and improve overall road safety. By accurately detecting vehicle presence through sensors such as infrared or ultrasonic detectors, the Arduino-based controller can dynamically adjust signal timings based on real-time data. The result is shorter wait times for drivers and reduced congestion on busy roads. With its programmable capabilities and cost-effectiveness compared to traditional controllers, this solution offers municipalities a reliable means of optimizing their traffic management systems while also reducing energy consumption.

            2. How to make traffic light with Arduino Uno?

            Creating your own traffic light using an Arduino Uno is a fun and educational project that can be completed with just a few simple steps. First, gather all the necessary materials including the Arduino Uno board, LED lights (red, yellow, green), resistors and breadboard. Next, connect the LEDs to their corresponding digital pins on the board along with their respective resistors. Then write a code in C++ language that will control when each LED turns on or off based on designated time intervals. Finally, test your circuit by uploading the code onto the board and connecting it to a power source. With these simple instructions and some creativity you can have your very own functional traffic light designed with an Arudino Uno!

            Prev Post
            Next Post

            Leave a comment

            Please note, comments need to be approved before they are published.

            Thanks for subscribing!

            This email has been registered!

            Shop the look

            Choose Options

            Edit Option
            Back In Stock Notification
            Compare
            Product SKU Description Collection Availability Product Type Other Details

            Choose Options

            this is just a warning
            Login
            Shopping Cart
            0 items
            FREE SHIPPING!
            ₹100 OFF
            ₹200 OFF
            ₹999
            ₹2500
            ₹4900
            WhatsApp Chat Chat