Application of AT89C51 single chip microcomputer in variable frequency speed regulation constant pressure water supply system

Publisher:彩虹微笑Latest update time:2012-12-20 Source: 21ICKeywords:AT89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The principle of variable frequency speed regulation constant pressure water supply and the hardware composition and software design method of variable frequency speed regulation constant pressure water supply control system composed of AT89C51 are discussed.

1 Working Principle

Compared with water supply from water towers or high-level water tanks on rooftops, variable frequency speed regulation constant pressure water supply has the advantages of low investment, energy conservation, and less chance of secondary pollution of water quality. More and more cities and residential areas have or are planning to adopt variable frequency speed regulation constant pressure water supply. The composition of variable frequency speed regulation constant pressure water supply system is shown in Figure 1.

Its working principle is: the controller detects the actual water pressure value, compares the difference between the set water pressure value and the actual water pressure value, calculates according to the PID control law, and outputs a control signal to the inverter. The inverter adjusts the power supply voltage and frequency of the water pump motor according to the input signal of the controller.

When the water consumption increases, the controller controls the inverter to increase the voltage and frequency of the motor, increase the speed of the water pump, and increase the water output; when the water consumption decreases, the controller controls the inverter to reduce the voltage and frequency of the motor, reduce the speed of the water pump, and reduce the water output. Through this control method, the pressure of the tap water pipeline can be kept at the set value.

Due to the high price of frequency converters, variable frequency speed regulation constant pressure water supply systems usually use multiple water pumps in parallel operation, and several water pumps share one frequency converter. When working, the controller controls the power distribution system to automatically select the number of water pumps required to be put into operation according to the amount of water consumption. The general method is to keep one of the water pumps under the control of the frequency converter, and the other water pumps run at full speed or stop and wait at the working frequency according to the change of water supply.

2. Single chip microcomputer controller design

2.1 Hardware Design

The principle wiring diagram of the single-chip microcomputer controller and the variable frequency speed regulation constant pressure water supply system is shown in Figure 2. The system uses Atmel's AT89C51 single-chip microcomputer as the control CPU (because the single-chip microcomputer has 4KB of Flash Memory); to ensure the stable and reliable operation of the system, MAX813 is used as the system voltage monitoring and Watchdog circuit; the 4-20mA pressure signal sent by the pressure transmitter is converted into a 0-5V voltage signal by IC7; the A/D conversion circuit ADC0809 converts the water pressure value detected by the pressure sensor and the setting value of the setting potentiometer into digital quantities for use by the single-chip microcomputer; the D/A conversion circuit uses DAC0832 to convert the control quantity input by the single-chip microcomputer into a 4-20mA current loop to control the output frequency of the inverter. The control signals from the single-chip microcomputer to the power distribution part and some control switch commands of the system are isolated through the photoelectric coupling circuit to reduce the impact of the strong electric circuit on the single-chip microcomputer.

2.2 Software Design

Assume that there are two water pumps in the water supply system, of which water pump 1 is variable frequency operation and water pump 2 is industrial frequency operation. They are started or stopped by contactors respectively, and the microcontroller controls the operation of the contactors through relays. The software design is as follows:

2.2.1 MCU interface address allocation and control port function

A/D converter ADC0809: 80XXH~87XXH; the pressure sensor is IN0 channel, and the setting potentiometer is IN1 channel.

D/A converter DAC0832: 08XXH.

Water pump 1 relay controls P1.0: when P1.0=0, water pump 1 starts; when P1.0=1, water pump 1 stops.

Water pump 2 relay controls P1.1: when P1.1=0, water pump 2 starts; when P1.1=1, water pump 2 stops.

Power-on command P1.2: When P1.2=0, the system starts working, and when P1.2=1, the system stops working.

2.2.2 Software Programming

The single chip controller software of the variable frequency speed regulation constant pressure water supply system includes the main program, control quantity calculation subroutine, relay control subroutine, A/D conversion subroutine, delay subroutine, etc. [page]

