Traffic Light Controller

Similar documents
Smart Night Light. Figure 1: The state diagram for the FSM of the ALS.

Traffic Light Controller. Thomas Quinn, Brandon Londo, Alexander C. Vincent, Yezan Hussein

Vending Machine. Keywords FSM, Vending Machine, FPGA, VHDL

Tic-Tac-Toe Using VGA Output Alexander Ivanovic, Shane Mahaffy, Johnathan Hannosh, Luca Wagner

Faculty of Electrical & Electronics Engineering BEE3233 Electronics System Design. Laboratory 3: Finite State Machine (FSM)

Fixed-Point Calculator

EEM Digital Systems II

Experiment # 12. Traffic Light Controller

Chapter 11 State Machine Design

The Nexys 4 Number Cruncher. Electrical and Computer Engineering Department

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

The Calculative Calculator

Modeling Latches and Flip-flops

Laboratory Exercise 7

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

You will be first asked to demonstrate regular operation with default values. You will be asked to reprogram your time values and continue operation

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems

Microprocessor Design

CPS311 Lecture: Sequential Circuits

Lab 5 FPGA Design Flow Based on Aldec Active-HDL. Fast Reflex Game.

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

Laboratory Exercise 7

Modeling Latches and Flip-flops

Programmable Logic Design I

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

COMPUTER ENGINEERING PROGRAM

Contents Circuits... 1

Last time, we saw how latches can be used as memory in a circuit

Design and implementation (in VHDL) of a VGA Display and Light Sensor to run on the Nexys4DDR board Report and Signoff due Week 6 (October 4)

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

Figure 1 Block diagram of a 4-bit binary counter

Tutorial 11 ChipscopePro, ISE 10.1 and Xilinx Simulator on the Digilent Spartan-3E board

Sequential Circuit Design: Principle

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

Lecture 11: Synchronous Sequential Logic

Design of a Binary Number Lock (using schematic entry method) 1. Synopsis: 2. Description of the Circuit:

ENGG2410: Digital Design Lab 5: Modular Designs and Hierarchy Using VHDL

Lab #10 Hexadecimal-to-Seven-Segment Decoder, 4-bit Adder-Subtractor and Shift Register. Fall 2017

1. Convert the decimal number to binary, octal, and hexadecimal.

Side Street. Traffic Sensor. Main Street. Walk Button. Traffic Lights

VHDL Design and Implementation of FPGA Based Logic Analyzer: Work in Progress

Electrical and Telecommunications Engineering Technology_TCET3122/TC520. NEW YORK CITY COLLEGE OF TECHNOLOGY The City University of New York

Serial FIR Filter. A Brief Study in DSP. ECE448 Spring 2011 Tuesday Section 15 points 3/8/2011 GEORGE MASON UNIVERSITY.

PLTW Engineering Digital Electronics Course Outline

CS8803: Advanced Digital Design for Embedded Hardware

Digital Electronics Course Outline

VARIABLE FREQUENCY CLOCKING HARDWARE

Digilent Nexys-3 Cellular RAM Controller Reference Design Overview

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

DE2-115/FGPA README. 1. Running the DE2-115 for basic operation. 2. The code/project files. Project Files

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

ECSE-323 Digital System Design. Datapath/Controller Lecture #1

1. Synopsis: 2. Description of the Circuit:

Rensselaer Polytechnic Institute Computer Hardware Design ECSE Report. Lab Three Xilinx Richards Controller and Logic Analyzer Laboratory

CSCB58 - Lab 4. Prelab /3 Part I (in-lab) /1 Part II (in-lab) /1 Part III (in-lab) /2 TOTAL /8

Logic Design. Flip Flops, Registers and Counters

ECE532 Digital System Design Title: Stereoscopic Depth Detection Using Two Cameras. Final Design Report

UNIVERSITY OF TORONTO JOÃO MARCUS RAMOS BACALHAU GUSTAVO MAIA FERREIRA HEYANG WANG ECE532 FINAL DESIGN REPORT HOLE IN THE WALL

CS61C : Machine Structures

Final Exam review: chapter 4 and 5. Supplement 3 and 4

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

CHAPTER 4: Logic Circuits

FSM Implementations. TIE Logic Synthesis Arto Perttula Tampere University of Technology Fall Output. Input. Next. State.

Design and Implementation of Timer, GPIO, and 7-segment Peripherals

Unit 11. Latches and Flip-Flops

Digital (5hz to 500 Khz) Frequency-Meter

Ryerson University Department of Electrical and Computer Engineering COE/BME 328 Digital Systems

EE 101 Lab 7 Crosswalk

Digital Systems Laboratory 1 IE5 / WS 2001

CARLETON UNIVERSITY. Facts without theory is trivia. Theory without facts is bull 2607-LRB

