Professional Documents
Culture Documents
Final Report
Submitted By:
Team 6
“The first four-way, three-color traffic light was created by police officer
had in mind was figuring out a way to adapt railroad signals for street use. Potts
used red, amber, and green railroad lights and about thirty-seven dollars worth of
wire and electrical controls to make the world’s first 4-way three color traffic light.
Detroit. Within a year, Detroit had installed a total of fifteen of the new automatic
lights.
Easy and Main Streets have raised issues in the community of Gastonia
regarding efficiency and safety. The community has stated that it needs an
intersection traffic light system that allows normal traffic to proceed safely
throughout the day. At night, traffic volume through this area is substantially less
than during the day. Therefore, the community has proposed that a design be
made to normally allow Main Street traffic to proceed while only allowing Easy
addressed by using sensors that can activate/deactivate the traffic signal when a
clock cycle, the ATmega128 achieves throughputs approaching 1 MIPS per MHz
speed. The AVR core combines instruction set with 32 general purpose working
Lab 7-Team 4
Final Report
3
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit
instruction executed in one clock cycle. The resulting architecture is more code
nonvolatile memory technology. The boot program can use any interface to
http://www.atmel.com/dyn/products/product_card.asp?part_id=2018 , by Atmel
AVR Products, provides multiple PDF files for uses of the ATMega 128
The authors show keys points of programming for the microcontroller chip.
was created in order to demonstrate the method that was used throughout the
The first step of the experiment was to integrate the project objectives
simulated traffic light has two operational modes; daytime and nighttime.
The daytime mode will follow a strict, reoccurring pattern that will allow
incident. Nighttime mode will streamline the traffic light function, using
sensors that detect vehicles and change the light to allow for continuation.
representing the four major points of direction. There will be three lights:
red, green, and yellow. There will also be a 5 second delay between one
light switching on and one switching off. The assigned specifications are
containing an ATmega 328, AVR Joint Test Action Group (JTAG) USB
night and day, a photodiode circuit was created. A Radio Shack Cadmium
Sulphide (CdS) photo cell was decided upon to be used by the team. Port
7 was designated on the AT Mega 328 that ran from the photodiode circuit
that would trigger nighttime mode. It must be noted that daytime mode
op amp was used. In addition to the 741 op amp, #!@ resistors were used
Eq. 4-1
nighttime voltage. Using Eq. 4-1, the nighttime voltage was found to be
4.7V while the normal or daytime voltage was also found to be 4.7V.
Eq.4-2
Eq. 4-2, the nighttime base current needed was found to be 1.5 nA while
The collector voltage was found by measuring the voltage over the
309 mV.
Eq. 4-3
and Rd was a decided upon resistance due to resistors the team had on
hand. Using Eq. 4-3, the nighttime collector current needed was found to
4.897 mA.
Eq. 4-4
where is Beta or the current gain. Using Eq. 4-4, the nighttime Beta
needed was found to be 206 and the daytime Beta needed was found to
be 68.
Eq. 4-5
When the nighttime and daytime currents obtained from using Eq. 4-3 and
using Eq. 4-5, the collector voltage VC for daytime mode was 4.897 V for a
Lab 7-Team 4
Final Report
8
logical 1. The logical 1 would be used in the C program for normal
found to be 309 mV using the collector current IC from Eq. 4-3 and Eq. 4-5.
The collector voltage VC for nighttime mode was 309 mV for a logical 0
The next step in the experimental method was for the team to decide
for the project. The CodeVision AVR C compiler was decided to be used
due to overall AVR JTAG USB adapter compatibility with the software.
3 and 4.
Lines 15 and 16 in Figure 3 demonstrate the two Amtel AVR header files
that were used to access the libraries used throughout the program. The
The program used was a basic “while” loop (Figure 3, line 22), with an
additional “if” statement (Figure 4, line 55) was added to the program in
order to activate the car sensor that enabled Easy Street’s green light to
be activated at night.
Lab 7-Team 4
Final Report
9
and 4, the program was loaded onto the AT Mega 328 circuit board. First, the
daytime mode was tested in lab and the results were entered into Table 1 on
page 11.
Lab 7-Team 4
Final Report
11
Table I demonstrates the sucessful operation of the circuit and the program by
indicating what LED’s are on or off during the experimental procedure. For
example, when the green LED for Main Street was on, Easy Street’s red LED
was on, and vice versa. There is also a delay before either streets green LED’s
turn on, during which the red LED’s for Main and Easy streets remain on for five
seconds. The program was tested with small LED’s in the laboratory and with a
simulated traffic intersection model. Results of the LED’s were the same for both
tests and and are shown in the Daytime Light Status Table shown above.
Next, nighttime mode was tested. This was done with small LED’s in the
laboratory and with a simulated traffic intersection model. Table II was filled out
with results from the tests in the laboratory on the simulated traffic intersection
Lab 7-Team 4
Final Report
12
model and results for both tests were the same. A magnet was placed over a
seconds later, Main Street’s LED went from green to yellow to red, then Easy
Street’s LED turned green. One function was missing from the program that was
stated in the requirements, but was not detected until project presentation. Easy
Street’s LED was supposed to remain green until a vehicle was detected at Main
Street. Next, Easy Street’s LED was supposed to turn from green to red to
yellow and Main Street’s LED was supposed to turn green. This mistake was
due to lack of clarity during the teams assessment of the project’s requirements.
V. Conclusion
Main and Easy streets, traffic is now flowing better at Easy and Main streets.
Lab 7-Team 4
Final Report
13
The traffic light project went as planned and was completed on time and
product costs were within reasonable limits. With the project complete,
looking back the team could have finished earlier than expected which could
Within the programming design itself, a minor mistake was made in the
program for the traffic light. At an instant, both streets are “red” at the same
time. This was an added step by the team that was thought to be a safety
design to allow cars an interval time between lights incase other cars decide
to “run a light”. This added step was not in the scope handed to the team by
Dr. Sherlock and should have been addressed before inserting the added
http://www.atmel.com/dyn/products/product_card.asp?part_id=2018
http://dubel.org/atmel/
http://www.coe.uncc.edu/~sherlock/etee3255/index.html
VII. Bibliography
Lab 7-Team 4
Final Report
15
VIII. Appendices
Lab 7-Team 4
Final Report
16