• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » DIY Arduino Traffic Light Pedestrian Light Push Button Control

By Abhishek Ghosh June 9, 2016 8:14 am Updated on August 20, 2016

DIY Arduino Traffic Light Pedestrian Light Push Button Control

Advertisement

Here is How to Create LED DIY Arduino Traffic Light – Pedestrian Light Push Button Control. When Pedestrians Will WALK, Cars Will Stop Logic.There is actually two parts – one is building the LED DIY Traffic Lights and Second Part is the Coding. We are using push button, but it can be a sensor in real. Most commonly many websites write about Arduino Traffic Light which automatically goes OFF and ON. That is not practical, it is more towards toy. It is example of basic implementation of Finite State Machines modeling in embedded.

 

Creating DIY Arduino Traffic Light Pedestrian Light

 

This should be a separate chapter. Raspberry has great pre-built traffic light add-ons like PI-TRAFFIC, PI-STOP, Traffic HAT and so on. But they cost minimum $10 for a set of two. Additionally we are not getting the desired realistic Pedestrian Light. For total 5 LEDs, it is meaningless to pay $10. We are taking about this stuff :

Arduino Traffic Light

You can mount the LED on PCB to get such thing or just put them over simple corrugated board or 3D Print or use LEGO blocks. WALK/GO LED can be created by adding those shaped cover.

Advertisement

---

 

DIY Arduino Traffic Light Pedestrian Light : Logic

 

When push button is pressed :

  1. the green LED of Traffic Light will turn off
  2. and yellow LED of Traffic Light will turn on for 2 seconds
  3. then the red LED of Traffic Light will go to ON
  4. by that time the green LED of Pedestrian Light will turn on
  5. After 4 seconds the green LED of Pedestrian Light will be flashing for 5 seconds and turn off
  6. Red LED of Pedestrian Light will be on, red LED of Traffic Light will off, green LED of Traffic Light will be on.

 

Creating DIY Arduino Traffic Light Pedestrian Light : Circuit Diagram and Code

 

DIY-Arduino-Traffic-Light-Pedestrian-Light-Push-Button-Control

We have the whole project on FritZing and you can download from this link. Download the .fzz and .ino file from there. Here is also the code :

 

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
int TrafficRed = 3;  
int TrafficYellow = 4;
int TrafficGreen = 5;
int PedestrianRed = 8;  
int PedestrianGreen = 9;
int button = 13;
int crossTime = 4000;  
unsigned long buttonGap ;
void setup () {
  pinMode(TrafficRed, OUTPUT);
  pinMode(TrafficYellow, OUTPUT);
  pinMode(TrafficGreen, OUTPUT);
  pinMode(PedestrianRed, OUTPUT);
  pinMode(PedestrianGreen, OUTPUT);
  pinMode(button, INPUT);
  digitalWrite(TrafficGreen,HIGH);
  digitalWrite(PedestrianRed, HIGH);
}
 
void loop(){
  int state = digitalRead(button);
  if(state==HIGH && (millis() - buttonGap) > 5000) {
    switchLights();  
  }
}
 
void switchLights() {
  digitalWrite(TrafficGreen,LOW);
  digitalWrite(TrafficYellow,HIGH);
  delay(2000);
 
  digitalWrite(TrafficYellow,LOW);
  digitalWrite(TrafficRed,HIGH);
  delay(1000);
 
  digitalWrite(PedestrianRed,LOW);
  digitalWrite(PedestrianGreen,HIGH);
  delay(crossTime);
 
  for (int x=0; x<10; x++){
    digitalWrite(PedestrianGreen,HIGH);
    delay(250);
    digitalWrite(PedestrianGreen,LOW);
    delay(250);
  }
  digitalWrite(PedestrianRed, HIGH);
  delay(100);
  digitalWrite(TrafficRoadGreen,HIGH);
  digitalWrite(TrafficRoadRed,LOW);
  buttonGap = millis();
}

The code is modified from http://osoyoo.com/?p=239 and is distributed under GNU GPL 3.0 License.

Tagged With arduino traffic light with pedestrian button , arduino traffic lights with button , arduino traffic light with button , https://thecustomizewindows com/2016/06/diy-arduino-traffic-light-pae-push-button/ , simple stop light arduino , arduino traffic light push button , arduinotwo traffic lights and nutton coding , arduino uno traffic lights with led and buttons sketch and coding , arduino stoplight with button code , arduino pedestrian traffic light

This Article Has Been Shared 914 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to DIY Arduino Traffic Light Pedestrian Light Push Button Control

  • What is a Micropump?

    For many reasons we need miniature things for special works, like bigger pumps there are Micropumps. This article tells what is a Micropump.

  • Hardware For Internet of Things DIY Projects

    IBM is actively thinking about hardwares for DIY IoT projects. Here is Limited Budget Hardware For Internet of Things DIY Projects Guide.

  • Arduino Basic 3V Motor Control : Speed Variation For Robot

    Very Easy With 100% Working Warranty. Code, Circuit Included. This Arduino Basic 3V Motor Control is Intended For Speed Variation For Robot.

  • Arduino 3V Motor Control : Level I Advanced Speed Variation

    Arduino 3V Motor Control Level I Advanced Speed Variation is Second Hard Level Guide Where Diode, Transistor and Resister Has Been Used.

  • What is Terminal?

    What is Terminal? A terminal console and a computer is for input and display of data. Terminals have been developed so far for the mainframe computers.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023
  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023

About This Article

Cite this article as: Abhishek Ghosh, "DIY Arduino Traffic Light Pedestrian Light Push Button Control," in The Customize Windows, June 9, 2016, February 2, 2023, https://thecustomizewindows.com/2016/06/diy-arduino-traffic-light-pae-push-button/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT