Design of water level control system based on single chip microcomputer

Publisher:TranquilWhisperLatest update time:2012-05-26 Source: 电子设计工程 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

a.JPG

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.

b.JPG b.JPG

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.

c.JPG [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.

d.JPG

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.

e.JPG

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.

f.JPG

[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.

g.JPG

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.

Reference address:Design of water level control system based on single chip microcomputer

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

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号