Final Report

Brief description:  I am going to design a smart traffic lights system to help the passengers and cars to save time.  The traffic light system will change to a new mode when there are few traffic. When operating this new mode, all the traffic lights will become green.  The traffic lights will change when there are traffics in specific cases.  For instance, if there is a car moving from north to south and a car moving from east to west, one of the lights will become red until the first car cross the road.  I am planning to build this system in night version first by using light sensors.  I will setup a  coordinate system to help me.  The vertical axis (y-axis) will be the road from north to south and the horizontal axis (x-axis) will be the road from east to west.  (As shown below)

The eight sensors are set on the places denoted by the stars.The blue sensors will measure the cars moving horizontally and the green sensors will measure the cars moving vertically.  All the sensors denoted by A will check if there is any cars coming towards the crossroad.  All the sensors denoted by B will check if the cars have left the crossroad.  The red arrow shows the direction of the cars' movement.  First, this system will test if the amount of traffic is heavy by collecting the data from all the sensors denoted by B.  If the intensity of lights exceeds a specific value, the system will become the normal mode.(The traffic lights will switch within a fixed time period).  Otherwise, the system will switch to the smart mode.  Then I will collect two sets of data (NS and EW)  Each set will have three elements.  NS[0], NS[1],NW[2],EW[0],EW[1] and EW[2] are set to be zero at the beginning. When a car passes the sensor A3, NS[0] will increase by 1.  When a car passes the sensor B3, NS[0] will decrease by 1.  Similarly, the data collected from A4 and B4 will be used to calculate NS[1].  NS[2] will be the sum of NS[0] and NS[1].  For the second set of data, I will do the same work. (A1 and B1 for EW[0], A2 and B2 for EW[1]).  Also, I will define a new variable called TRAFFIC.  TRAFFIC equals the sum of EW[2] and NS[2]. Whenever TRAFFIC is less than a defined value, the system will switch to the new mode.

In the new mode, there will be two conditions.  When one of EW[2] and NS[2] are zero, all the lights will be green.  Otherwise, one of the lights will be red until the cars in another direction leave the crossroad.

 

 

Week 5

I plan for my project as shown above.

Week 6

This week, I try to provide more detail information about my project. I am planning to make a finite states machine.

Week 7

Today, I begin to write the code (in C) for my system.

Week 8

This week, I am trying to learn the code of Arduino and translate my C code into this new code.

Week 9

This week, I complete the code for my system.

Week 10

This week, I make a plan about how to build my circuit. I plan to use LED as my traffic lights.

Week 11

This week, I begin to build my circuit.

Week 12

This week, I finish building my circuit and I begin to debug.

Week 13

This week, I finish debugging and the system works very well. 

Attachments:

Untitled.png (image/png)
lecture_19.pdf (application/pdf)
Untitled.png (image/png)
ECE110 Honor_QIHAO_WANG.pdf (application/pdf)

Comments:

This is an interesting idea, I would suggest you do some research on Finite State Machines because you will likely be using one to implement your project. 

Posted by nrenner2 at Sep 23, 2015 18:30

I think this is a worthy project, too many times we get stuck at a traffic light when no other cars are around! We worked out a similar problem in ECE 120 using Finite State Machines, I have some examples that we can look through in class. I have also attached the lecture notes on FSMs.   lecture_19.pdf

Posted by rlziegl2 at Sep 24, 2015 09:24