Review : 2 Release Date : 2019 Last Amendment : 2013 Course Code : SKEE 2742 Procedure Number : PK-UTM-FKE-(0)-10

EECS145M 2000 Midterm #1 Page 1 Derenzo

1. What does the signal for a static-zero hazard look like?

Risk Risk Title Severity (1-10) Probability (0-100%) I FPGA Area II Timing III Input Distortion IV Synchronization 9 60

FPGA Implementation of Convolutional Encoder And Hard Decision Viterbi Decoder

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

ELCT201: DIGITAL LOGIC DESIGN

Flip-flop and Registers

Computer Systems Architecture

Laboratory 4. Figure 1: Serdes Transceiver

Optimized design for controlling LED display matrix by an FPGA board

CS3350B Computer Architecture Winter 2015

Logic. Andrew Mark Allen March 4, 2012

Step 1 - shaft decoder to generate clockwise/anticlockwise signals

Registers and Counters

Previous Lecture Sequential Circuits. Slide Summary of contents covered in this lecture. (Refer Slide Time: 01:55)

Individual Project Report

TSIU03, SYSTEM DESIGN. How to Describe a HW Circuit

Debugging of VHDL Hardware Designs on Altera s DE2 Boards

EET 1131 Lab #12 - Page 1 Revised 8/10/2018

Lab 4: Hex Calculator

Figure 1: Feature Vector Sequence Generator block diagram.

Bell. Program of Study. Accelerated Digital Electronics. Dave Bell TJHSST

Testing Results for a Video Poker System on a Chip

ECE 263 Digital Systems, Fall 2015

CPE 200L LABORATORY 3: SEQUENTIAL LOGIC CIRCUITS UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND: SR FLIP-FLOP/LATCH

Transcription:

Traffic Light Controller Four Way Intersection Traffic Light System Fall-2017 James Todd, Thierno Barry, Andrew Tamer, Gurashish Grewal Electrical and Computer Engineering Department School of Engineering and Computer Science Oakland University, Rochester, MI e-mails: jdtodd@oakland.edu, thbarry@oakland.edu, tamer@oakland.edu, gsgrewal@oakland.edu Abstract The main purpose of building our traffic light control is to gain more understanding of the implementation of a modern digital system. We designed a four way traffic signal for a an intersection. We used VHDL to write the code that modeled the traffic system, and then used a finite state machine and accessory components to control the behavior of the system. I. INTRODUCTION For the final project we created a traffic light system utilizing with four different LED colors on the two tri-color LED s and a Seven Segment display both mounted on the Artix-7 board. This report covers our plan behind the design of our traffic light system, as well as how we completed and implemented the structure of the design. The idea behind this project was to create a traffic light with three different modes for a four-way intersection. The three different modes include a daytime mode, night mode, and emergency mode. Because the yellow light displayed by the tri-color LED wasn t aesthetically distinctive, we included a color changing switch that would change the yellow LED to a blue LED because of the contrast. A. Overview II. METHODOLOGY The traffic light system is divided into four main sections, the top file, the clock divider, the tri-color LED file, and the Seven-Segment display file. In our simulation the traffic flowing east/west and north/south have identical signals and therefore only two tri-color LED s are needed to represent the intersection. The program includes three modes, the day mode, the night mode and the emergency mode. Daytime mode is the default mode. Switches will be used to control the other modes. The seven-segment display and two tri-color LEDs on FPGA will display the color of the signal depending on the state of the system, which is controlled by the FSM. B. Top File The top file is used only to connect the inputs of the device to the various components and then connect those components to the outputs of the board. C. FSM The FSM is the controller of the system. It uses the clock and switches as inputs and progresses through the state of the system as follows. The FSM operates in daytime mode normally. If emergency mode is activated and one of the lights is green, the systems will skip to yellow and progress to red as normal. Once both lights are red, the FSM will continue to display red lights in both directions until emergency mode is turned off. Emergency mode is supposed to represent a signal sent from an emergency vehicle such like an Ambulance or Fire Engine. This can be used so that an emergency vehicle can progress through the light with a lower chance of a traffic incident. Since there are only eight states in the FSM the outputs can be represented by three bits. These three bits are sent to both the LED file and SevSeg file. A detailed stated diagram is listed in the Appendix. i) In daytime mode, the system will cycle through the states as shown in the figure below. The times indicated on the figure were chosen for display purposes. The time in each state could be easily edited by changing an integer value, which represents the number of seconds in each state.

