Building a Traffic Light
System with Arduino
Grade: 11B
Merhan
Rawaa
Eman
Members Leen
Narin
Alnour
Mashael
Merhan : power point
Mashael : presentation
Distribution of tasks Alnour : model making
Rawaa : model making
Eman : model making
Narin : model making
Leen : model making
contents
1. 2. 3. Circuit
Introduction Components Design and
to Arduino Required Assembly
6.
4. 5. Enhancing Applications
Programming the Traffic and Future
the Arduino Light System Advancement
s
Introduction
to Arduino
What is Arduino?
Arduino is an open- source The Arduino IDE is the software
electronics platform based on used to write, compile, and
easy- to- use hardware. It upload code to an Arduino
consists of a microcontroller and board. It supports C/C++
input/output pins. functionalities.
Why Use Arduino for Traffic Lights?
C O S T- E F F E C T I V E N E S S W I D E C O M M U N I T Y S U P P O RT
A large community of users and
a wealth of online resources
provide support, tutorials, and
solutions to common issues.
ARDUINO BOARDS FLEXIBILITY AND ARDUINO ALLOWS
ARE RELATIVELY CUSTOMIZATION USERS TO EASILY
INEXPENSIVE MODIFY AND
COMPARED TO EXPAND THE
OTHER FUNCTIONALITY OF
MICROCONTROLLER THEIR PROJECTS,
PLATFORMS, OFFERING
MAKING IT AN FLEXIBILITY AND
AFFORDABLE CUSTOMIZATION.
OPTION FOR
TRAFFIC LIGHT
SYSTEMS.
2. Components
Required
LEDs and Resistors
Core Components o Red LED: Represents the stop signal.
o Yellow LED: Represents the caution signal.
o Green LED: Represents the go signal.
Arduino Board
o Each LED is connected to a specific digital
pin on the Arduino
o Used in series with the LEDs to limit the
Arduino is the central microcontroller
for the project, used for programming current and protect them from damage.
and handling electronic operations
effectively. o Resistor values (typically 220Ω or 330Ω)
Acts as the microcontroller that sends are selected to match the LED
signals to the LEDs. requirements.
Controls the timing and sequence of
the traffic light.
Optional Components
Push Buzzer
Buttons A buzzer is an audio device that
generates sound signals for
Push buttons are
alarms or notifications, enhancing
used to create user
project interactivity.
inputs, allowing
manual control
within your projects
through simple
press actions.
3. Circuit Design
and Assembly
Traffic Light Circuit Diagram
[Link] Resistors 3. Power Supply
[Link] the LEDs Consideration
This part explains Discussion on the
This section covers the
how to connect resistors appropriate power
correct method to wire the supply to use, including
to the LEDs, crucial for
LEDs for the traffic light, voltage levels and
preventing excessive potential power sources
ensuring each light is to ensure stable
current from damaging
properly connected to its operation of the circuit.
the LEDs.
respective pin.
1. Placing 2. Securing
Components Connections
Instructions on placing the
Best practices for securing
components on the breadboard
efficiently, focusing on layout
connections on the breadboard,
to minimize space and ensure including the use of jumper
proper connections. wires and verifying connections
to prevent circuit failure.
connections
4. Programming the
Arduino
Writing the Code
Coding light
Setting up pins Timing delays
sequences
pinMode(13, OUTPUT); digitalWrite(13, HIGH); Understand how to use the
Sets pin 13 as an output Turns on the red LED delay() function to introduce
pin. This pin will control connected to pin 13. pauses between actions in
the red LED. your code, crucial for
digitalWrite(11, HIGH); synchronized light
pinMode(12, OUTPUT); Turns on the yellow LED sequences or sensor
Sets pin 12 as an output connected to pin 11. readings.
pin. This pin will control digitalWrite(12, HIGH); 1. delay(4000);
the green LED. Turns on the green LED Keeps the red LED on for 4
pinMode(11, OUTPUT); connected to pin 12 seconds.
Sets pin 11 as an output 2. delay(4000);
pin. This pin will control Keeps the yellow LED on for
the yellow LED. 4 seconds.
delay(8000);
Keeps the green LED on for
8 seconds.
Uploading and Testing Code
Compiling Learn the process of using the Arduino IDE to verify and compile your code,
Code ensuring there are no syntax errors or issues before uploading.
Uploading to Steps to transfer your compiled code to the Arduino board via USB, adjusting
Arduino settings like the correct board type and COM port in the IDE.
Troubleshootin Techniques for identifying and resolving common problems such as connection
g Common issues, incorrect pin assignments, and runtime errors in your Arduino projects.
Issues
5. Enhancing
the Traffic
Light System
Additional LEDs
1. Additional LEDs will be installed to display signals for pedestrians when
it is safe to cross, enhancing overall traffic safety.
Red LED
Positive leg (anode): Connected to pin 13 of the Arduino via a resistor.
Negative leg (cathode): Connected to the GND (ground) rail on the
breadboard.
Yellow LED
Positive leg (anode): Connected to pin 11 of the Arduino via a resistor.
Negative leg (cathode): Connected to the GND rail.
Adding Push Button Integration
Green LED
Pedestrian [Link]
A push button will be integrated for pedestrians to
their intent to cross, which will trigger the
Crossing Coding Pedestrian Timing
pedestrian crossing lights.
Pedestrian timings will be coded to ensure a balanced
and efficient flow of both pedestrian and vehicular
traffic at intersections.
Integrating Sensors
Using Light Sensors: Light sensors will be used to detect ambient lighting
conditions and adjust the brightness of traffic lights accordingly.
Traffic Density Control: Sensor technology will be utilized to monitor traffic
density, allowing the system to dynamically adjust signal timings to
alleviate congestion. Coding will be implemented for sensor responses,
enabling the traffic light system to react to real- time traffic conditions for
improved efficiency.
Circuit Functionality
The Arduino UNO controls the sequence of the LEDs
based on the programmed instructions.
Each LED lights up for a specific duration (e.g., red for 4
seconds, yellow for 4 seconds, green for 2 seconds).
The resistors ensure that the current through each LED is
within safe limits.
• The breadboard allows for easy and organized wiring of the circuit
components.
6. Final product
Final
product
Small-Scale Models