Today, traffic lights installed at intersections are the most common and effective means of managing traffic. However, this technology existed as early as the 19th century. In 1858, mechanical wrench-style traffic lights, powered by gas, were installed on major streets in London, England, to direct horse-drawn carriages. These were the world's first traffic lights. In 1868, British mechanical engineer John Neuter installed the world's first gas-powered traffic light in the square in front of the Houses of Parliament in Westminster, London. It consisted of two rotating square glass lanterns, one red for "stop" and one green for "caution." On January 2, 1869, the gaslight exploded, injuring a policeman, and was subsequently discontinued.
Urban traffic control systems are comprehensive computer management systems used for urban traffic data monitoring, traffic light control, and traffic management. They are a crucial component of modern urban traffic monitoring and command systems. How to effectively manage traffic, improve the capacity of urban intersections, increase vehicle speed, and reduce traffic accidents using modern computer and automatic control technologies is a new and worthy research topic. This paper designs an urban and rural traffic light control system based on a PLC and analyzes and discusses the calculations and experimental debugging involved in the design.
1. System control functions
(1) Traffic lights at urban intersections consist of a set of red, green, and yellow lights installed in each of the east, west, south, and north directions. The task of control is to make the red, green, and yellow lights illuminate in turn according to a certain time sequence.
(2) Control Timing: When the start switch is turned on, the signal light system starts working, with the north-south red light illuminating first, and the east-west green light illuminating simultaneously. When the start switch is turned off, all signal lights go out; the north-south red light illuminates for 25 seconds, and simultaneously the east-west green light illuminates and remains illuminated for 20 seconds. After 20 seconds, the east-west green light flashes and then goes out after 3 seconds. When the east-west green light goes out, the east-west yellow light illuminates for 2 seconds, then goes out, and the east-west red light illuminates. At the same time, the north-south red light goes out, the green light illuminates, and the east-west red light illuminates for 30 seconds. The north-south green light illuminates for 20 seconds, then flashes for 3 seconds before going out. Simultaneously, the north-south yellow light illuminates, remains illuminated for 2 seconds, and then goes out. At this point, the north-south red light illuminates, and the east-west green light illuminates. This cycle repeats continuously.
Figure 1 System Input/Output Wiring Diagram
2. Hardware wiring and I/O port allocation
According to the design requirements, a Siemens S7-200-224 PLC is used as the controller, with a start button SB1 and one each of red, yellow, green, east, west, and north lights. The input/output wiring is shown in Figure 1. The start button SB1 is connected to the input relay I0.0 terminal. The east-west green light is connected to the output relay Q0.3 terminal, the east-west yellow light is connected to the output relay Q0.4 terminal, and the east-west red light is connected to the output relay Q0.5 terminal. The north-south green light is connected to the output relay Q0.0 terminal, the north-south yellow light is connected to the output relay Q0.1 terminal, and the north-south red light is connected to the output relay Q0.2 terminal. The output power supply is connected to the common output terminal 1L.
3. System ladder diagram design
For clarity and convenience in the design, a sequential control method was adopted. Sequential control refers to the process where, under the influence of various input signals, the states of internal components in a system or production equipment change in a pre-defined time sequence according to the production process, enabling each actuator to operate automatically and orderly during production. The most basic design idea of the PLC sequential control method is to divide a complete working cycle of the control system into several sequentially connected stages, called steps. Then, transition conditions are used to control the internal programming elements representing each step, causing their states to change in a certain time sequence, ultimately controlling the corresponding actuator's action. The steps are divided based on the changes in the input states. Within any step, the state of each output remains unchanged, but the overall state of the outputs in adjacent steps is different. This method of dividing steps represents a very simple logical relationship between the states of the programming elements in each step and the states of each output.
Based on the design requirements, either a single-flow programming method or a dual-flow method can be used. This design employs the dual-flow method, utilizing a parallel branch structure to divide the actions of the east-west and north-south traffic lights into two simultaneous flows, each executing its own timing sequence. The coordination between these flows is organically linked by a unified clock, preventing deviations and resulting in a concise, clear, and logical approach.
Figure 2. Ladder diagram of traffic light control system
When the PLC is powered on, the system is in the initial state S0.0, and a 1-second flashing circuit is generated simultaneously. Pressing SB1 starts the system, and S0.1 and S0.5 are simultaneously activated, causing simultaneous operation in the east, west, north, and south directions. The working principle will be analyzed only from the perspective of the east-west direction. The east-west green light starts working, and timer T37 starts timing for 20 seconds. After 20 seconds, the first step resets, proceeding to the second step S0.2, where the east-west green light flashes. Combined with the initial 1-second flashing circuit, timer T38 sets a 3-second timer to achieve 3 flashes. After 3 seconds, the second step resets, proceeding to the third step S0.3, where the east-west yellow light starts working. Timer T39 times for 2 seconds, and after 2 seconds, the third step resets, proceeding to the fourth step S0.4, where the east-west red light starts working. Simultaneously, timer T40 starts timing, returning to the first step after 30 seconds, and this cycle continues. The north-south direction is the same as the east-west direction and will not be described further. The ladder diagram is shown in Figure 2.
4. Conclusion
There are various methods for designing traffic lights. Since traffic lights are installed at noisy intersections, their stability, reliability, and anti-interference capabilities are all critical. Traditional design methods often have shortcomings, while PLCs, specifically designed for industrial environments, offer significant advantages in traffic light control systems. The sequential design method using PLCs is an advanced approach in sequential control systems. It is not only easy to understand, improving design efficiency and saving design time, but also facilitates program debugging, modification, and reading, shortening the design cycle. The traffic light system designed in this case meets the requirements after debugging and has practical application value.