Water level control principle of water supply system
The following figure is the water level control schematic diagram of water tower. The dotted line in the figure indicates the upper and lower limit of allowable water level change. Under normal circumstances, the water level should be kept within the dotted line. Therefore, three fixed metal rods should be installed at different heights of the water tower to sense the change of water level. Among them, rod a is below the lower limit water level, rod C is at the upper limit water level, and rod B is at the lower limit water level. Rod a is connected to + 5V power supply, rod B and rod C are respectively connected to analog ground through a resistor.
The water tower is driven by a motor to supply water, and the motor is controlled by a single chip microcomputer to control the water level. When the water supply reaches the upper limit, due to the conductive effect of water, rod B and rod C are connected to + 5V power supply. Therefore, both ends of rod B and rod C are in high-level “1” state. At this time, should stop the motor and pump work, no longer supply water to the tower.
When the water level drops to the lower limit, both rods B and C can not connect with rod a, so both ends of rod B and C are in “0” state. At this time, the motor should be started to drive the water pump to supply water to the water tower.
When the water level is between the upper and lower limits, rod B and rod a are connected. Because rod C cannot be connected with rod a, the B end is in “1” state and the C end is in “0” state. At this time, whether the motor is driving the water pump to add water to the water tower, the water level is rising, or the motor is not working, the water level is falling, the original working state should be maintained.
Realization of water level control hardware circuit
As shown in the figure below, the working principle of the circuit: when the water level signal P1.1 = 0 and pl.0 = 0, the output of pin pl.2 of 8051 single chip microcomputer is also 0, which makes the relay act and the motor turn to add water; When P1.1 = 0 and p1.o = 1, the P1.2 pin remains unchanged and the motor maintains the original state; When P1.1 = 1 and p1.o = 0, the output of pin pl.3 is O, and the LED and piezoelectric buzzer are driven to provide fault indication and alarm of water supply system. At the same time, the output of pin P1.2 is 1. Turn off the motor power immediately and wait for the technician to repair it; When P1.1 = 1, P1.0 = 1, pl.2 = 1, the motor stops.
The signal processing is as follows:
1. The circuit uses optocoupler to control the motor, and adopts two kinds of fault alarm system, sound and light, so as to improve the reliability of control and the safety of the system.
2. Give full play to the advantages of the combination of software and hardware, make the circuit simpler, fewer components, easy to repair and maintenance.
Water level control software programming
Program flow chart (see figure below)
Using 8051 single chip microcomputer to realize the control automation of water supply system is safer, more reliable and more convenient than mechanical control and manual control. At present, 51 series of single-chip microcomputer is dominant in the market, and its price and performance are relatively high. Using 8051 single-chip microcomputer to realize the control automation of water supply system has a broad application prospect. According to different needs, the hardware circuit and software programming part of the water level control example in this paper can be used in other water storage devices, such as wells, water towers, boilers, toilet flushing and solar water heaters.