Working principle of IC card smart water meter based on MSP430F41

Publisher:机器人总动员Latest update time:2012-04-13 Source: 中国一卡通网 Keywords:MSP430F41 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

The current water shortage is a global problem, and water shortage will become an important factor restricting the national economy and social development. At present, my country's water resources situation is a coexistence of resource shortage and waste in use, and price is the lever for optimizing resource allocation, so a reasonable water price is the key to saving water.

In order to adapt to the reform of the national water use system, a multi-rate calculation function of tiered billing has been added to the original smart water meter. The water meter receives the relevant water use parameters of the tiered water price, and adjusts the current (tiered) unit price inside the water meter in real time according to the changes in the water consumption of the water meter in the current month. It also calculates the remaining amount in the water meter in real time according to the water use parameters and the water consumption in the current month, which is convenient for the management of water meter users and water supply departments. The IC card smart water meter system developed in this paper can effectively solve the above problems by reducing the financial pressure on the water supply department caused by "supplying water first and charging later" and the waste of water resources in society.

1 System composition and working principle

The composition of IC card smart water meter based on MSP430F413 is shown in the figure:

The IC card smart water meter works by measuring and controlling the total volume of water flowing through the tap water pipe. When a metering pulse arrives, the single-chip microcomputer switches from sleep to working state, and the microprocessor performs corresponding billing processing: when the user's water consumption reaches a certain tonnage limit in a unit time period (generally calculated on a monthly basis), the water price rises in a step-like manner as the water consumption increases. The more water is consumed, the higher the water price. The water meter receives the relevant water consumption parameters of the step water price, adjusts the current (step) unit price inside the water meter in real time, and calculates the water consumption data such as the remaining amount in the water meter in real time based on the water consumption parameters and the water consumption in the month. When the remaining amount of water used by the user reaches the preset alarm amount (the alarm amount is set by the water meter management department), the water meter will automatically close the valve and alarm, thereby reminding the user to purchase water as soon as possible. When the recharged IC card is inserted into the water meter for recharging, the single-chip microcomputer in the IC card water meter first identifies the IC card password and confirms that it is correct, then reads the amount of water purchased and adds it to the remaining amount in the water meter. The water meter charges in real time and settles regularly according to the tiered water price of the water sales department. After settlement, the current water consumption is reset to zero, the total water consumption is accumulated in real time, and written into the memory in the IC card water meter, which then controls the solenoid valve to open. When the recharge is completed, the working status of the water meter and the recharge amount will be displayed on the LCD. When the water meter is manually disassembled or the remaining water volume is lower than the set value, the water meter alarms and turns off the valve in time, and the data is saved in the internal Flash.

2 Hardware Design

The hardware system of the IC card smart water meter mainly includes the following circuits: microprocessor, IC card interface, liquid crystal display, water meter detection, power supply detection, electric control valve control interface and sound alarm circuit, etc.

(1) Microprocessor. The microprocessor is the core of the entire smart water meter. It is responsible for information judgment, identification, calculation, processing and other tasks. After multiple comparisons of performance, quality and price, the microprocessor selected is TI's MSP430F413 microcontroller. This microcontroller is an ultra-low power Flash-type 16-bit RISC instruction set microcontroller with rich on-chip peripherals, an operating voltage of 1.8V to 3.6V, and a built-in LCD driver of 24×4 segments. It can reduce the size and cost. It is particularly suitable for various places requiring low power consumption, such as batteries or handheld devices. [page]

(2) IC card interface. From the perspective of cost saving, the IC card interface uses the FM4442 memory card produced by Fudan Microelectronics Co., Ltd. It uses 0.6 micron CMOS EEPROM technology, with 256 bytes of user memory, 32 bytes of write protection area and 3 bytes of programming security authentication code. The peripheral interface complies with the IS07816 protocol standard (synchronous transmission). Make full use of its internal and external resources, the user memory stores the user's water volume; the programming of the protection storage area and the encryption memory can realize the personalized design of the IC and improve the safety of use. Its interface circuit with the microcontroller is shown in Figure 2:

