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

Similar documents
Traffic Light Controller

The Nexys 4 Number Cruncher. Electrical and Computer Engineering Department

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

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

Laboratory Exercise 7

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

Fixed-Point Calculator

Experiment # 12. Traffic Light Controller

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

The Calculative Calculator

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

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

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

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

Laboratory Exercise 7

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

Digital Electronics II 2016 Imperial College London Page 1 of 8

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

Digital Fundamentals: A Systems Approach

COMPUTER ENGINEERING PROGRAM

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

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

Step 1 - shaft decoder to generate clockwise/anticlockwise signals

Design and analysis of microcontroller system using AMBA- Lite bus

Modeling Latches and Flip-flops

Lab 4: Hex Calculator

Modeling Latches and Flip-flops

Chapter 11 State Machine Design

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

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Microprocessor Design

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

Asynchronous (Ripple) Counters

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

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

Synchronous sequential circuits

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

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

EE 101 Lab 7 Crosswalk

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

Lab 17: Building a 4-Digit 7-Segment LED Decoder

Experiment (6) 2- to 4 Decoder. Figure 8.1 Block Diagram of 2-to-4 Decoder 0 X X

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

Task 4_B. Decoder for DCF-77 Radio Clock Receiver

ASYNCHRONOUS COUNTER CIRCUITS

Digital Systems Laboratory 1 IE5 / WS 2001

ELEC 204 Digital System Design LABORATORY MANUAL

Counter dan Register

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

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

LESSON PLAN. Sub Code: EE2255 Sub Name: DIGITAL LOGIC CIRCUITS Unit: I Branch: EEE Semester: IV

Register Transfer Level in Verilog: Part II

Chapter 3: Sequential Logic Systems

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

1. Synopsis: 2. Description of the Circuit:

Dr. Shahram Shirani COE2DI4 Midterm Test #2 Nov 19, 2008

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

Synchronous Sequential Logic

EE 209 Lab 7 A Walk-Off


Contents Circuits... 1

Sequential Circuit Design: Principle

Difference with latch: output changes on (not after) falling clock edge

Lab #10: Building Output Ports with the 6811

Elwin Cabrera May 11, 2016 DIGITAL CLOCK. ECE271/CSC222 Final Project Report

University of Pennsylvania Department of Electrical and Systems Engineering. Digital Design Laboratory. Lab8 Calculator

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

Logic Design Viva Question Bank Compiled By Channveer Patil

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

EEM Digital Systems II

Scanned by CamScanner

Lecture 11: Synchronous Sequential Logic

CHAPTER1: Digital Logic Circuits

Logic Design. Flip Flops, Registers and Counters

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

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 220. Experiment 4 - Latches and Flip-Flops

Chapter Contents. Appendix A: Digital Logic. Some Definitions

Figure 1: Feature Vector Sequence Generator block diagram.

Application Note. Traffic Signal Controller AN-CM-231

Lab 13: FPGA Circuit Realization Ian Callahan

CprE 281: Digital Logic

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

Lab #6: Combinational Circuits Design

Decade Counters Mod-5 counter: Decade Counter:

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.

Department of CSIT. Class: B.SC Semester: II Year: 2013 Paper Title: Introduction to logics of Computer Max Marks: 30

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

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Inside Digital Design Accompany Lab Manual

Individual Project Report

MODULE 3. Combinational & Sequential logic

CS3350B Computer Architecture Winter 2015

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

CPS311 Lecture: Sequential Circuits

Digilent Nexys-3 Cellular RAM Controller Reference Design Overview

cs281: Introduction to Computer Systems Lab07 - Sequential Circuits II: Ant Brain

CprE 281: Digital Logic

Chapter 5: Synchronous Sequential Logic

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems

Transcription:

Traffic Light Controller Variable Cycle Time Design Thomas Quinn, Brandon Londo, Alexander C. Vincent, Yezan Hussein Electrical and Computer Engineering Department School of Engineering and Computer Science Oakland University, Rochester, MI tquinn@oakland.edu, vincent@oakland.edu, bjlondo@oakland.edu, yhussein@oakland.edu Abstract This project involves an FPGA based traffic light controller with user selected green light cycles. The state of the two lights outputs to two RGB LEDs, while the cycle times appear on the seven-segment display. O I.) Introduction The safety of all drivers on the road hinges upon a proper control of traffic flow. Allowing opposing directions of traffic, the right of way could result in fatal consequences. Our design simulates a traffic light controller that operates in both a safe and convenient fashion. It emulates the behavior of four traffic lights dictating automobile flow in opposing directions. The state of each light displays via the RGB LEDs on a Nexys4DDR board. Sometimes, the flow of traffic in one direction is much heavier than in the opposing direction. It is appropriate to allow the heavier traffic to receive a green light for a longer time. To do this, the design features four cycle times which the user can select via switches. The current cycle time appears on the seven-segment display, allowing the user to confirm their selection. II.) Methodology All licensed drivers in the United States know the various states of a traffic light. The main task behind this project is manipulating the time between these state transitions. First, the team considered the size of the counters necessary for the design. The necessary counts are 1sec, 3sec, 15sec, 30sec, 45sec, and 60sec. One 15sec counter suffices to achieve the 15-60 second counts. This counter controls a Finite State Machine (FSM_Count) that outputs a signal at each of the 15 second increments. It does this by transitioning states each time the 15 second counter goes high. The FSM_Count outputs filter through two multiplexers, one for each direction of traffic (North/South and East/West). Figure 1: FSM Count FSM1 is the hub of the program. It dictates the state of the lights and counters. Each state outputs the proper RGB code as well as enables and clears the necessary counters. The process in which this is done can be seen in the ASM below.

