Current location - Education and Training Encyclopedia - Graduation thesis - The urgent need for water level control of PLC water tower graduation thesis
The urgent need for water level control of PLC water tower graduation thesis
Graduation design of intelligent water level control system

1. Design principle of water level intelligent detection system?

Experiments show that pure water is almost non-conductive, but there are some Mg2+ and Ca2+ plasmas in nature and people's daily use, which make water conductive. This control device is completed by using the conductivity of water. ?

As shown in figure 1, the dotted line indicates the upper and lower limits of allowable water level change. Under normal circumstances, the water level should be kept within the dashed line. Therefore, three metal rods are installed at different heights of the water tower to sense the change of water level.

Figure 1 schematic diagram of water level detection

Among them, rod B is at the lower water level, rod C is at the upper water level, rod A is connected to a +5V power supply, and rod B and rod C are grounded through a resistor respectively. ?

The water tower is driven by a motor to supply water to the pump, and the single chip microcomputer controls the rotation of the motor to achieve the purpose of water level control. When supplying water, the water level rises. When the upper limit is reached, rods B and C are connected to +5V due to the conductive effect of water. So both ends of B and C are in the state of 1. At this time, stop the motor and water pump, and do not supply water to the water tower.

When the water level drops to the lower limit, neither rod B nor rod C can conduct electricity with rod A, so both ends of rod B and rod C are in a state of zero. At this time, the motor should be started to drive the water pump to work and supply water to the water tower.

When the water level is between the upper and lower limits, rod B and rod A are connected, and the end B is in the state of 1. Terminal c is in 0 state. At this time, whether the motor has been driving the water pump to add water to the water tower and whether the water level is rising; Or the motor doesn't work, and the water level drops with the water. They should continue to maintain their original working conditions. ?

2. Water level control system of water tower based on single chip microcomputer control?

1? Single chip microcomputer control circuit?

The water level control circuit of the water tower is shown in Figure 2. ?

2? Forward channel design

Fig. 2 Water level control circuit of water tower

Because the signal used is a pulse signal (switching value), its frequency changes with the water level, so A/D is omitted in the circuit design. In the conversion part, digital pulse signal communication is adopted, which not only reduces the cost of hardware circuit, but also improves the anti-interference ability, stability and accuracy of the system. ?

The input variable pulse signal is sent to the P 10 and P 1 1 pin level of 80365438. When the signal is received, the input pulse makes it output high level, and when there is no signal input, there is no trigger pulse and it turns to low level. The program controls the pin levels of 803 1 periodic sampling P 1 1 and P 10, so as to achieve the purpose of control. ?

3. Microcomputer control data processing part?

In the circuit design, making full use of the functions of the existing 803 1 port, and considering the expansion, and saving components as much as possible can not only reduce the cost, but also improve the reliability.

(1) Use 803 1 single chip microcomputer. The water level control circuit of the water tower is shown in Figure 3- 1. The receiving circuit gets the FM pulse whose frequency changes with the water level, which reflects the water level in the water storage tank. Through signal processing, the functions of water level control and fault alarm can be realized. In order to accomplish this task,

The best choice is to use microcomputer control. In the experiment, MCS-5 1 series shrapnel machine 803 1 is used as CPU. Complete the data processing of the received signal, and the corresponding functions such as water level control and fault alarm. The internal structure block diagram of 803 1 chip is shown in Figure 3. ?

As can be seen from Figure 3, it includes the arithmetic unit, controller, on-chip memory, four I/O interfaces, serial interface timer/counter, interrupt system, oscillator and other functional components. SP in the figure is a stack pointer register, and the stack area occupies some units of on-chip RAM. There is no general register (working register), because the single chip microcomputer has memory, which is as convenient as accessing the working register, so a certain amount of on-chip RAM is put in.

Bytes are designated as working register areas; Graduate work visa

Is a program status word register, referred to as program status word, which is equivalent to the flag register of other computers; DPTR is a data pointer register, which is especially useful when accessing off-chip ROM, off-chip RAM and even expanding I/O interface. The B register, also known as the multiplication register, works with the accumulator A..

Work can be multiplied and divided. The clock frequency of 803 1 in the experiment is 6MHz. Because 803 1 has no built-in ROM, it needs to expand the program memory. The system uses 2732EPROM to expand the 4K program memory, and the corresponding address space is 0000 h ~ 0 ffh.

(2)74LS373 is used as an address latch. The chip of 74LS373 has eight D latches with three-state gates, and its structural schematic diagram is shown in Figure 4. When the enable terminal G is at high level, the contents in the latch can be updated at ordinary times, and the latch can be realized when it returns to low level. In this case, the output control terminal of the chip is low, that is, the output tri-state gate is opened, and the address information in the latch can be output through the tri-state gate. In addition to 74LS373, 84LS273, 8282, 82 12, chips can also be used as address latches, but the connection modes are slightly different. It is not as common as 74LS373 because of its complicated wiring, multi-purpose hardware and a little expensive.

