In the production field, realizing automatic water level detection and control is a key technology of industrial process control, which is of great significance to improving the automation level of industrial process control.
In the field of life, water supply was generally controlled manually in the past, which easily resulted in waste of water resources, so people are now paying more and more attention to water resource issues.
At present, the water level control system is a widely used water supply system. There are many ways to implement water level control, such as mechanical control, logic circuit control, electromechanical control, sensor control, etc., but the traditional control method has the characteristics of low control accuracy, high energy consumption, and inability to achieve continuous control and tracking of water levels. Therefore, this paper designs a more convenient and accurate water level control system.
1 Overall design
This system mainly consists of a single-chip microcomputer minimum system circuit, a water level detection circuit, a stepper motor drive circuit, a water level display circuit, a water pump drive circuit, and software design. The design system block diagram is shown in Figure 1. The single-chip microcomputer control module in Figure 1 is the core component of the system. The keyboard and display are used to realize the human-computer interaction function. The parameters and states to be set are input into the single-chip microcomputer through the keyboard, and displayed on the display through the controller. When the water level in the water tank drops, the mobile probe also drops. Then, through a simple algorithm, the display shows the water level in the water tank in real time.
2 Hardware System Design
2.1 Controller module design
The single-chip microcomputer controller is mainly used to generate stepper motor control pulses, collect and process the current number of steps of the stepper motor, and then display the current water level on the terminal LCD after a simple algorithm. AT89S52 is used as the system control solution for the controller. The AT89S52 single-chip microcomputer has strong arithmetic operation functions, flexible software programming, and high degree of freedom. Various algorithms and logic controls can be implemented by software programming. Compared with FPGA, it has fewer chip pins and is easy to implement in hardware. It also has the advantages of low power consumption, small size, mature technology and low cost.
2.2 Motor drive module design
The main purpose of this design is to control the speed of the motor. The motor uses a two-phase four-wire stepper motor, so the motor drive module is indispensable. The solution decides to use a dedicated motor drive chip L298N. The circuit design of this motor drive chip is simple, with strong anti-interference ability and good reliability. The circuit schematic is shown in Figure 2.
2.3 Water level detection module design
Traditional water level detection uses a pressure sensor, which is then converted by AD and transmitted to a single-chip microcomputer. The calculation is complex and the precision is not high enough. Alternatively, a contact pickup signal is used to install several metal bars at different positions of the water tank to sense the change of the water level. The water level signal is directly collected by using the conductivity of metal and water. The calculation is simple, but it cannot realize continuous water level monitoring. This design uses a single-chip microcomputer to control a stepper motor, and hangs a moving probe on the stepper motor. When the probe touches the water, the signal collected by the single-chip microcomputer is a high level, otherwise it is a low level. This design can monitor the water level continuously, the program is simple to run, the control precision is high, and the cost is low. The circuit diagram is shown in Figure 3.
[page]
2.4 Display module design
This design adopts a 128x64 LCD liquid crystal display, which has low power consumption, simple driving method and hardware connection circuit, large display screen, and can display Chinese characters and letters.
2.5 Water inlet and outlet module design
In the continuous water level control system, the system needs to control the water in and out of the water tank. This design uses a relay to control the water pump to control the water in and out. The single-chip microcomputer controls the relay, which is simple and suitable for industrial water in and out. The circuit diagram is shown in Figure 4.
3 Software Design
In order to make various hardware devices of the control system operate normally and effectively realize real-time control and management, in addition to designing reasonable hardware circuits, high-quality software support is also necessary. Software design includes the design of drivers for each module, the design of main program software, and the implementation of control algorithms. Each driver module has a keyboard recognition program, LCD display program, control setting program, etc. The main program flow chart is shown in Figure 5. Due to space limitations, the program source code is not provided here.
4 Experimental results and analysis
4.1 Given water level test
Enter the given water level height using the keyboard, and the results are shown in Table 1.
[page]
4.2 Liquid level tracking test
Start the tracking test program, and the LCD display will show the water level in real time. The test results are shown in Table 2.
From the above results, we can see that the error value is within the allowable range, the power of the motor-driven load is relatively low, and a motor with better performance is needed.
5 Conclusion
1) Optimized software algorithm, intelligent automatic control, and error compensation; 2) The advantage of this project design is that it has designed a system for continuous control and liquid level tracking. This control system overcomes the defects of traditional electrode-based water level control systems. It has a novel solution, simple algorithm, easy implementation, high precision, and practical application value for realizing automatic water level detection and control.
Previous article:Design of LED display circuit of ultrasonic distance meter based on single chip microcomputer
Next article:Detailed explanation of the test program of the microcontroller experimental development board
- Popular Resources
- Popular amplifiers
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
- Brief Introduction of Non-Magnetic Coil Solution for National Technology Intelligent Water Meter
- Adjusting the fire power of the induction cooker with a magnetic switch
- Are there any 6-channel analog switches that you would recommend?
- How is the current transformer used?
- Sensor Basics and Common Terms
- "Power supply obstacle" + voltage stress
- About LM2611
- STM32F767 fails to drive 7-inch screen
- EEWORLD University Hall----Analog Integrated Circuit Design Yang Qingyuan (National Chung Hsing University, Taiwan)
- Strange problem in high frequency control of PMOS field effect tube