Question: You will design this system using KL25Z as the microcontroller to control the above operation. Write a C program that allows a KL25Z to read

You will design this system using KL25Z as the microcontroller to control the above operation. Write a C program that allows a KL25Z to read the values from all sensors and to control the status of the traffic lights and pedestrian crossing. Initially, the traffic light is on green, and the pedestrian crossing is on red.

An automated traffic light system, which follows the UK standard traffic light sequence (Red Red and Amber Green Amber Red), is being used to control flow of traffic along a road. There is a pedestrian crossing at this traffic light. The pedestrian crossing uses an image recognition sensor (S1) to count the number of people present, before changing the light sequence to allow the pedestrians to cross. There is a red LED and green LED on the pedestrian crossing, instructing pedestrians whether it is safe to cross. There is also a sensor which counts the number of cars present (S2). The count is checked every 5 seconds. If more people are waiting to cross the road (sensor S1) than cars have been counted (S2) then the lights will stop traffic and the crossing will allow 20 seconds for pedestrians to cross. The maximum time pedestrians will have to wait after the first person is detected 60 seconds, independent of the number of people waiting to cross. Each of the two sensors is simulated using a 4-bit digital input to the microcontroller, the value of the inputs representing the number of cars or pedestrians counted. There is also a fault sensor (S3), which checks the pedestrian crossing and car sensors and, if a fault is detected, then the red pedestrian crossing light and amber traffic light should both flash to warn drivers and pedestrians of an issue with the crossing.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!