Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

ARDUINO (HTTPS://CIRCUITDIGEST.COM/ARDUINO-PROJECTS)

Arduino Based 3-Way Traffic Light


Controller (/microcontroller-
projects/arduino-traffic-light-controller- CR01005 Series Thick-Film
Chip Resistor

project) (https://bit.ly/34JX0QT )
The CR01005 chip resistor
By (page_author.html)Antony Jackson (/users/antony-jackson) Aug 08, 2017 13 features a three-layer termination
(https://bit.ly/34JX0QT
process with a nickel barrier
)
SRP0310 /
SRP0315/SRP0410 /
SRP0510 / SRP0610 Series
Shielded Power Inductors
(https://bit.ly/31ZvmxA )
(https://bit.ly/31ZvmxA
SRP0310/0315/0410/0510/0610
) shielded power inductors have a
metal alloy powder core and flat wire

TBU-RS Dual Channel TBU®


High-Speed Protector Series
(https://bit.ly/3mIptNl )
The TBU-RS055-300-WH is an
integrated dual-channel TBU
(https://bit.ly/3mIptNl
overcurrent and TVS overvoltage
) protector

AEC-Q200 Compliant Thick


Film Chip Resistors - Model
CRxxxxA Series
(https://bit.ly/34LdiZG )
The model CRxxxxA AEC-Q200
(https://bit.ly/34LdiZG
compliant chip resistor series is
) available in eight different
footprints

AVHT Series High-


Temperature Varistors
(https://bit.ly/3gFrqb5 )
Arduino Based 3-Way Traffic Light Controller AVHT high-temperature varistors
offer great circuit-board layout
(https://bit.ly/3gFrqb5
flexibility for designers
)
We all know about Arduino. It is one of the most popular open source micro controller
Model SF-0603HIA-M/SF-
board which is highly useful for doing DIY projects. This Arduino based 3-Way Traffic
1206HIA-M Series SMD Fuse
Light Controller is a simple  Arduino DIY project (https://circuitdigest.com/arduino- Families
(https://bit.ly/3jGGdCJ )
projects) which is useful to understand the working of traffic lights which we see around
The Model SF-0603HIA-M/SF-
us. We have covered a more simpler version of traffic lights in this traffic light circuit (https://bit.ly/3jGGdCJ
1206HIA-M series utilize Bourns'
) popular multilayer ceramic design
(https://circuitdigest.com/electronic-circuits/four-way-traffic-light-circuit).  Here have
demonstrated it for 3 sides or ways. Now let’s get into the project… SRP4018FA Series Power
Inductors
(https://bit.ly/3jMmLEm )
SRP4018FA shielded power
inductors are designed to meet
high current density requirements

(https://bit.ly/3jMmLEm
)
Chip LAN Transformer
Module - Model SM41126EL
Series
(https://bit.ly/3kJw7lG )
The SM41126EL Chip LAN
(https://bit.ly/3kJw7lG
10/100 Base-T transformer
) module is ideal for use in LAN
Components Required: interfaces

1. 3*Red LED Lights


2. 3*Green LED Lights
3. 3*Yellow LED Lights
4. 3*220ohm Resistors
5. Breadboard
6. Male To Male Connectors
7. Arduino Uno With Ide Cable

Circuit Explanation:
The circuit Diagram for Arduino Traffic Light Controller project is given below:
(https://bit.ly/2QkLGCH)

NEWS ARTICLES PROJECTS

High Accuracy, 40 KHz Hall-


effect Current Sensor IC for
Starter Generators and
(/news/high- Traction Inverter Control
accuracy-40- (/news/high-accuracy-40-
khz-hall- khz-hall-effect-current-
effect-current- sensor-ic-for-starter-
sensor-ic-for- generators-and-traction-
starter- inverter-control)
generators-
and-traction-
inverter-
control)

Gas Sensors Market is


projected to reach USD 2
Billion by 2026 (/news/gas-
(/news/gas- sensors-market-is-
sensors- projected-to-reach-usd-2-
market-is- billion-by-2026)
(/fullimage?i=circuitdiagram_mic/Arduino-based-3-way-Traffic-light-controller-circuit- projected-to-
diagram.png) reach-usd-2-
billion-by-
SPONSORED SEARCHES 2026)
PCB Circuit
Low Cost Automotive
Schematic Diagram Sequential LED Lighting IC
for Reducing Design
It’s pretty simple and can be easily built on bread board as explained in below steps: (/news/low- Complexity and
cost- Development (/news/low-
1. Connect the LEDs in the order as Red, Green, and Yellow in the breadboard. automotive- cost-automotive-sequential-
2. Place the negative terminal of the LEDs in common and connect the 220ohm sequential- led-lighting-ic-for-reducing-
led-lighting-ic- design-complexity-and-
resistor in series.
for-reducing- development)
3. Connect the connector wires accordingly. design-
complexity-
• 4. Connect the other end of the wire to the Arduino Uno in the consecutive and-
development)
pins(2,3,4…10)
5. Power up the breadboard using the Arduino 5v and GND pin. RTG4 Field Programmable
Gate Array (FPGA) in a

Program and Working Explanation: (/news/rtg4-


Ceramic Quad Flat Pack
(CQFP) for Simplified
field- System Designs in Satellite
The code for this Arduino Traffic Light Controller Project is simple and can be easily programmable- and Space Probes
understood. Here we have demonstrated Traffic lights for the 3 ways road and the code gate-array- Applications (/news/rtg4-
fpga-ceramic- field-programmable-gate-
glows LED’s on all the three sides in a particular sequence, in which the actual Traffic array-fpga-ceramic-quad-
quad-flat-
Lights works. Like, at a time, there will be two Red signals on any of the two sides and one pack-cqfp-for- flat-pack-cqfp-for-
simplified- simplified-system-designs-
Green light on the remaining side. And yellow light will also glow, for 1 second each time,
satellite-and-space-probes-
system-
in between transition from Red to Green, means first red light glows for 5 second then applications)
designs-
yellow light glows for 1 second and then finally green light will be turned on. satellite-and-
space-probes-
applications)

Find TDK technologies Automotive

here Microcontrollers from


STMicroelectronics to
(/news/automotive-
Maximize Safety and
Visit TDK's Application Guide microcontrollers-
which
Security in Next-Generation
shows our total solutions for your
stmicroelectronics-
Domain/Zone Architectures
application.
maximize- (/news/automotive-
safety-and- microcontrollers-
security-for- stmicroelectronics-
next- maximize-safety-and-
TDK Corporation Open
generation- security-for-next-
generation-domain-zone-
In the program, first we have declared pins (2,3…10) as output in void setup() for 9 LEDs domain-zone-
architectures)
architectures)
(three on each side i.e. forward, right and left side).

   void setup() { 
  // configure the output pins 
  pinMode(2,OUTPUT); 
  pinMode(3,OUTPUT); 
  pinMode(4,OUTPUT); 
  pinMode(5,OUTPUT); 
  pinMode(6,OUTPUT); 
  pinMode(7,OUTPUT); 
  pinMode(8,OUTPUT); 
  pinMode(9,OUTPUT); 
  pinMode(10,OUTPUT); 
}

Then in void loop() function we have written the code for traffic lights to be turned on and
off in sequence as mentioned above.

void loop()  

  digitalWrite(2,1); //enables the 1st set of signals 
  digitalWrite(7,1); 
  digitalWrite(10,1); 
  digitalWrite(4,0); 
  digitalWrite(3,0);   
  digitalWrite(6,0); 
  digitalWrite(8,0); 
  digitalWrite(9,0); 
  digitalWrite(5,0); 
  delay(5000); 
  ..... .... 
  ..... ....

This process is well demonstrated in the Video Below. First the upside/forward side is
opened (green), while the other two sides (i.e. left side and right side) remains closed with
Red signal, with a delay of 5 seconds. Then the yellow light gets turned on at the right side
for 1sec followed by the Green light, leaving other two sides (i.e. upside and left side is
•red) closed with Red Light and 5seconds delay. Then yellow on the left side glows for

1sec followed by green one, leaving upside and right side Red with 5sec delay. This
process is looped in void loop() function for continuous process. Here we can modify
delays for which the Red, yellow and Green light remain on and off.

The complete Arduino code and Video for this Arduino Traffic Light Project is given
below.

Code

   void setup() {

  // configure the output pins

  pinMode(2,OUTPUT);

  pinMode(3,OUTPUT);

  pinMode(4,OUTPUT);

  pinMode(5,OUTPUT);

  pinMode(6,OUTPUT);

  pinMode(7,OUTPUT);

  pinMode(8,OUTPUT);

  pinMode(9,OUTPUT);

  pinMode(10,OUTPUT);

void loop() 

  digitalWrite(2,1); //enables the 1st set of signals

  digitalWrite(7,1);

  digitalWrite(10,1);

  digitalWrite(4,0);

  digitalWrite(3,0);  

  digitalWrite(6,0);

  digitalWrite(8,0);

  digitalWrite(9,0);

  digitalWrite(5,0);

  delay(5000);

  digitalWrite(3,1); //enables the yellow lights

  digitalWrite(6,1);

  digitalWrite(2,0); 

  digitalWrite(7,0);

  delay(1000);

  digitalWrite(4,1); //enables the 2nd set of signals

  digitalWrite(5,1);

  digitalWrite(10,1);

  digitalWrite(2,0);

  digitalWrite(3,0);  

  digitalWrite(6,0);

  digitalWrite(8,0);

  digitalWrite(9,0);

  digitalWrite(7,0);

  delay(5000);

  digitalWrite(9,1); //enables the yellow lights

  digitalWrite(6,1);

•  digitalWrite(10,0); 

  digitalWrite(5,0);  

  digitalWrite(4,0);

  delay(1000); 

  digitalWrite(8,1); //enables the 3rd set of signals

  digitalWrite(4,1);

  digitalWrite(7,1);

  digitalWrite(2,0);

  digitalWrite(3,0);  

  digitalWrite(5,0);

  digitalWrite(6,0);

  digitalWrite(9,0);

  digitalWrite(10,0);

  delay(5000);

  digitalWrite(9,1); //enables the yellow lights

  digitalWrite(3,1); 

  digitalWrite(7,0);

  digitalWrite(8,0); 

  digitalWrite(4,0);

  delay(1000);   

} 

 

Video

TAGS ARDUINO UNO (/TAGS/ARDUINO-UNO) ARDUINO (/TAGS/ARDUINO)

TRAFFIC LIGHT (/TAGS/TRAFFIC-LIGHT) LED (/TAGS/LED)

Get Our Weekly Newsletter!


Subscribe below to receive most popular news, articles and DIY projects from Circuit Digest

Email Address *

Name

Country
United States of America 

Thank you for subscribing!


• Subscribe

RELATED CONTENT

(/microcontroller-projects/arduino-touch- (/microcontroller-projects/li-fi-
sensitive-color-changing-plants-using-rgb- communication-between-two-arduino)
leds) Li-Fi based Text Communication between
Touch Sensitive Color Changing Plants Two Arduino (/microcontroller-projects/li-
using Arduino and RGB LEDs fi-communication-between-two-arduino)
(/microcontroller-projects/arduino-touch-
sensitive-color-changing-plants-using-rgb-
leds)

(/microcontroller-projects/measuring-
turbidity-of-water-to-determine-water-
quality-using-arduino-turbidity-sensor)
Measuring Turbidity of Water to
Determine Water Quality using Arduino
and Turbidity Sensor (/microcontroller-
projects/measuring-turbidity-of-water-to-
determine-water-quality-using-arduino-
turbidity-sensor)

(/microcontroller-projects/diy-raspberry- (/microcontroller-projects/how-to-
pi-lora-hat-for-lora-communication- program-arduino-wirelessly-over-
between-raspberry-pi-and-arduino) bluetooth)
DIY Raspberry Pi LoRa HAT - LoRa How to Program Arduino Wirelessly over
Communication between Raspberry Pi Bluetooth (/microcontroller-projects/how-
and Arduino (/microcontroller- to-program-arduino-wirelessly-over-
projects/diy-raspberry-pi-lora-hat-for-lora- bluetooth)
communication-between-raspberry-pi-
and-arduino)

(/microcontroller-projects/arduino-
nodemcu-based-smart-water-quality-
monitoring-system-using-iot)
• Smart Water Quality Monitoring System

Using IoT (/microcontroller-


projects/arduino-nodemcu-based-smart-
water-quality-monitoring-system-using-
iot)

(/microcontroller-projects/interfacing-
sx1278-lora-module-with-esp32)
Interfacing SX1278 LoRa Module with
ESP32 (/microcontroller-
projects/interfacing-sx1278-lora-module-
with-esp32)

PREVIOUS POST
Arduino based Angry Bird Game
Controller using Flex Sensor and
Potentiometer
(https://circuitdigest.com/microcontroller-
projects/arduino-angry-bird-game-
(/microcontroller-projects/arduino- controller-with-flex-sensor)
ultrasonic-acoustic-levitation-using-hc-
sr04-ultrasonic-sensors) NEXT POST

Simple Ultrasonic Acoustic Levitation Fingerprint Based Biometric


using Arduino and HCSR04 Ultrasonic Attendance System using Arduino
(https://circuitdigest.com/microcontroller-
Sensor (/microcontroller-
projects/fingerprint-attendance-
projects/arduino-ultrasonic-acoustic- system-using-arduino-uno)
levitation-using-hc-sr04-ultrasonic-
sensors)

COMMENTS

Jen
Oct 15, 2017

I have an HCS12 microcontroller. Can I use my board to make this? How


Log in (/user/login?destination=node/1001%23comment-form) or register
(/user/register?destination=node/1001%23comment-form) to post comments
would I adjust the code or does it even need to be adjusted?

Aswinth Raj (/users/aswinth-raj)


Oct 16, 2017
(/users/aswinth-raj)
HCS12 is very different from Arduino the

Log in (/user/login?destination=node/1001%23comment-form) or register


(/user/register?destination=node/1001%23comment-form) to post comments
whole code has to be changed

sakthi
Feb 25, 2018

i have nucleoF030R8 embedded.can I apply this idea on it?


Log in (/user/login?destination=node/1001%23comment-form) or register
(/user/register?destination=node/1001%23comment-form) to post comments

Aswinth Raj (/users/aswinth-raj)


Feb 26, 2018
(/users/aswinth-raj)
Sure you can
• Log in (/user/login?destination=node/1001%23comment-form) or register
(/user/register?destination=node/1001%23comment-form) to post comments

Sumanth P
Mar 02, 2018

Hey can I interface lcd with traffic light controller using arduino(without
Log in (/user/login?destination=node/1001%23comment-form) or register
(/user/register?destination=node/1001%23comment-form) to post comments
using I2C lcd module) so that I can display the comments.Stop-when red
leds are on,Go- when green leds are on,Ready-when orange leds are
on(this things should be displayed simultaneously on the lcd).I tried this
experiment but the pins are not enough to connect the lcd pins as 9 leds
has occupied from 3 to 10 digital pins.If I connect the lcd pins to analog
pins it's not working.
So my question is can I connect the lcd pins to to analog pins on the
arduino board to display the comments as I mentioned above?
If it's not possible ,then how can I connect lcd pins to arduino?
Plz reply me a.s.a.p

Aswinth Raj (/users/aswinth-raj)


Mar 05, 2018
(/users/aswinth-raj)
Yes you can use the analog pins on arduino

Log in (/user/login?destination=node/1001%23comment-form) or register


(/user/register?destination=node/1001%23comment-form) to post comments
as digital pins and so you can also interface LCD with it

Malay Mohapatra
Mar 21, 2018

Can we make the program quite short by using the Ports in program ?
Log in (/user/login?destination=node/1001%23comment-form) or register
(/user/register?destination=node/1001%23comment-form) to post comments

Aswinth Raj (/users/aswinth-raj)


Mar 22, 2018
(/users/aswinth-raj)
Ofcourse yes port manipulation will save a

Log in (/user/login?destination=node/1001%23comment-form) or register


(/user/register?destination=node/1001%23comment-form) to post comments
lot of digitalWrite functions. Here is a link which tells how to use port
handling in Arduino

https://www.arduino.cc/en/Reference/PortManipulation
(https://www.arduino.cc/en/Reference/PortManipulation)

Neo
Apr 10, 2018

pls can an Arduino Nano be used for this circuit


Log in (/user/login?destination=node/1001%23comment-form) or register
(/user/register?destination=node/1001%23comment-form) to post comments

Aswinth Raj (/users/aswinth-raj)


Apr 15, 2018
(/users/aswinth-raj)
Yes Arduino nano can be used

Log in (/user/login?destination=node/1001%23comment-form) or register


(/user/register?destination=node/1001%23comment-form) to post comments

zak
May 26, 2018

if pins are not enough to connect lcd pins try to connect shift register to
• Log in (/user/login?destination=node/1001%23comment-form) or register
(/user/register?destination=node/1001%23comment-form) to post comments
extend pins instead of connecting digital pins on arduino to analog pins

rajesh
Jun 15, 2018

hello can these codes be modified to work with a ultrasonic sensor so


Log in (/user/login?destination=node/1001%23comment-form) or register
(/user/register?destination=node/1001%23comment-form) to post comments
as to change the lights based on traffic density?

AISHA (/users/aisha-0)
Jun 18, 2018
(/users/aisha-0)
Yes it can be

Log in (/user/login?destination=node/1001%23comment-form) or register


(/user/register?destination=node/1001%23comment-form) to post comments

LOG IN (/USER/LOGIN?DESTINATION=NODE/1001%23COMMENT-FORM) OR REGISTER


(/USER/REGISTER?DESTINATION=NODE/1001%23COMMENT-FORM) TO POST
COMMENT

CATEGORIES POPULAR NEWSLETTER

Embedded ROBOTICS (/ROBOTICS- Sign Up for Latest News


Electronics PROJECTS)
Connect with us on social media and stay
(https://circuitdigest.com/embedded) Enter your email
updated with latest news, articles and projects!
555 CIRCUITS (/555-TIMER-
Power Electronics CIRCUITS)

(https://circuitdigest.com/power-
Subscribe
(https://www.facebook.com/circuitdigest/)
(https://twitter.com/CircuitDigest)
(https://www.youtube.com/channel/UCy3CUAIYgZdAOG9k3IPdLmw)
(https://www.instagram.com/circuit_digest/)
(https://www.pinterest.com/circuitdigest/)
electronics) ARDUINO PROJECTS
(/ARDUINO-PROJECTS)
Analog Electronics
(https://www.linkedin.com/company/circuit- RASPBERRY PI PROJECTS
(https://circuitdigest.com/analog-
(/SIMPLE-RASPBERRY-PI-
electronics) PROJECTS-FOR-BEGINNERS)
digest/)
Internet of Things
ELECTRONICS NEWS
(https://circuitdigest.com/internet-
(HTTPS://CIRCUITDIGEST.COM/NEWS)
of-things)
ELECTRONICS FORUM
Audio Electronics (HTTPS://CIRCUITDIGEST.COM/FORUMS)
(https://circuitdigest.com/audio-
electronics) CALCULATORS
(HTTPS://CIRCUITDIGEST.COM/CALCULATORS)
Electric Vehicles
(https://circuitdigest.com/electric-
vehicles)

Events
(https://circuitdigest.com/events)

Copyright © 2020 Circuit Digest (http://circuitdigest.com/). All rights reserved. Privacy Policy (http://circuitdigest.com/privacy-policy) | Cookie Policy
(https://circuitdigest.com/cookie-policy) | Terms of Use
(https://circuitdigest.com/terms-of-use) | Contact Us
(http://circuitdigest.com/contact) | Advertise (http://circuitdigest.com/advertise)

You might also like