1 Introduction
With the development of the economy, the number of cars has increased, and the pressure on urban roads has increased. On densely populated roads, people and vehicles often compete for lanes, resulting in frequent traffic accidents. Many cities use zebra crossing traffic lights to balance the relationship between pedestrians and vehicles, but they ignore the real-time traffic conditions at different times and cannot meet the changing traffic needs. The intelligent zebra crossing traffic lights designed in this article can be adjusted in time according to the number of pedestrians and vehicle flow. Traffic light control results can better deal with corresponding problems.
2. Overall system design
The traffic light indicates the direction of pedestrians in red and green colors and time, and the direction of vehicle indication shows red, green, and yellow colors and time. The red light time in the direction indicated by pedestrians is equal to the sum of the green and yellow light times in the direction indicated by vehicles. The time indicated by traffic lights in the direction indicated by pedestrians The green light time is equal to the red light time in the direction indicated by the vehicle. The two-way pass approximates the traffic flow and the number of pedestrians waiting to cross the road, and adjusts the two-way traffic time in real time. During the vehicle peak period, when the pedestrian accumulation reaches a higher preset value, the crossing timing can be turned on, and the traffic time is controlled to be shorter; the opposite is true during the off-peak vehicle period, in which The number of pedestrians is captured by a counter or a pressure sensor, and this solution uses a pressure sensor. According to the task requirements, the designed system mainly consists of the following modules: ① control and expansion module; ② detection and conversion module; ③ reset and crystal oscillator module; ④ display module. Its structural block diagram is shown in Figure 1.
Figure 1 Overall block diagram of the system
In this system, the control and expansion modules are used to complete the control tasks of the system; the detection and conversion modules are used to measure the traffic flow on the road and the number of people waiting to pass on the sidewalk through pressure sensors, and convert them into digital quantities for single The chip is processed; the function of the reset and crystal oscillator module is to combine the internal circuit of the microcontroller to generate the clock frequency required by the microcontroller and to reset the circuit under different needs; the function of the display module is to display the set pass or waiting time.
3. Hardware design
3.1. Control and expansion modules
(1) The control part of the control module adopts MCS-51 series single-chip microcomputer 8051, which is low in price, simple in structure, easy to develop, has strong bit processing functions, and has a full-duplex asynchronous serial communication port. Among them, the setting of each second is delayed by a combination of counter hardware and software. After the main pulse frequency of the microcontroller is divided by 12, 1s will exceed the maximum timing time of the counter. A software counter with an initial value of 20 is set in the main program to make T0 time 50ms. In this way, whenever T0 reaches 50ms, the CPU responds to the overflow interrupt request and enters the interrupt service subroutine. In the interrupt service subroutine, the CPU first decrements the software counter by 1, and then determines whether it is 0. If it is 0, it means that 1s has arrived, and it can return to the output time display program. The 8051 clock frequency can be selected between 1.2 and 12MHz. Without affecting the total power of the system, choosing a lower clock frequency can reduce the system's requirements for the working speed of other components, thereby reducing costs and improving system reliability. . The single-chip machine clock frequency of this system is 6MHz.
(2) The expansion module MCS-51 series microcontroller has a total of four 8-bit parallel I/O ports, but these I/O ports cannot be fully provided to users. For the 8051 microcontroller with built-in ROM/EPROM, these 4 I/O ports are only allowed to be used as user I/O when external expansion is not used. However, when most 8051 requires external expansion, the MCS-51 microcontroller can be provided. The I/O ports used by users are only P1 and P3. Therefore, expansion of I/O ports is inevitable in most MCS-51 microcontroller application system designs.
3.2. Detection and conversion module
The system uses a pressure sensor to measure the flow of pedestrians and vehicles at a certain time, converts it into a corresponding current signal, amplifies and filters it, and inputs it into the A/D conversion device, and then forms a digital signal and inputs it into the microcontroller. The microcontroller presets the corresponding value and compares it with the input value, and adjusts the two-way signal light time to control the traffic time. Among them, assuming that the average weight of pedestrians is 40 to 100kg and the average mass of vehicles is 200kg to 10t, the PTH501 pressure sensor can be used as the detection instrument. Its range is 0~1~150 (MPa), the accuracy is ±0.2%FS, and the response The time is 5ms.
The principle block diagram of the detection and conversion module is shown in Figure 2.
Figure 2 Principle block diagram of detection and conversion module
3.3. Reset and crystal oscillator module
(1)Reset module
Reset is the initialization operation of the microcontroller. Its main function is to initialize the PC to 0000H so that the CPU starts executing the program from the 0000H unit. In addition to the normal initialization of the system, when the system is in a deadlock state due to program running errors or operation errors, in order to get out of the predicament, it is also necessary to press the reset button to restart. This design uses an automatic reset method. To ensure a successful reset, as long as the reset port remains high for a sufficient period of time (that is, more than two cycles), the system can automatically power on and reset.
(2) Crystal oscillator module
There is a high-gain inverting amplifier inside the 8051 to form an oscillator. Pins XTAL1 and XTAL2 are the output and input terminals of this amplifier respectively. This amplifier forms a self-excited oscillator together with the quartz crystal and ceramic resonator outside the clock circuit in Figure 3. The wiring is shown in Figure 3. When an external crystal is connected, C1 and C2 are usually selected to be 30pF; when an external ceramic resonator is connected, the typical values of C1 and C2 are about 47pF. Its oscillation frequency is 1.2~12MHz. It uses a 12MHz crystal oscillator and is connected to XTAL1 and XTAL2 of the 8051 microcontroller to provide a timing reference for the CPU.
Figure 3 Clock circuit
3.4. Display module
LED (Light-Emitting Diode) is the abbreviation of light-emitting diode. LED digital tube has simple structure, high luminous efficiency, low production cost, stable and efficient working performance, long life, bright color, easy to observe, economical and cost-effective, and can reduce the number of interfaces , and LED also has the advantages of energy saving, safety and environmental protection. It adopts 8-segment common cathode digital tube and dynamic driver display.
4. Software part
Software design is the core of the system control part. When the system is started and initialized, the flow information of pedestrians and roads is collected through pressure sensors set at different locations and processed separately. The output is then converted to analog-to-digital format and preset with the microcontroller. The control contents are compared and a control plan is formed, which is finally displayed to give prompts to people traveling in both directions. The main program flow of the system is shown in Figure 4.
Figure 4 Main program flow chart
5. Summary
This system is based on the single-chip 8051 chip as the core control component. Through the two-way pressure sensor, it can adjust the lighting time of the two-way red and green lights according to the real-time traffic conditions, achieving better control effects, strong applicability, simple operation, It has the advantages of strong scalability, high reliability, short design cycle, and easy maintenance.
Previous article:Sorting out the various cycles in a microcontroller
Next article:A brief introduction to USB2.0 SD/MMC flash memory card reader single chip
Recommended ReadingLatest update time:2024-11-16 11:49
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- STC32G Series MCU Technical Reference Manual
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Linear Regulator (LDO) Experiment Manual
- C++ Language Tutorial
- The problem that the PS side does not close the cache when ZYNQ debugs DDR
- I would like to ask for an example of the architecture of a general sensor module.
- Do you know how to conduct factory inspection on instruments and what precautions should be taken? All the knowledge points are here~
- Embedded development: How to select a microcontroller?
- Texas Instruments has the answers to the eight major challenges of automotive electrification!
- MSP430 communication resources IIC communication
- [Seeking guidance] RSL10 small light does not flash
- The weekly review information is here~ New activities will be launched this week