Figure 1: State diagram of the traffic signal. ii) Emergency Mode- When the emergency switch is turned on the system will skip from green to yellow and progress normally to red/red. Once red/red is displayed by the FSM, the system will stay in that state until the Emergency mode switch is turned off. Since there are two states that represent red/red, the system has a small amount of memory and will fairly allow the next set of vehicles to progress through the intersection on their turn. iii) Night time Mode- When the Night time mode switch is turned on the system will wait for a red/red signal, a yellow light will blink in the east/west direction, while a red light will blink in the north/south direction. These lights will alternate. D. Tri-Color LED The LED file receives a three-bit input unique to the present state controlled by the top file. Based upon the present state, the LEDs will display the appropriate color. One LED will represent the north/south signal, and the other LED will represent the east west signal. The LEDs change instantly depending on the state of the system which is controlled by the FSM. As the state changes, the color of the LEDs changes accordingly and will display the East/West signal on the left LED and the North/South signal on the right LED. Depending on which mode the program is in, the LEDS will turn on and off accordingly. For demonstration purposes, a blue LED acts as the yellow light of the traffic light. If the color change switch is flipped, the blue LED will change to yellow, and behave as it did before. E. Seven Segment Display The seven-segment file receives input signal identical as the LED file, along with a slowed 1000 Hz clock signal produced by the clock divider. Instead of using the serializer provided, we decided to make our own display that uses two processes running at the same time. One controls the states used to move between the different displays on the sevensegment in order to display different letters on the Seven segment, whereas, the other process controls the signal outputting on the seven segment display. As the each state changes, the condition (S0-S6 from the Top file) is checked and as per the condition the process loops and displays the condition on Seven Segment accordingly. For example, if the condition is Red-Red, 000 will be selected and states will change at each clock input with a different anode and output displaying all the letters on different segments one at a time, but at such a rate that the human eye sees it as a single display. F. Clock Divider The clock divider uses the 100 MHz clock provided by the chip, and gives two outputs. Once the 100 MHz clock has given a high signal 100,000,000 times, the clock divider will output a Z signal for 10 ns, then will synchronously clear the counter and start the system back at 0. The FSM uses this as a 1 second signal to count the elapsed time in each state. The other signal is similar to the first, except it sends a 10kHz signal to the SevSeg file in to be used as the clock. The signal needed to be fast enough to cycle through the SevSeg displays and remain imperceptible to humans, yet if the signal was too fast, the SevSeg display wouldn t be able to display properly. G. Alternate Approach Instead of using the state of the system to control the outputs, the system could be controlled using the same 1 second counter and a second counter whose output would control the displays. This method would be harder to edit, as any change in timing would drastically change the circuit. A new design would be needed to change the length of time in any of the states. If the same counts were used a table and Karnaugh maps could be created. As an example, the following table and resulting Boolean equations could be created. Figure 2: Table created to map each second of a 28 second counter to the output of 6 LEDs.

From this table a Karnaugh map (K-map) could be created for each LED. A K-map and following Boolean equation was created to demonstrate the process of this approach. Figure 3: Karnaugh map used to derive sum of products equation for the Red North/South LED The following boolean equation can be derived using sum of products, and boolean algebra to reduce the equation to its simplest terms. This method was not chosen due to the lack of flexibility. III. EXPERIMENTAL SETUP After completing the Top file with port mapping, a test bench was created with two inputs being passed onto the Top file. Our test bench was simple with clock and resetn being the two inputs. Xilinx Vivado version 2016.2 was used to simulate and implement the code. Testbench is a simple way to verify the working of the code but looking at the post timing simulation. The code used for the Testbench displayed below. After completing the constraint file and writing the bitstream, the code was then uploaded to the NEXYS 4 DDR board. Our group did not use any outside hardware tools, except only the switches, seven segment display, LEDs and the buttons on the board. We expect the LEDs and seven segment display to behave according to which mode the traffic signal is operating. If the reset button is pressed the system should reset both LEDs to red, and the seven segment displays will say red-red. IV. RESULTS After attempting the first approach using Karnaugh maps, the FSM approach proved to be the most logical and efficient way to control the outputs. The FSM code along with the other components of the project cycle through correctly, leading to the LED and seven segment display behaving as intended. Depending on which of the three switches are high, the traffic light system operates in the desired mode. The normal/day time mode works properly following the state diagram, the emergency mode works properly turning the lights red accordingly, and the night mode makes the lights blink red and yellow on each side respectively. Through different trials and testing, the traffic light does match our final intentions for the traffic light controller as intended during the time of design. V. Conclusion Through the use of a clock divider, a finite state machine, seven segment display, and LEDs, we were able to create a four way intersection traffic light system. At first, this project was very challenging as we tried to use K maps to come up with the equations that we were suppose to use. However, when we learned in class how to make state diagrams, the project became easier. Improvements that could be made to the design include adding sensors that could detect the number of cars that are on each line to be able to control the traffic better. Also, we could have use pulse width modulation to improve the color of the yellow light. When displayed, it looked too green.

References 1. Llamocca, Daniel. VHDL Coding for FPGAs, www.secs.oakland.edu/~llamocca/vhdlforfp GAs.html

Appendix: