Design and simulation results of traffic light controller based on VHDL language

Publisher:静心静气Latest update time:2010-06-30 Source: 嵌入式公社Keywords:VHDL Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

By using VHDL language to design digital systems, most of the design work can be completed on the computer, thus shortening the system development time and improving work efficiency. The following introduces a scheme for designing a traffic light controller based on VHDL, and gives the source program and simulation results.

1 System Functions and Requirements

The traffic light controller controls the traffic at the intersection of two main roads. There are many vehicles at the intersection. The straight-ahead signal and the left-turn signal are displayed separately. The travel time of the two main roads a and b is equal. The green light indicating straight-ahead is on for 30 seconds, and the green light indicating left-turn is on for 12 seconds. When the green light turns to red, the yellow light is on for 3 seconds so that the vehicle can stop within the stop line. The corresponding yellow light is also on for the last 3 seconds of the red light signal to remind the driver to prepare to start. Sensors are equipped at the intersection of the two main roads to detect whether there are vehicles passing. When there are vehicles on both main roads, the main road a is automatically in the state of green light and main road b is red light, and then the traffic is switched in turn. When there are no vehicles on main road a, the main road b is automatically in the state of green light and main road a is red light; vice versa, to improve traffic efficiency.

2 Design and Simulation

According to the functions and requirements of the traffic light controller, its overall circuit is divided into two modules: frequency divider and signal controller. The frequency of the external pulse oscillator is selected as 32 768 kHz, and the frequency divider is used to divide the signal into 1 Hz signals. The 1 Hz signal is used as the counting pulse of the signal controller. The frequency divider and signal controller modules of the traffic light controller are designed with VHDL. On the QuartusⅡ development platform, the VHDL programs of the two modules are compiled separately, and then the schematic input method is used to form the overall block diagram shown in Figure 1.

Overall block diagram formed by schematic input method

The VHDL program of the signal controller is as follows:

program

program [page]

program

Among them, Sa, Sb are the signals of the sensors at the intersections a and b respectively; aR, aY, aG, aLR, aLY, aLG represent the signals for controlling the straight red light, yellow light, green light, and left turn red light, yellow light, and green light of the main road a respectively; bR, bY, bG, bLR, bLY, bLG represent the signals for controlling the straight red light, yellow light, green light, and left turn red light, yellow light, and green light of the main road b respectively; aPR, aPG, bPR, bPG are pedestrian signals, and enl is the enable signal. When enl=0, the red lights at the intersections a and b are on at the same time, which is convenient for handling special situations. The program is compiled and simulated using QuartusⅡ, and the simulation waveform obtained is shown in Figure 2. After program download and experimental verification, the system function meets the requirements.

Simulation waveform

The traffic light controller is designed based on VHDL, which has fewer peripheral circuits, low power consumption, high reliability, easy modification of system functions and high design efficiency.

Keywords:VHDL Reference address:Design and simulation results of traffic light controller based on VHDL language

Previous article:Cost-effective AC induction motor slip control optimization solution
Next article:Embedded code stream analysis design based on FPGA and RTOS

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号