Water is the basic condition for human survival. Human beings can never live without water.
Water is called the sweet spring of life. For a long time, people generally believe that water is “inexhaustible, inexhaustible”. They do not know how to cherish it and waste it. For a long time, most domestic water meters in our country are ordinary mechanical rotors wet water meters. This water meter is used to measure the small and medium-sized flow in small and medium-sized pipelines in water supply projects, and most domestic water meters are of this kind. The market price of rotor wet water meter is low and its performance is relatively stable, but most of our country still adopts the mode of manual meter reading and charging by household, which has great shortcomings. With the rapid development of China’s information industry, the intelligent water meter system has been widely used in production and life. It is a new type of water meter which uses modern microelectronics technology, thermostatic element modern sensing technology and smart IC card technology to measure water consumption, transfer water data and settle water transactions. Compared with traditional water meter, it has the function of collecting water flow and displaying water consumption by mechanical pointer, it is a great progress.
The intellectualization of water meter system has created conditions for saving water and using water reasonably technically. This smart card flow controller uses AT89S52 MCU development board as the platform, and realizes intelligent flow control by adding radio frequency module, flow control module, temperature module, clock module and other functional modules. The main control module detects whether there is an IC card in the RF module area.
If not, it displays the water temperature and the current time and closes the valve.
When the user puts on the IC card, the main control module can control the RF module to read or write the data of the IC card. The main control module will judge whether the current IC card has a balance according to the read data, and open the valve to detect the water flow.
The display module will display the water temperature and balance, and update the display in real time.
Otherwise, the main control module closes the valve all the time, showing a zero balance and accompanied by sound prompts.
Whenever the consumption is completed, the consumption information will be saved and sent to the upper computer for a second backup.
AT89S52 MCU development board as the main control board. AT89C52 is a low-voltage, high-performance CMOS 8-bit microcontroller, which contains 8K bytes’repeatable erasable Flash Read-Only Program Memory and 256 bytes’ Random Access Data Memory (RAM). The display module matched with the development board is adopted, which can be used to display balance, water temperature and time. The display module uses eight seven-segment digital tubes, which have the advantages of high brightness and low cost. In standby state, the digital tube is used to display the current water temperature and time. Hall sensor is used as the core of the flow detection module. Because Hall switch has the characteristics of no electric shock, low power consumption, long service life and high response frequency, it can work reliably in all kinds of harsh environments because of the integration of epoxy resin sealing and filling. So the DC motor can be used to rotate to simulate the change of water flow, and the generated pulse can be input to the single chip computer through the photocouple protection. Data processing module includes AT89C2051, HD74LS373P, AT24C64, MAX232. The main control module transfers the data to the data processing module in parallel, backs up the data and uploads the consumption data to the upper computer through 232 interface in real time for backup. Because of the high requirement of the RF module, the development cycle will be prolonged. The existing RF modules in the market can be used as development tools to effectively shorten the development cycle. The module can read and write data of IC card.
The main flow chart and interrupt function flow chart of the system software are shown in Figure 2, respectively. Engineering practice shows that AT89S52 single chip computer is used to control flow rate, which is simple in programming, reliable in control, stable in control and low in cost, and basically meets the requirements of flow card control accuracy.