The main program includes system initialization, detection of power-on commands, etc. The main program block diagram is shown in Figure 3.

The T1 interrupt service program includes the management and application of all subroutines except the main program. The program flow chart is shown in Figure 4.

The A/D conversion uses a timed conversion method. After starting the A/D, a software delay of 150μs is used before the conversion result is read out.

The relay control subroutine completes the operation and stop control of water pump 2. Since the control amount of the frequency converter is directly related to the operating speed of water pump 1, the program can judge the working status of water pump 1 according to the size of the control amount of the frequency converter. If the control amount is zero, it means that the system pressure is too high and water pump 1 has been adjusted to the lowest speed. At this time, water pump 2 needs to stop working; if the control amount is the maximum value, it means that the system pressure is too low and water pump 1 has been adjusted to the highest speed. At this time, water pump 2 needs to be put into operation. Due to the large inertia of the change of pressure in the water supply system, when the control amount reaches the maximum or minimum value, it is necessary to delay for a period of time. After repeated measurements during the delay stage, if the control amount remains unchanged, it will be switched. When the system has more than 2 water pumps, the switching principle is the same, but a cyclic judgment program for judging the start and stop status of multiple water pumps needs to be added.

The relay control subroutine block diagram is shown in Figure 5.

The control quantity calculation subroutine includes the calculation of the inverter control quantity and the output of the control quantity, wherein the control law adopts the PID regulation law.

The control quantity calculation subroutine flowchart is shown in Figure 6.

3 Conclusion

Variable frequency speed regulation constant pressure water supply is the development direction of water supply in modern cities and residential areas. The variable frequency water supply system controlled by a single-chip microcomputer has the characteristics of reliable operation, easy implementation, and low price, and is an ideal controller.

Keywords:AT89C51 Reference address:Application of AT89C51 single chip microcomputer in variable frequency speed regulation constant pressure water supply system

Previous article:A must-read for beginners: some difficult-to-grasp concepts for 51 single-chip microcomputers
Next article:Introduction to AT89C51 Microcontroller

Recommended ReadingLatest update time:2024-11-16 19:42

Design of Laser Coded Lock Based on AT89C51
In today's society, optoelectronic technology has been widely used, especially in optical fiber communication technology, remote control technology, radar detection technology, automatic control technology and optoelectronic detection technology. The reliance on optoelectronic technology is increasing. Optoelec
[Microcontroller]
Design of Laser Coded Lock Based on AT89C51
Circuit design of wireless communication system based on NFC
  In many cases, wired communication technology cannot meet actual needs, such as working in harsh outdoor environments. The communication module built with wireless radio frequency communication chips, using a single-chip microcomputer as the control component, and a certain peripheral circuit can well connect the si
[Microcontroller]
Circuit design of wireless communication system based on NFC
Simple intelligent robot designed based on AT89C51 microcontroller
introduction With the continuous development of microelectronics technology, microprocessor chips are becoming more and more integrated. Microcontrollers can integrate CPU, memory, timers/counters, parallel and serial interfaces, watchdogs, and pre-processors on one chip. A variety of circuits such as amplifiers, A/
[Microcontroller]
16×16 dot matrix design based on AT89c51
Four 8×8 dot matrices are used to form a 16×16 dot matrix. Two decoders are used. Only three characters are set (the character converter can be used to change the character). The buttons control left shift, right shift, pause, and start. The microcontroller source program is as follows: /***************************
[Microcontroller]
16×16 dot matrix design based on AT89c51
MP3 Technical Solution Based on AT89C51SND1C
 As people's requirements for portable music players increase, MP3 players have won the favor of music lovers with their small size and good sound quality. At first, MP3 files could only be played by computers. With the development of the Internet, MP3 players were produced. With people's further understanding of MP3 p
[Microcontroller]
MP3 Technical Solution Based on AT89C51SND1C
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号