Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Arduino Based Traffic Light Controller

By Samidha Verma

If you want to get your hands dirty with a few LEDs and resistors, and while adding a switch with a pull down resistor and play around with the code, then we can discuss the project named Arduino traffic light controller. This project is based on the idea that how two traffic light board control traffic in a one way junction.
 
For this, one Arduino Uno board and red, green and yellow LED are used in the project. Apart from that, a breadboard, resistors for the LEDs, Connecting wires, a pushbutton switch and a high value resistor is required
 
Wiring
 
The quick schematic, made up in Fritzing is very simple. The three LEDs are wired with resistors to three separate input pins, and all of them are connected to the ground.
 
Programming
 
For the function to be set up, the red, yellow and green LEDs are particularly specified as output mode and variables created are to be represented as the pin numbers. Separate function for changing the lights are created. The programming and the codes includes figuring out the minute logic details that presents the biggest problem. Here, the key to being a good programmer is to look at any process carefully and break it down into its fundamental steps.
 
Upload and run, once done with the codes and a working traffic light that changes every 15 seconds can be seen. Now update the circuit diagram to add in a pushbutton for pedestrians to change the light whenever they like.
 
The switch will have a high-impedance 10k resistor attached to it, which is called a pull down resistor. A switch is responsible for the current flow but in a logic circuit, the current should be always flowing in either a high or low state. Therefore, assume that a pushbutton switch that isn’t actually being pushed would be defined as being in a low state, but in fact it’s said to be ‘floating’, because no current is being drawn at all.
 
It is possible that a false reading will occur in the floating state as it fluctuates with electrical interference. When the switch is closed, a pull down resistor keeps a small amount of current flowing and hence ensure an accurate low state reading.
 
By adding some new variables to the start of the app, read the state of the pushbutton switch and only change the lights when it’s activated. It means that the loop part of the code will not focus on changing of the lights every 15 seconds and change when the lights are activated.
 
In the setup function a new line is added to make the switch as an input and a single line to start the traffic lights in the green stage. After changing the entire loop function, wait for 15 seconds to ensure that traffic lights don’t change for at least that duration. Exactly15 seconds later, the loop restarts and with each restart, read the state of the button again.

Filed Under: Reviews

 

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • PS2 Keyboard To Store Text In SD Card Using Arduino Circuit Setup On Breadboard
    How To Use PS2 Keyboard To Store Text In SD Card Using Arduino- (Part 42/49)
  • Wireless Path Tracking System Using Mouse, XBee And Arduino Circuit Setup On Breadboard
    How To Make A Wireless Path Tracking System Using Mouse, XBee And Arduino- (Part 43/49)
  • How to Make a Wireless Keyboard Using Xbee with Arduino- (Part 44/49)
  • Making Phone Call From GSM Module Using Arduino Circuit Setup On Breadboard
    How to Make Phonecall From GSM Module Using Arduino- (Part 45/49)
  • How to Make a Call using Keyboard, GSM Module and Arduino
    How To Make A Call Using Keyboard, GSM Module And Arduino- (Part 46/49)
  • Receiving SMS Using GSM Module With Arduino Prototype
    How to Receive SMS Using GSM Module with Arduino- (Part 47/49)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • What is a low power design?
  • Renesas partners with Tata to accelerate progress in advanced electronics
  • STMicroelectronics’ new touchscreen controller for smartphones enables longer runtime
  • Samsung unveils ISOCELL image sensor with industry’s smallest 0.56μm pixel

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • How do you find the angle made by two isosceles triangles in a kite?
  • MWO - EM Structure missing
  • Effect of variable gain amplifier and LNA on the input RF signal's phase
  • HF preamplifier with threshold?
  • Does Monostable pulse stay HIGH whilst input pulse is HIGH?

RSS Electro-Tech-Online.com Discussions

  • Help wanted to power an AC120v induction motor ( edited from Brushless motor - thank you @SHORTBUS= )
  • NOR gate oscillator in LTspice not working
  • HELP NEEDED
  • intro to PI
  • Lighting a .010 green fiber optic with led
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering