The main roads at the intersection run in the north-south and east-west directions. Each intersection is equipped with red, yellow, and green traffic lights, along with digital displays that show the countdown for passage or stop. The traffic light control system operates as follows:
1) The signal lights and digital tubes work in a cycle. The red light in the north-south direction remains on for 20 seconds (the digital tube counts down from 20), followed by the green light in the east-west direction for 17 seconds (counting down from 17). Then, the yellow light flashes for 3 seconds (counting down from 3). When the yellow light reaches 0 seconds, the red light in the east-west direction turns on for 30 seconds (counting down from 30), then the green light in the north-south direction activates for 27 seconds (counting down from 27), and the yellow light flashes again for 3 seconds (counting down from 3). This cycle repeats continuously.
2) The timing for each direction can be manually adjusted using buttons, allowing users to increase or decrease the duration of the green or red lights as needed.
3) Based on real-time traffic conditions, three different operational modes can be set: “busy,†“not busy,†and “free.†Each mode has distinct timings, with “busy†having the longest durations, followed by “not busy,†and then “free.â€
4) These time periods are configured via serial communication. The data format consists of two bytes: the first byte represents the address, and the second indicates the time period. Addresses like 0x01, 0x02, etc., correspond to different groups, while 0x00, 0x01, and 0x02 represent “free,†“not busy,†and “busy†respectively. For example, sending 0x01, 0x00 means the first group is in the “free†mode.
**1. System Hardware Design**
The system is primarily built around the STC89S52 microcontroller from Hongjing Technology, along with essential modules such as the reset circuit, clock circuit, signal light control display circuit, digital tube control display circuit, and button control circuit. A hardware block diagram is shown in Figure 1.
The reset and clock circuits are standard components, operating at a crystal frequency of 11.0592 MHz.
The signal light control display circuit, as shown in Figure 2, uses 12 LEDs connected to the P1 port of the microcontroller (P1.0–P1.5). P1.0–P1.2 control the red, yellow, and green lights in the north-south direction, while P1.3–P1.5 control the same in the east-west direction. All lights are connected through a common anode configuration. When the corresponding port outputs a low level, the LED illuminates, indicating the current traffic state.
A four-digit seven-segment display is used to show the countdown for passage or stop. The digital tube control circuit, illustrated in Figure 3, connects the segment code to the P0 port of the microcontroller and the bit select lines to the MCU ports (A1–A4) via a triode inverter. By scanning each digit sequentially, the display shows dynamic numbers. Since the digital tube uses a common cathode connection, both the segment and bit codes are active high.
The function button circuit, depicted in Figure 4, includes three buttons—S1, S2, and S3—connected to the P2.0–P2.2 ports. These buttons allow manual adjustment of the traffic times. S1 is used to switch between adjusting the north-south or east-west timings, or to exit the adjustment mode. S2 increases the timing by 1 second per press, while S3 decreases it by 1 second. Users can also choose other step sizes, such as 5 or 10 seconds. The system also enforces minimum and maximum limits on the adjustable time values.
ZTTEK Electric Scooter Batteries. Any size batteriesb can be customized! Suitable for most electric vechile modles, like electric e-bike, golf cart,forklift,beach electric motorcycle.
Electric Motorcycle Battery,Li-Ion Battery Pack For Electric Bike,Lithium Battery Charger For Electric Bike,Lithium Battery Pack For E-Bike
Jiangsu Zhitai New Energy Technology Co.,Ltd , https://www.zttall.com