Title | Arduino Traffic Light Controller Project with Circuit Diagram and Code |
---|---|
Author | Hmxa Jay |
Course | Machine Design |
Institution | University of Engineering and Technology Lahore |
Pages | 14 |
File Size | 851.5 KB |
File Type | |
Total Downloads | 87 |
Total Views | 160 |
Nope...
ARDUINO (HTTPS://CIRCUITDIGEST.COM/ARDUINO-PROJECTS)
Arduino Based 3-Way Traffic Light Controller (/microcontroller-projects/arduino-traffic-light-controllerproject) By (page_author.html)Antony Jackson (/users/antony-jackson) Aug 08, 2017
13
Arduino Based 3-Way Trac Light Controller
We all know about Arduino. It is one of the most popular open source micro controller board which is highly useful for doing DIY projects. This Arduino based 3-Way Trac Light Controller is a simple Arduino DIY project (https://circuitdigest.com/arduinoprojects) which is useful to understand the working of trac lights which we see around us. We have covered a more simpler version of trac lights in this trac light circuit (https://circuitdigest.com/electronic-circuits/four-way-trac-light-circuit). demonstrated it for 3 sides or ways. Now let’s get into the project… This website uses cookies to improve user experience. By using the website you are giving OK, I Understand your consent to set cookies. For more information, read our cookie policy (https://circuitdigest.com/cookie-policy) and privacy policy (http://circuitdigest.com/privacy-policy).
Here have
Components Required: 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 Trac Light Controllerproject is given below:
(/fullimage?
i=circuitdiagram_mic/Arduino-based-3-way-Trac-light-controller-circuit-diagram.png) It’s pretty simple and can be easily built on bread board as explained in below steps: 1. Connect the LEDs in the order as Red, Green, and Yellow in the breadboard. 2. Place the negative terminal of the LEDs in common and connect the 220ohm resistor in series. 3. Connect the connector wires accordingly. 4. Connect the other end of the wire to the Arduino Uno in the consecutive pins(2,3,4…10)
This up website uses cookies to the improve user5vexperience. By using the website you are giving 5. Power the breadboard using Arduino and GND pin. OK, I Understand your consent to set cookies. For more information, read our cookie policy (https://circuitdigest.com/cookie-policy) and privacy policy (http://circuitdigest.com/privacy-policy).
Program and Working Explanation: The code for this Arduino Trac Light Controller Project is simple and can be easily understood. Here we have demonstrated Trac lights for the 3 ways road and the code glows LED’s on all the three sides in a particular sequence, in which the actual Trac Lights works. Like, at a time, there will be two Red signals on any of the two sides and one Green light on the remaining side. And yellow light will also glow, for 1 second each time, in between transition from Red to Green, means rst red light glows for 5 second then yellow light glows for 1 second and then nally green light will be turned on. In the program, rst we have declared pins (2,3…10) as output in void setup() for 9 LEDs (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 trac 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 Thisoff. website uses cookies to improve user experience. By using the website you are giving your consent to set For more information, read our cookie policybelow. The complete Arduino code andcookies. Video for this Arduino Trac Light Project is given (https://circuitdigest.com/cookie-policy) and privacy policy Code (http://circuitdigest.com/privacy-policy).
OK, I Understand
void setup() { // congure 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);This website uses cookies to improve user experience. By using the website you are giving
your consent to set cookies. For more information, read our cookie policy (https://circuitdigest.com/cookie-policy) and privacy policy digitalWrite(9,1); //enables the yellow lights (http://circuitdigest.com/privacy-policy).
OK, I Understand
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 Arduino Based 3-Way Trac Light Controller
TAGS
ARDUINO UNO (/TAGS/ARDUINO-UNO)
ARDUINO (/TAGS/ARDUINO)
TRAFFIC LIGHT (/TAGS/TRAFFIC-LIGHT)
LED (/TAGS/LED) This website uses cookies to improve user experience. By using the website you are giving
your consent to set cookies. For more information, read our cookie policy (https://circuitdigest.com/cookie-policy) and privacy policy RECOMMENDED POSTS (http://circuitdigest.com/privacy-policy).
OK, I Understand
(http://bit.ly/2qkijam )
Dev Kit Weekly: Ayla Development Kit v2.0 (http://bit.ly/2qkijam )
(http://bit.ly/386Bw0k )
Dev Kit Weekly: BeagleBone AI (http://bit.ly/386Bw0k )
(http://bit.ly/34LTsLA )
Industrial IoT Workloads Benefit from Edge to Cloud Intelligence (http://bit.ly/34LTsLA )
(http://bit.ly/2DNvmo0 )
The Engineer's Answer to Faster Sampling at Lower Power (http://bit.ly/2DNvmo0 )
(http://bit.ly/360oDD9 )
Modem or Module? Answering a Key Question for Cellular IoT Design Projects (http://bit.ly/360oDD9 )
(http://bit.ly/2qqaOPm )
This website uses cookies to improve user experience. By using the website you are giving your consent to set cookies. For more information, read our cookie policy Enhancing Debug and Trace Capabilities for System Developers (https://circuitdigest.com/cookie-policy) and privacy policy(http://bit.ly/2qqaOPm ) (http://circuitdigest.com/privacy-policy).
OK, I Understand
(http://bit.ly/2LmMYv3 )
How to Develop High-Performance Object Recognition on FPGA Edge Devices (http://bit.ly/2LmMYv3 )
(http://bit.ly/2qhkOds )
IoT Device Security Conference 2020 (http://bit.ly/2qhkOds )
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
Subscribe
RELATED CONTENT
(/microcontroller-projects/how-to-interface-bmp280-pressure-sensor-with-arduino)
How to Interface BMP280 Pressure Sensor Module with Arduino (/microcontroller-projects/how-to-interface-bmp280-pressuresensor-with-arduino)
This website uses cookies to improve user experience. By using the website you are giving your consent to set cookies. For more information, read our cookie policy (https://circuitdigest.com/cookie-policy) and privacy policy (http://circuitdigest.com/privacy-policy).
OK, I Understand
(/microcontroller-projects/wireless-doorbell-using-arduino)
Wireless Doorbell using Arduino and RF Module (/microcontroller-projects/wireless-doorbell-using-arduino)
(/microcontroller-projects/digital-notice-board-using-p10-led-matrix-display-and-
arduino) LED Display Board using P10 LED Matrix Display and Arduino (/microcontroller-projects/digital-notice-board-using-p10-led-matrixdisplay-and-arduino)
(/microcontroller-projects/automatic-bottle-lling-system-using-arduino)
Automatic Bottle Filling System using Arduino (/microcontroller-projects/automatic-bottle-lling-system-using-arduino)
(/microcontroller-projects/arduino-currency-counter-using-ir-and-color-sensor)
Arduino Currency Counter using IR and Color Sensor (/microcontroller-projects/arduino-currency-counter-using-ir-and-color-sensor)
(/microcontroller-projects/login-to-windows-computers-using-rc522-rd-tag-and-
arduino) Login to Windows Computers using RFID tag and Arduino (/microcontroller-projects/login-to-windows-computers-using-rc522-rdtag-and-arduino)
This website uses cookies to improve user experience. By using the website you are giving your consent to set cookies. For more information, read our cookie policy (https://circuitdigest.com/cookie-policy) and privacy policy (http://circuitdigest.com/privacy-policy).
OK, I Understand
(/microcontroller-projects/alexa-controlled-home-automation-using-arduino-and-wi-
module-esp8266) Alexa Controlled Home Automation using Arduino and ESP-01 Wi-Fi Module (/microcontroller-projects/alexa-controlled-homeautomation-using-arduino-and-wi-module-esp8266)
(/microcontroller-projects/arduino-ac-light-dimmer-using-triac)
AC Light Dimmer using Arduino and TRIAC (/microcontroller-projects/arduino-ac-light-dimmer-using-triac) PREVIOUS POST
Arduino based Angry Bird Game Controller using Flex Sensor and Potentiometer (https://circuitdigest.com/microcontroller-projects/arduino-angry-bird-game-controller-with-ex-sensor) NEXT POST
Fingerprint Based Biometric Attendance System using Arduino (https://circuitdigest.com/microcontrollerprojects/ngerprint-attendance-system-using-arduino-uno)
COMMENTS Jen Oct 15, 2017 I have an HCS12 microcontroller. Can I use my board to make this? How would I adjust the code or does it Log in (/user/login?destination=node/1001%23comment-form) or register (/user/register? destination=node/1001%23comment-form) to post comments even need to be adjusted?
Aswinth Raj (/users/aswinth-raj) Oct 16, 2017 (/users/aswinth-raj)
HCS12 is very different from Arduino the whole code has to be changed
Log in (/user/login?destination=node/1001%23comment-form) or register (/user/register? destination=node/1001%23comment-form) to post comments sakthi Feb 25, 2018
This website uses cookies to improve user experience. By using the website you are giving your consent to set cookies. For more information, read our cookie policy i have nucleoF030R8 embedded.can I apply this idea on it? (https://circuitdigest.com/cookie-policy) and privacy policy (http://circuitdigest.com/privacy-policy).
OK, I Understand
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 trac light controller using arduino(without using I2C lcd module) so that I can Log in (/user/login?destination=node/1001%23comment-form) or register (/user/register? destination=node/1001%23comment-form) to post comments 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 as digital pins and so you can also
Log in (/user/login?destination=node/1001%23comment-form) or register (/user/register? destination=node/1001%23comment-form) to post comments 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 lot of digitalWrite functions. Here is a Log in (/user/login?destination=node/1001%23comment-form) or register (/user/register? destination=node/1001%23comment-form) to post comments link which tells how to use port handling in Arduino This website uses cookies to improve user experience. By using the website you are giving
https://www.arduino.cc/en/Reference/PortManipulation your consent to set cookies. For more information, read our cookie policy (https://circuitdigest.com/cookie-policy) and privacy policy (https://www.arduino.cc/en/Reference/PortManipulation) (http://circuitdigest.com/privacy-policy).
OK, I Understand
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 extend pins instead of connecting Log in (/user/login?destination=node/1001%23comment-form) or register (/user/register? destination=node/1001%23comment-form) to post comments digital pins on arduino to analog pins
rajesh Jun 15, 2018 hello can these codes be modied to work with a ultrasonic sensor so as to change the lights based on trac Log in (/user/login?destination=node/1001%23comment-form) or register (/user/register? destination=node/1001%23comment-form) to post comments 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
NEWS ARTICLES PROJECTS
This website uses cookies to improve user experience. By using the website you are giving your consent to set cookies. For more information, read our cookie policy (https://circuitdigest.com/cookie-policy) and privacy policy (http://circuitdigest.com/privacy-policy).
OK, I Understand
REFERENCE DESIGNS The CAN transceiver and arbitration logic in this TI design support CAN FD speed up to 2Mbps. Small 6mm form factor PCB width with integrated protection and resistance temperature detector.
This website uses cookies to improve user experience. By using the website you are giving 8-channel,your group-isolated, digital module design forinformation, industrial functional consent to setinput cookies. For more read safety. our cookie policy
(https://circuitdigest.com/cookie-policy) and privacy policy (http://circuitdigest.com/privacy-policy).
This design showcases the LMG1020, low-side nanosecond GaN gate driver capable of driving a FET.
OK, I Understand
This design features SiC MOSFETs with switching loss to enable higher DC bus voltages of up to 800V. Reference design from Texas Instruments for HEV/EV onboard charter and energy storage applications. Our ICs & reference designs enable smarter and safer AC charging stations for electric vehicles. Benecial where power density, cost, weight and high voltage conversion ratio are critical factors.
Connect with us on social media and stay updated with latest news, articles and projects!
(https://www.linkedin.com/company/circu
(https://www.facebook.com/circuitdigest/) (https://twitter.com/CircuitDigest) (https://www.youtube.com/channel/UCy3CUAIYgZdAOG9k3 (https://www.instagram.com/circuit_digest/) (https://www.pinterest.com/circuitdigest/) digest/) CATEGORIES Embedded Electronics (https://circuitdigest.com/embedded) Power Electronics (https://circuitdigest.com/power-electronics) Analog Electronics (https://circuitdigest.com/analog-electronics) Internet of Things (https://circuitdigest.com/internet-of-things) Audio Electronics (https://circuitdigest.com/audio-electronics) Electric Vehicles (https://circuitdigest.com/electric-vehicles) Events (https://circuitdigest.com/events)
POPULAR ROBOTICS (/ROBOTICS-PROJECTS)
555 CIRCUITS (/555-TIMER-CIRCUITS)
RASPBERRY PI PROJECTS (/SIMPLE-RASPBERRY-PI-PROJECTS-FOR-BEGINNERS) ELECTRONICS FORUM (HTTPS://CIRCUITDIGEST.COM/FORUMS)
ARDUINO PROJECTS (/ARDUINO-PROJECTS)
ELECTRONICS NEWS (HTTPS://CIRCUITDIGEST.COM/NEWS)
CALCULATORS (HTTPS://CIRCUITDIGEST.COM/CALCULATORS)
NEWSLETTER Sign Up for Latest News
Enter your email
This website uses cookies to improve user experience. Subscribe By using the website you are giving your consent to set cookies. For more information, read our cookie policy (https://circuitdigest.com/cookie-policy) and privacy policy (http://circuitdigest.com/privacy-policy).
OK, I Understand
Copyright © 2019Circuit 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....