Share this

Design of a Programmable Traffic Control System Based on Novel Rules

2026-04-06 08:17:55 · · #1
This system consists of a microcontroller system, a keyboard, an LCD display, and a traffic light demonstration system. The system includes pedestrian crossing, left turn, right turn, and basic traffic light functions. In addition to basic traffic light functions, the system also features countdown, time setting, emergency handling, voice prompts, LCD information display, time-segmented adjustment of signal light illumination time, and manual control based on specific situations. I. Scheme Design and Demonstration: 1. Power Supply Scheme: To ensure stable module operation, a reliable power supply is required. We considered two power supply schemes: Scheme 1: Using an independent regulated power supply. The advantages of this scheme are stability and reliability, and various mature circuits are available for selection; the disadvantage is that each module uses an independent power supply, which complicates the system and may affect circuit voltage levels. Scheme 2: Using a microcontroller control module to provide power. The advantages of this scheme are system simplicity and cost savings; the disadvantage is low output power. Therefore, we chose the second scheme. 2. Display Interface Scheme: This system requires the completion of countdown, information prompts, and other functions. Based on the above reasons, we considered three schemes: Scheme 1: Using an LCD display exclusively. This first solution only displays a limited number of symbols and digital characters, which is insufficient to meet the requirements of the problem. Solution 2: Use a dot-matrix LCD display entirely. This solution is complex to implement and requires a significant amount of software work; however, it is powerful and can easily display various English characters, Chinese characters, graphics, etc. Solution 3: Use a combination of LEDs and a dot-matrix LCD. Because the design requires both countdown digital output and Chinese character information prompts and graphic output, to facilitate viewing and consider practical situations, LEDs and LCDs are used to display the time and prompt information respectively. This solution satisfies the system's functional requirements while reducing the complexity of system implementation. Weighing the pros and cons, the third solution complements the advantages and disadvantages of the first two solutions, and we decided to adopt the third solution to achieve the system's display function. 3. Input Solution: The problem requires the system to be able to manually set the light illumination time and handle emergencies. We discussed two solutions: Solution 1: Use an 8155 to expand I/O ports, keyboard, display, etc. The advantages of this solution are: flexible programmability, and the availability of RAM and a counter. If this solution is used, it can provide more I/O ports, but the operation is slightly more complex. Option 2: Use ZLG7289 to control the keyboard and digital tube display. Since 7289 is a serial control method with dedicated command words, it is simple to control and occupies fewer I/O lines. Its circuit diagram is shown in Figure (1). Since the control of traffic lights and LCD can be achieved using only the I/O ports of the microcontroller itself, and its own counter and RAM are sufficient, Option 2 is selected. 4 Traffic light demonstration scheme: Use three-color LEDs soldered on the panel to simulate traffic lights, and use LEDs to spell out small human figures (and flashing)/arrows as pedestrian prompts/left and right turn prompts, which is simple and clear; and the implementation is simple and clear. II. System Design 1 Overall Design ⑴ The overall block diagram of the system is as follows: ⑵ Module description ※ 1 Keyboard control circuit: 2×8 keyboard, controlled by ZLG7289 externally connected to the microcontroller. ※ 2 Microcontroller minimum system: The main controller of the system, used to control the coordinated work of other modules. * 3 LCD Display Module: Displays prompts such as weather and road conditions. The interface circuit is simple and controlled by a microcontroller. * 4 LED Display (Countdown) Module: Controlled by an external ZLG7289 microcontroller, connected to the traffic light demonstration module via a ribbon cable, displays the traffic light countdown time. * 5 Control Interface Circuit: Connects the microcontroller system to the traffic light demonstration module. This circuit includes a 74LS139 (2-to-4 decoder) and a 74LS373 (data latch), ensuring the traffic lights function correctly. * 6 Traffic Light Demonstration Module: Demonstrates the system's operation. This module primarily consists of LEDs. * 7 Voice Prompt Module: Uses a readily available 2532-120 single-segment recording and playback board (capable of recording and repeating playback) to provide voice prompts. (3) Traffic Light Status Descriptions: Traffic lights typically operate in five states: Green light + Pedestrian crossing (S1); Green light + Right turn (S2); Yellow light (S3); Red light + Left turn (S4); Red light (S5). *State Descriptions: (S1) Green light + Pedestrian crossing: Vehicles proceed; pedestrians can cross the pedestrian crossing. (S2) Green light + Right turn: Vehicles can proceed forward and to the right. (S3) Yellow light: Transitional state. (S4) Red light + Left turn: Vehicles proceed to the left; but cannot proceed forward. (S5) Red light: Prohibited from proceeding or turning. Note: Red, yellow, and green are all traffic signal indicators for the direction of travel. Most major intersections in Jinan use this design, except that there are no red lights for left turns or pedestrians. *State diagram: *Truth table: (Note: R, G, Y, L, Rt, M represent red light, green light, yellow light, left turn, right turn, and pedestrian light respectively) This system is also designed for emergency handling; in an emergency, the traffic light state is set as follows: Reserved: North, West, Southeast ※ All red: all directions of the southeast, northwest, and northeast are prohibited. ※ North-South red, East-West green: North-South direction is prohibited; East-West direction is permitted. ※ East-West red, North-South green: East-West direction is prohibited; North-South direction is permitted. 2 Module design: (1). Microcontroller and keyboard control module The microcontroller uses 89C52, which has 8K program memory available. The control of the traffic lights is mainly accomplished by the counter in it. On the one hand, it is necessary to complete the control of each module, and on the other hand, it is also necessary to coordinate the timing and port conflict of each module. The keyboard uses 7289 serial control, and its circuit diagram is shown in Figure (1). A total of 8 buttons are used: number keys 0-9, time setting button, Enter key, emergency control button, mode switching button, manual control button and restore button. The time setting can set the passage time for each direction separately. The set time should conform to the following formula: Tr1=Tg2+Ty2+Tl2+Tl1 Tg1=Tm1+Trt1 Tr2=Tg1+Ty1+Tl1+Tl2 Tg2=Tm2+Trt2 The mode switching function is to switch to the preset passage time mode according to the traffic conditions, or switch back to the original mode. Manual control is to manually control the passage time of each direction, which has flexible characteristics. The restore button returns to the normal state from the emergency state or manual control state. Figure (1) (2). LCD and LED display module The LED is used to implement the countdown function and can be directly connected from the 7289 interface. Its control is relatively simple. The LCD is used to display prompt information and prompt function when setting time. Its circuit diagram is shown in Figure (2). (3). Traffic light demonstration module. Traffic lights are replaced by light-emitting diodes. Since the value of port P2 changes after a period of time, port P2 plus latch and port P3 are used together for control. Its circuit diagram is shown in Figure (3). 3 Software system: ※ Flowchart is shown in the figure . III. Debugging According to the requirements of the scheme design, the debugging process is divided into three parts: hardware debugging, software debugging and hardware-software integration debugging. 1 Hardware debugging: ⑴ Debugging of traffic light demonstration circuit: The traffic light module is composed of multiple light-emitting diodes. The wiring is complicated and easy to make mistakes. After checking that the diodes are fault-free, the wires are not broken, and the wire connectors are not interconnected, a software debugging program can be written first to check whether the indicator lights (light-emitting diodes) in the east, west, south and north directions are lit; if they are not lit, the wiring may be wrong. Check the lights according to the lighting status until the circuit works normally. ⑵ Debugging of countdown circuit: The countdown circuit is mainly composed of digital tubes. After the traffic light program is written, the countdown display can be compared with the two sets of digital tubes on the minimum system board (these two sets of digital tubes on the system board are used to check the countdown operation). If any digital tube in the countdown circuit is not lit, check whether the digital tube is good and whether the digital tube connection is good. Check in turn until the countdown circuit works normally. ⑶ Debugging of the voice prompt circuit: This system uses an existing voice board. If the voice board does not work after being powered on, the recording board can be reset first, then recorded, and then played back. Follow the above operation until the voice board works normally. ⑷ The debugging of other circuits mainly depends on whether the interface and connection are correct. Check in turn until it works normally. 2 Software debugging The software system of this system is very large and is written entirely in assembly language. Except for syntax and logic errors, when the program is confirmed to be without problems, it is directly downloaded to the microcontroller for simulation debugging. Take the bottom-up approach, debug each module separately, and finally complete a complete system debugging. 3 Hardware and software integration debugging After the system is completed, perform a complete system debugging. (1). After initialization, the passage time in both directions is exactly equal. Tr1=Tr2=19s, Tg1=Tg2=12s, Ty1=Ty2=2s, Tl1=Tl2=5s, Trt1=Trt2=4s, Tm1=Tm2=8s. All lights are running and the countdown is in good condition. (2) After pressing the mode switch key, operate in the pre-loaded mode 2. (3) After pressing the setting key, set the time. Edited by: He Shiping
Read next

CATDOLL 128CM Diana Silicone Doll

Height: 128 Silicone Weight: 21kg Shoulder Width: 30cm Bust/Waist/Hip: 57/52/63cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22
CATDOLL 139CM Qiu Silicone Doll

CATDOLL 139CM Qiu Silicone Doll

Articles
2026-02-22
CATDOLL 166CM Jo TPE

CATDOLL 166CM Jo TPE

Articles
2026-02-22
CATDOLL 115CM Nanako TPE

CATDOLL 115CM Nanako TPE

Articles
2026-02-22