(3) Liquid crystal display. As the output interface of the water meter, the main function of the liquid crystal display is to output various operating states of the water meter and related data; in addition, it also has the function of user prompts. In order to reduce power consumption and save costs, a specially customized liquid crystal display is used in the design. Its interface is shown in Figure 3:

The LCD display serves as the output interface of the water meter. In addition to displaying the switch status of the electromagnetic valve, the remaining amount in the meter (when the balance is negative, it means that the water meter is in an overdraft state), the cumulative water consumption, the battery status, the cumulative water consumption this month, the segment display (when there is a tiered water price, the tonnage limit of each water price), the unit price (current water price), the current date and the current time, it also has information to remind users to recharge in time and error information.

3 Software Design

The IC card smart water meter software design adopts modular processing. The main control program includes: system initialization, state judgment, flow pulse and water consumption processing, alarm prompt and low power mode processing, etc. The key is the initialization of the billing processing part and the watchdog. The functional subroutines include: IC card interface module (including IC card validity judgment, reading/writing and IC card decryption and encryption), billing processing module (including tiered water price segmented billing judgment and processing) and valve control module. The main program flow chart of the system is shown in Figure 4. [page]

Figure 4 Main program flow chart

System initialization includes the setting of the MSP430F413 stack, ports, interrupts, and LCD control registers so that the CPU can work normally. After the system is initialized, it enters a low-power mode until it is awakened by various interrupt conditions and then enters the corresponding interrupt service routine.

4 System Functions

The IC card smart water meter designed and developed not only integrates prepayment, tiered water price billing, fault detection and other functions, but also has the following special functions:

(1) Automatic alarm function: When the remaining water volume reaches the set alarm volume, the water meter will automatically close the valve, cut off the water source, and remind the user to purchase water.

(2) Overdraft function: When the remaining water volume reaches the set overdraft volume, the water meter will automatically close the valve and cut off the water supply. At this time, the water meter valve can only be opened by recharging the "user card" to purchase water.

(3) Automatic protection function: When the water meter encounters magnetic interference, the water meter will automatically close the valve; at the same time, the water meter will record various interference conditions. The water meter is equipped with an anti-dismantling device, which will enter a locked state when it encounters self-dismantling.

(4) Battery undervoltage reminder function: When the battery power is low, the controller will automatically close the valve and cut off the water supply to remind the user to replace the battery; at the same time, the recorded data of the remaining water volume and actual water consumption will be locked. After replacing the new battery, the original water consumption information data will remain unchanged.

(5) The accumulated water consumption, the current month’s water consumption and the available water consumption can be provided at any time. In order to facilitate users to timely grasp the water consumption situation, the “user card” can be inserted at any time during use to check the “accumulated consumption”, “remaining amount”, “unit price” and “current month’s consumption”.

5 Conclusion

The intelligent IC card water meter developed in this paper has been successfully developed and put into production. The water meter integrates prepayment, tiered water price billing, fault detection, alarm function and other functions, and has the characteristics of clear reading, accurate measurement, convenient management and control. In addition, the water meter has water price parameters (current unit price, tiered water price, etc.) and an accurate real-time clock as the time standard for rate calculation. More importantly, the recharge is based on the amount rather than the water volume, which avoids the trouble of mutual conversion and change during recharge, effectively improves the modernization level of residential water metering and charging management, and has achieved good results in practical applications. The innovation point of this article: Based on the original intelligent water meter, it realizes the functions of tiered water price billing and fault detection. It effectively solves the current problems of charging and water conservation.

Keywords:MSP430F41 Reference address:Working principle of IC card smart water meter based on MSP430F41

Previous article:SPI communication design between MCU and DSP
Next article:Urban parking space management system based on Internet of Things

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号