0% found this document useful (0 votes)
7 views

Assignment 1 - M4

Mechanical university assessment M4
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Assignment 1 - M4

Mechanical university assessment M4
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CE362-Assignment #1

Semester : Spring Year : 2022


Course Title : Microprocessor Systems and Interfacing
Course Code : CE362 Version M4
Instructor(s) : Mrs. Maha Zayoud

Homework : 10% No. of Pages : 2


Weight: (includes cover page) (Student Must Verify)

To be completed by the student


Name ID

Grading Scheme

Total Earned Points Total Available Points

100

Grading Scheme
Question Earned Points Max. Points Question Earned Points Max. Points
1 15 5 10
2 20
3 30
4 25

CE362: Microprocessor Systems and Interfacing


1
Question:
Design a code in C on Arduino IDE to be downloaded onto the
AT91SAM3X8E microcontroller found on the Arduino Due board. The
purpose of this code is to create a smart traffic light system for two
perpendicular lanes. The traffic lights are facilitated with technology to
consider pedestrians crossing safely, and congestion to be taken into account.
Congestion on the two roads is also monitored by a team of traffic police.
Assume the two traffic lights have only two lights, red and green. Red is for
stopping the cars from passing and green in for allowing the cars to pass.

In the normal case without congestion, the each traffic light switches its state
from ON to OFF every 50 seconds (50,000 milliseconds). Represent each
traffic light with 2 LEDs (green and red). If traffic light 1 is green, traffic light
2 is red and vice versa.

When there is congestion, it will be recognized and monitored by the traffic


police. If there is too much congestion on traffic light’s road, the police will
indicate this by sending text serially on the serial monitor, along with the time
the congestion was detected. Use the function millis() to measure the time that
has passed until congestion has occurred to represent it on the serial monitor.
When congestion is detected, the traffic light with the congested road must
turn green immediately and the other traffic light must turn red. When
congestion occurs again, make sure than the log of all the previous congestion
times is also represented on the serial monitor. Connect 1 LCD to constantly
indicate the status on the traffic lights and the congestion on both roads.

If a pedestrian wants to cross the street of a traffic light that is green, then
he/she must press on a push button to indicate that. Each traffic light will have
CE362: Microprocessor Systems and Interfacing
2
its push button for pedestrians. When pushed, the lights on both traffic lights
are switched from green to red and red to green immediately if more than 25
seconds have passed for the green traffic light. If not, then when 25 seconds
are complete the traffic lights will switch. That reduces the time the
pedestrians have to wait to cross the street.

a) Use the below template to conduct the procedure you will follow for
solving the question. PI6a (Develop and conduct an experimental procedure)

Step 1: List all the variables in your code


Step 2: List all the components in for your circuit
Step 3: Specify the pins use you will use to connect these components on the
Arduino board and their equivalent SAM3X8E port pins in table format.
Step 4: Mention which components are input and which are outputs in a table
format.
Step 5: Specify which Arduino C functions you will use for the different parts of
your code in a table format.
Step 6: After writing your code and building your circuit, list some of the major
syntax errors on Arduino IDE that you have had and what changes you did in
the code to fix it.

b) Given the list of variables and components you have collected from the
question, design a flow chart for the code with all its different scenarios.
Using a table, place the three scenarios of normal mode, congestion mode,
and pedestrian’s requests to cross the street in table explicitly stating all
the changes that occur on the circuit including the serial monitor. PI6b
(Analyze and interpret data collected from the experiment.)

c) Explain how this code can benefit the community and mention how you
think we can expand this project to further benefit environmental and

CE362: Microprocessor Systems and Interfacing


3
economic factors. PI6c (Use engineering judgment to draw conclusions about
the outcomes of an experiment)

d) Design a code in C on Arduino IDE to be downloaded onto the


AT91SAM3X8E microcontroller found on the Arduino Due board.

e) Design the circuit of this code using the following website:


https://www.circuitlab.com/editor/#?id=79e485.

CE362: Microprocessor Systems and Interfacing


4

You might also like