Figure 3 Block diagram of internal structure of 8031chip

(3) Two water level signals are input by P 10 and P 1 1, and these two signals * * * have four combined states. As shown in Table 3- 1. The third combination (b= 1, c=0) is impossible under normal circumstances, but it should be considered in the design and regarded as a fault state. ?

Table 3- 1 water level signal status table

C (p11) b (p10) operation

0 0 motor running

0 1 remains unchanged.

1 0 fault alarm

1 motor stall

(4) The control signal is output from the P 12 terminal to control the motor. In order to improve the reliability of control, photoelectric coupling is adopted.

4. Alarm circuit?

This system uses light emitting diodes. When the control circuit fails, P 13 will be set to zero, and the LED will light up and give an alarm. ?

5. Software design?

An application system, in order to complete various functions, must first be guaranteed by relatively perfect hardware. At the same time, there must be well-designed software support, especially in today's rapid development of microcomputer applications, many tasks completed by hardware can be replaced by software programming. Even some tasks that must be completed with very complex hardware circuits, sometimes programming with software becomes very simple, such as digital filtering, signal processing and so on. Therefore, it makes full use of its rich internal software and hardware resources, and uses MCS-5 1 assembly language and structured programming method to program the software. The system program consists of main control program and delay subroutine. The main control program is the core. It controls the running and jumping of the whole system program. The flow chart is shown in Figure 5. Including system initialization, data processing, fault alarm, etc. ?

The specific working conditions of the circuit are as follows:

(1) When the water level is lower than B, P 10, P 1 1 get low levels, all of which are set to 0. The single-chip microcomputer control circuit sets P 12 to 0, and the relay is turned on to start the water pump direction. ?

(2) When the water level is higher than B and lower than C, P 10 is set to 1 and P1is set to 0, so the relay is always on to protect itself from electric shock, so when the water level rises above B, the relay is not released immediately and the electrode is still supplying water;

③ When the water level reaches C, both P 10 and P 1 1 are set to 1, and the single chip microcomputer control circuit sets P 12 to 1, the relay is released and the water pump stops working; ?

(4) In the process of using water, the water level drops below C, with P 1 1 set to 0 and P 10 set to 1, maintaining the original state, and the motor does not work until it drops below B, and so on. ?

When the system fails, the system outputs an alarm signal by setting P 13 to zero, and drives the LED to give an optical alarm.

Third, the conclusion?

The development of modern sensing technology, electronic technology, computer technology, automatic control technology, information processing technology, new technology and new materials has brought unprecedented miracles to the development of intelligent detection system. In many application fields, such as industry, national defense, scientific research and so on, intelligent detection system plays an increasingly important role. Test equipment, like nerves and senses, continuously provides all kinds of information about the macro and micro world to human beings and becomes a powerful tool for people to understand and transform nature.

Modern generalized intelligent detection system should include all computers (single chip microcomputer, PC, industrial computer and system computer) as information offices.

Manage core test equipment. Therefore, the intelligent detection system includes many hardware and software links such as information collection, information transmission, information processing and information output. To some extent, the development level of intelligent detection system reflects the technology and design level of a country. ?

The content of this topic is "Intelligent Water Level Control System". Water level control is widely used in daily life and industrial fields, such as water level control of water towers, groundwater and hydropower stations. In the past, the detection of water level was done manually, and the personnel on duty monitored the change of water level around the clock and reported the change of water level to the main control room in time through wired telephone. Then the main control room starts the motor for water supply and drainage. Obviously, the above repetitive work will cause great waste in terms of personnel, time and money. At the same time, it is easy to make mistakes. Therefore, there is an urgent need for an automatic control system that can automatically detect the water level and adjust it according to the water level change. This is my research topic. ?

Water level detection can be realized by mechanical control, logic circuit control, electromechanical control and other ways. In this experiment, single-chip microcomputer and time-base integrated circuit are used for main control, and an automatic water level measuring device is installed on the pool. The change of water level is continuously measured around the clock by using the conductivity of water, and the measured change of water level is converted into corresponding electrical signals. The console uses single chip microcomputer or time-base integrated circuit to process the received signal and complete the corresponding water level display, control and fault alarm functions. ?

Reference materials?

1. Ding Principle and Application of Single Chip Microcomputer Machinery Industry Press 2000?

2. Teng Zhaosheng Luo Intelligent Detection System and Data Fusion Machinery Industry Press 2000

3. Sun Automatic Control Principle Central Radio and TV University Press 1999