Lab Report Stand NO 08 (Trafic Signal by Arduino)
Lab Report Stand NO 08 (Trafic Signal by Arduino)
Kierunek:
w Poznaniu
Engineering Management
General information:
Arduino:
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or
reading a message - and turn it into an output - activating a motor, turning on an LED, publishing
something online.
Analog Technology:
In analog technology, a wave is recorded or used in its original form. So, for example, in
an analog tape recorder, a signal is taken straight from the microphone and laid onto tape. The
wave from the microphone is an analog wave, and therefore the wave on the tape is analog as
well. That wave on the tape can be read, amplified and sent to a speaker to produce the sound.
Digital Technology:
In digital technology, the analog wave is sampled at some interval, and then turned
into numbers that are stored in the digital device. On a CD, the sampling rate is 44,000 samples
per second. So on a CD, there are 44,000 numbers stored per second of music. To hear the
music, the numbers are turned into a voltage wave that approximates the original wave.
The wiring of the Arduino traffic light project is beyond simple. It’s partly what makes it one of
those great educational projects. Each LED will connect to a dedicated pin on the Arduino and
share a common ground. (NB: Show the video in Drive with given link bellow)
Exercise:
Procedure:
The Change-Lights function performs all the hard work. This rotates the traffic light
through yellow and red, then back to green. As this gets called inside the loop function, the
Arduino will run this code forever, with a 30/15-second pause every time (According To Code).
These four steps replicate the process used in real traffic lights. For each step, the code is very
similar. The appropriate LED gets turned on or off using Digital-Write. This is an Arduino
function used to set output pins to HIGH (for on), or LOW (for off). After enabling or disabling
the required LEDs, the Delay makes the Arduino wait for a given amount of time.
Arduino Traffic Light Code:
The complete Arduino code and Video for this Arduino Traffic Light Project is given below.
void setup() {
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(8, INPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(3, OUTPUT);
void loop() {
digitalWrite(greenlight, 1);
digitalWrite(redlight2, 1);
if (digitalRead(button) == HIGH) {
delay(1);
if (digitalRead(button) == HIGH)
changeLights();
delay(0);
void changeLights() {
digitalRead(button) == LOW;
digitalWrite(greenlight, 0);
digitalWrite(yellowlight, 1);
delay(3000);
digitalWrite(yellowlight, 0);
digitalWrite(redlight, 1);
delay(3000);
digitalWrite(redlight2, 0);
digitalWrite(greenlight2, HIGH);
delay(10000);
digitalWrite(greenlight2, LOW);
delay(500);
digitalWrite(greenlight2, HIGH);
delay(500);
digitalWrite(greenlight2, LOW);
delay(500);
digitalWrite(greenlight2, HIGH);
delay(500);
digitalWrite(greenlight2, LOW);
delay(500);
digitalWrite(greenlight2, HIGH);
delay(500);
digitalWrite(greenlight2, LOW);
delay(500);
digitalWrite(greenlight2, HIGH);
delay(500);
digitalWrite(greenlight2, LOW);
delay(500);
digitalWrite(greenlight2, HIGH);
delay(300);
digitalWrite(greenlight2, LOW);
delay(300);
digitalWrite(greenlight2, HIGH);
delay(300);
digitalWrite(greenlight2, LOW);
delay(300);
digitalWrite(greenlight2, HIGH);
delay(300);
digitalWrite(greenlight2, LOW);
delay(300);
digitalWrite(greenlight2, HIGH);
delay(100);
digitalWrite(greenlight2, LOW);
delay(100);
digitalWrite(greenlight2, HIGH);
delay(100);
digitalWrite(greenlight2, LOW);
delay(100);
digitalWrite(greenlight2, HIGH);
delay(100);
digitalWrite(greenlight2, LOW);
delay(100);
digitalWrite(redlight2, 1);
digitalWrite(greenlight2, 0);
delay(3000);
digitalWrite(redlight, 1);
digitalWrite(yellowlight, 1);
delay(3000);
digitalWrite(redlight, 0);
digitalWrite(yellowlight, 0);
Video Link:
https://drive.google.com/file/d/1tViehJ-5RlmFBXelpkBhnkRk-RcOwDIS/view?usp=sharing
Conclusion:
Arduino Traffic Light Controller Project is simple and can be easily understood. It is one
of the most popular open source micro controller board which is highly useful for doing DIY
projects. Here we have demonstrated Traffic lights for the 2 ways road and the code glows
LED’s on all the two sides in a particular sequence, in which the actual Traffic Lights works.
Sources :
1. https://circuitdigest.com/microcontroller-projects/arduino-traffic-light-controller-project
2. https://pimylifeup.com/arduino-traffic-light-project/
3. https://www.makeuseof.com/tag/arduino-traffic-light-controller/