AMERICAN INTERNATIONAL UNIVERSITY-BANGLADESH
Faculty of Engineering
Lab Report
Experiment # 02
Experiment Title: Implementation of traffic runway lights using timer functions.
Date of Perform: 19 February 2026 Date of Submission: 23 February 2026
Course Title: Microprocessor and Embedded Systems Lab
Course Code: EEE4103 Section: D
Semester: Spring 2025-26 Degree Program: BSc in CSE
Course Teacher: Protik Parvez Sheikh
Declaration and Statement of Authorship:
1. I/we hold a copy of this Assignment/Case Study, which can be produced if the original is lost/damaged.
2. This Assignment/Case Study is my/our original work; no part has been copied from any other student’s work or any other source except where
due acknowledgment is made.
3. No part of this Assignment/Case Study has been written for me/us by any other person except where such collaboration has been authorized.
by the concerned teacher and is acknowledged in the assignment.
4. I/we have not previously submitted or am submitting this work for any other course/unit.
5. This work may be reproduced, communicated, compared, and archived to detect plagiarism.
6. I/we permit a copy of my/our marked work to be retained by the Faculty Member for review by any internal/external examiners.
7. I/we understand that Plagiarism is the presentation of the work, idea, or creation of another person as though it is your own. It is a form of cheating and is a
very serious academic offense that may lead to expulsion from the University. Plagiarized material can be drawn from, and presented in, written, graphic, and
visual forms, including electronic data, and oral presentations. Plagiarism occurs when the origin of the source is not appropriately cited.
8. I/we also understand that enabling plagiarism is the act of assisting or allowing another person to plagiarize or copy my/our work.
* Student(s) must complete all details except the faculty use part.
** Please submit all assignments to your course teacher or the office of the concerned teacher.
Group # 03
Sl No Name ID PROGRAM SIGNATURE
1 Anika Hossain Raisa 23-54127-3 BSc in CSE
2 Mahi Muqtadir 23-53303-3 BSc in CSE
3 Shafeen Ahmed 23-53276-3 BSc in CSE
4 MD Tahsin ur Rahman 23-54884-3 BSc in CSE
5 Israt Jahan Anamika 23-50840-1 BSc in CSE
6
Faculty use only
FACULTY COMMENTS
Marks Obtained
Total Marks
Table of Contents
Objectives 3
Apparatus 3
Experimental Setup 3
Codes 3-4
Experimental Results 5
Simulation Setup & Results 6
Discussion & Conclusion 7-8
References 8
Marking Rubrics (to be filled by Faculty):
Level Excellent Proficient Good Acceptable Unacceptable No Response
Category [5] [4] [3] [2] [1] [0]
Able to clarify the Able to clarify the
Able to clarify the
Able to clarify the understanding of the understanding of the lab
understanding of the lab Unable to clarify the
Title and understanding of the lab, lab experiment, but a experiment, but it lacks a
experiment, no issues are understanding of the
Objectives no issues are missing and few issues are few important issues of
missing but its formatting is lab experiment.
formatting is good. wrong, and its the experiment without
not good.
formatting is bad. maintaining the format.
Able to explain the
Able to explain the Presents the
Able to explain the experimental codes Presents the experimental
experimental codes and experimental codes
Codes and experimental codes and but simulation codes but didn’t explain
simulation methods using but didn’t explain
Methods simulation methods using method using simulation methods using
Proteus but is not formatted simulation methods
Proteus very well. Proteus is not Proteus clearly.
well. using Proteus.
explained well.
Key results and Major results, such as No Response/
Key results and images are Misses several key copied from
images are there. experimental and
Key results and images there. Figures/Tables have results and images. others/
Figures/Tables lack a simulation results’
are there. Figures/Tables all identifications, such as Figures/Tables lack identical
few identifications, images are not
Results have all identifications the axis labels, numbers, identification, such as the submissions
such as the axis included. Figures
and refer to them properly and captions with a few axis labels, numbers, and with gross
labels, numbers, and and tables are poorly
in the texts. minor errors; the texts refer captions; the texts don’t errors/image
captions; the texts constructed or not
them. refer them. file printed
refer them. presented.
Proper interpretation of Proper interpretation of
Interpretation of Very poor
results and summarizes results and summarizes the Misses the interpretation
results is presented. interpretation of
Discussion the results to draw a results to draw a conclusion of key results. There is
However, there is a the results. No
and conclusion, discusses its but didn’t discuss its little connection between
disconnect between connection
Conclusion applications in real-life applications in real-life the results and
the results and between results and
situations to connect with situations to connect with discussion.
discussion. discussions.
the report’s conclusion. the conclusion of the report.
Able to produce all Able to produce all Able to produce all Able to produce all Unable to produce all
Question and questions’ answers questions’ answers but questions’ answers questions’ answers but questions’ answers
Answer correctly maintaining the didn’t maintain the lab but wrong answers to wrong/missing answers and completely
lab report format. report format. a few questions. to multiple questions. wrong answers.
Total Marks
Comments
(25)
Page 2 of 8
Objectives:
The objective of this experiment is to get familiarized with Timers and use them for the implementation
of a traffic control system.
Apparatus:
1. Arduino Uno/ Arduino Mega
2. LED lights (YELLOW, RED, and GREEN)
3. Resistors (220 ohms)
Experimental Setup:
Figure 1: Traffic Light System.
Codes:
Considering XX-XXABC-X = 23-54127-3
A for the RED light, B for the YELLOW LED, and C for GREEN LED.
#define RED_PIN 8 //define name of pins used
#define YELLOW_PIN 10
#define GREEN_PIN 12
//define the delays for each traffic light color
int red_on = 1000; //1s delay
int red_yellow_on = 1000; //1s delay
int green_on = 7000; //7s delay
int green_blink = 500; //.5s delay
int yellow_on = 2000; //2s delay
Page 3 of 8
int delay_timer (int milliseconds)
{
int count = 0;
while(1)
{
if(TCNT0 >= 16) // Checking if 1 millisecond has passed
{
TCNT0=0;
count++;
if (count == milliseconds) //checking if required milliseconds delay has passed
{
count=0;
break; // exits the loop
}
}
}
return 0;
}
void setup() {
//define pins connected to LEDs as outputs
pinMode(RED_PIN, OUTPUT);
pinMode(YELLOW_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
//set up timer
TCCR0A = 0b00000000;
TCCR0B = 0b00000101; //setting pre-scaler for timer clock
TCNT0=0;
}
void loop() {
//to make red LED on
digitalWrite(RED_PIN, HIGH);
delay_timer(red_on);
//to turn yellow LED on
digitalWrite(YELLOW_PIN, HIGH);
delay_timer(red_yellow_on);
//turning off RED_PIN and YELLOW_PIN, and turning on greenLED
digitalWrite(RED_PIN, LOW);
digitalWrite(YELLOW_PIN, LOW);
digitalWrite(GREEN_PIN, HIGH);
delay_timer(green_on);
digitalWrite(GREEN_PIN, LOW);
Page 4 of 8
//for turning green Led on and off for 3 times
for(int i = 0; i < 3; i = i+1)
{
delay_timer(green_blink);
digitalWrite(GREEN_PIN, HIGH);
delay_timer(green_blink);
digitalWrite(GREEN_PIN, LOW);
}
//for turning on yellow LED
digitalWrite(YELLOW_PIN, HIGH);
delay_timer(yellow_on);
digitalWrite(YELLOW_PIN, LOW);
}
Experimental Results:
Figure 1.1: RED LED on for 1s. Figure 1.2: YELLOW LED on for 2s after RED 1s delay.
Figure 1.3: GREEN LED on for 7s & later blink 3 times with 0.5s delay.
Page 5 of 8
Simulation Setup & Results:
Figure 1.1.a: RED LED on for 1s.
Figure 1.2.a: YELLOW LED on for 2s after RED 1s delay.
Page 6 of 8
Figure 1.3.a: GREEN LED on for 7s & later blink 3 times with 0.5s delay.
Discussion & Conclusion:
Discussion
In this experiment, the Arduino Uno microcontroller was used to implement traffic runway lights using timer
functions. The LEDs representing runway lights were successfully controlled in timed sequences, simulating
the operation of real airport runway lighting. The importance of precise timing and sequential control was
demonstrated, as the lights needed to follow a strict pattern to replicate real-life scenarios accurately.
Through this experiment, hands-on experience was gained in programming timers, configuring
microcontroller outputs, and connecting components effectively. It was observed that timer functions allow
automated control without continuous manual intervention, highlighting the practical advantages of
embedded systems in safety-critical applications.
The experiment also provided insight into real-life applications, such as automated runway lighting systems,
emergency signaling, and industrial process indicators, where accurate timing and sequencing are essential.
The ability to control multiple outputs simultaneously and manage delays through code was understood,
showcasing the versatility of microcontroller-based systems.
Page 7 of 8
Conclusion
From this experiment, a clear understanding of timer-based control using microcontrollers was achieved. The
traffic runway lights were successfully implemented, and the LEDs operated in precise timed sequences,
demonstrating the practical application of timers in automation.
It was concluded that microcontrollers provide an efficient, reliable, and low-cost solution for time-critical control
systems. Valuable experience in coding, circuit assembly, and timing management was gained, which can be
applied to more advanced embedded systems and automation projects. Real-life applications, including airport
runway management, emergency lighting systems, and industrial signaling, were effectively simulated through
this experiment.
References:
1) [Link]
2) ATMega328 manual
3) [Link]
4) [Link]
Page 8 of 8