Figure 2: FSM_1 The signals associated with the 1 second counter end in Bl. It is cleared with sclrbl and enabled with EBl. Zbl is used to toggle between states one and two. These states represent the blinking red lights of Night mode, where a four-way stop is appropriate. Day and Night modes are controlled by the user through a switch on the board. States 3-8 represent Day mode. It is important to note that the condition of the day/night switch is only checked in states one and two. This prevents a user from flipping the switch in the middle of day cycle operation, as it would be unfortunate for a green light to go directly to blinking red. Similarly, the signals associated with the three second counter all end in Y. The output Zy dictates the transition out of states where one of the lights is yellow, or both are red. The outputs ZEW and ZNS control the transitions out of green light states for their respective directions. Both signals are outputs from one of the two multiplexers. Sitting at the inputs of both multiplexers are the Z15, Z30, Z45, and Z60 signals coming from FSM_Count. Thus, by adjusting the select line of each multiplexer, the user can select which of these four signals will dictate the transition out of the respective green state. The 7 segment displays output the green light cycle time for each direction. Since the cathodes of all the displays are tied together, only one pattern can appear at a time on any given display. Thus, to make different outputs seemingly appear on four displays at the same time, the anodes and outputs must be serialized. This involves turning each display individually at a rate which

appears constantly on to the human eye. Figure 3 pictures the FSM that achieves this operation. with SW2 select B <= "0001" when "00", "0011" when "01", "0100" when "10", "0110" when others; with SW2 select A <= "0101" when "00", "0000" when "01", "0101" when "10", "0000" when others; By multiplexing the outputs and anodes of each display at a rate of 1ms, all four appear to be on simultaneously, With these operations the team was able to implement a functioning traffic light controller. III.) Experimental Setup The setup used to verify the functioning of the traffic light controller is as follows: Once the board (NEXYS 4 DDR) is programmed, the traffic light controller is tested by visual inspection. An external timepiece verifies that the displayed cycle times are accurate. For example if the user input was SW0= 1, AdrEW= 10, and AdrNS= 01 it is expected that seven segment display AN(0) is 5, AN(1) to be 4, AN(4) to be 0, and AN(5) to be 3. The cycle begins with both lights red, after three seconds the leftmost LED (led17) will transition to a green light. The green light will be on for 30 seconds. It then transitions yellow for 3 seconds. Then both LEDs are red for 3 seconds. Next the rightmost LED (led16) is green for 45 seconds. It then changes to yellow for three seconds. The cycle repeats while SW0= 1. A test bench is also created to ensure each signal propagates when intended. The software used to implement this design is Xilinx Vivado 2017.2. Figure 3: Serializer FSM This FSM uses AdrNS and AdrEW as case statements to select the appropriate input to the BCD-7seg decoder. As shown below, the appropriate numbers for each display are hard coded to match the state of the select line switches. with SW1 select D <= "0001" when "00", "0011" when "01", "0100" when "10", "0110" when others; with SW1 select C <= "0101" when "00", "0000" when "01", "0101" when "10", "0000" when others; Figure 4: Nexus DDR Board

IV.) Results V.) Conclusions The timepiece revealed an error in cycle times above 15 seconds. This error would propagate through the program the longer it ran. At first, the 30 second increment would take 37 seconds, the next time around, it would take 47. Stepping through a behavioral simulation lead to the solution. The FSM_Count simply needed to be synchronously cleared. After this addition, the cycle times worked perfectly. Upon completion of the top-level code a top-level diagram was drawn. This program provides all the intended functions and features. The design process highlighted the usefulness of finite state machines in digital design. The switches and hex displays offer a nice level of user friendliness. Further versions of this project might include additional states for left-turn signals, and the ability to respond to crosswalk signals from pedestrians. VI.) References [1]. Workshop: Digital Circuit Design with VHDL. Web. 12 Nov. 2011. http://www.secs.oakland.edu/~llamocca/index.html Figure 5: Top Level Design of Traffic Light Controller