Design of contactless Mifarel card prepaid smart water meter

Publisher:温馨小筑Latest update time:2011-06-08 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Introduction
With the development of social economy and the continuous progress of science and technology, people's living conditions have gradually improved, and the requirements for intelligent housing have also increased. The implementation of one meter per household, the implementation of multi-rate tiered water prices, and the need for water supply management departments to improve metering and charging management all require changes to traditional mechanical water meters. In order to adapt to the reform of the national water use system, this design adds a tiered billing multi-rate accounting function on the basis of the original smart water meter. The smart water meter can calculate the remaining amount in the water meter in real time according to the water use parameters and the water consumption within the month, which is convenient for water meter users and water supply departments to manage. The Mifarel (M1 for short) card prepaid smart water meter designed in this paper can effectively solve the above problems and realize the prepaid consumption of "buy water first and then use water", which has positive significance for saving national funds and reducing water resource waste.

1 Water meter composition and working principle
The composition principle of the M1 card smart water meter system based on MSP430F413 is shown in Figure 1.

The working principle of the M1 card smart water meter is to add a reed switch and a permanent magnet to the water meter with ordinary rotating disk counting. The double reed switch is fixed near the top of the counting disk, and the permanent magnet is installed on the counting disk (0.01 m3 in this system). For each rotation of the counting disk, the permanent magnet passes through the double reed switch once, generating two metering pulses at the signal end. When a valid metering pulse is received, the single-chip microcomputer switches from sleep mode to working mode, and the microprocessor executes the corresponding billing program. The water meter pre-stores the tiered water price and related water use parameters, which is completed by the "setting card". The smart water meter can calculate the remaining amount in the water meter in real time according to the water consumption of the month. When the user's remaining water consumption is less than the preset alarm amount (the alarm amount is set by the water meter management department), the water meter automatically alarms and reminds the user to purchase water as soon as possible. When the recharged M1 card is placed close to the sensing area to recharge the water meter, the single-chip computer in the water meter first identifies the M1 card password and confirms that the card and meter match correctly, 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 of the M1 card water meter. After the recharge is completed, the working status of the water meter and the recharge amount are displayed on the LCD. When the water meter is manually dismantled or the remaining water volume is lower than the overdraft amount, the water meter automatically closes the valve and saves the data in the internal FIash.

2 Hardware Design
The hardware of the M1 card smart water meter mainly includes microprocessor, pulse acquisition circuit, FMl702 base station chip circuit and M1 card induction antenna, LCD display circuit, valve control circuit, water meter detection, power supply detection and sound alarm circuit, etc.
2.1 Microprocessor
The microprocessor of this design uses TI's MSP430F413 microcontroller, which is an ultra-low power Flash 16-bit RISC instruction set microcontroller with rich on-chip peripherals, an operating voltage of 1.8~3.6 V, and a built-in LCD driver 24×4 segments. It can reduce the size and cost, and is particularly suitable for various places requiring low power consumption.
2.2 Pulse acquisition circuit
This design uses a double reed switch sensor, that is, when a reed switch is detected to be attracted, it is recorded first, and then the other reed switch is detected. Only when the other reed switch is detected to be attracted is the signal considered valid, that is, a single reed switch is invalid even if it is closed multiple times, which effectively solves the problem of false signal transmission due to critical point vibration. At the same time, this design can also effectively prevent inaccurate counting caused by artificially adding magnets, because when the microcomputer detects that the two tubes are closed at the same time, it will be considered that there is external magnetic interference, stop counting and alarm at the same time. Two capacitors with a capacity of 0.01μF are used to eliminate the jitter generated when the double reed tubes are closed. The wiring schematic is shown in Figure 2.

2.3 FM1702 base station chip circuit and M1 card induction antenna The card
reader chip is FM1702SL, designed by Fudan Microelectronics Co., Ltd. It is a dedicated chip for contactless card readers based on the ISO14443 standard, using 0.6μm CMOS EEPROM technology and supporting the ISO14443 typeA protocol MI-FARE: standard encryption algorithm. Its interface circuit is shown in Figure 3.

2.4 LCD display circuit and display
The MSP430F413 microcontroller has a built-in 24×4 segment LCD display driver. The LCD display circuit and display are shown in Figure 4. The LCD display selected in this design is a custom-made character LCD display with a screen size of 65 mm×40 mm. The Chinese characters and numbers are harmonious and beautiful. As the output interface of the water meter, the LCD display not only displays 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 segmented (the upper limit of each water price for the tiered water price) display, the unit price (current water price) display, the current date and time, but also has the function of reminding users to recharge in time and displaying error information. For example, indicates strong magnetic interference, the valve will be closed; indicates undervoltage state, reminding to replace the battery.

2.5 Valve control circuit
This design uses a small power motor to directly drive the ball valve to open and close through deceleration. Its advantages are relatively simple structure and small water resistance. The disadvantage is that the ball ring of the ball valve requires high processing accuracy, and after a period of use, scale or microparticles will increase the rotation resistance. The design uses a timed opening and closing of the valve several times a month to solve this problem. The valve control circuit is shown in Figure 5.

3 Software Design
The M1 card smart water meter software adopts a modular design. The main control program includes system initialization, state judgment, flow pulse and water consumption processing, alarm prompts and power consumption mode processing, etc. The key is the initialization of the billing processing part and the watchdog. System initialization includes the setting of the stack, port, interrupt, and LCD control register of the MSP430F4l3. After the system is initialized, it enters a low-power mode until it is awakened by an interrupt source, and then enters the corresponding interrupt service program. The functional subroutines include: M1 card read/write module (including M1 card validity judgment read/write and M1 card decryption and encryption), billing processing module (including tiered water price billing judgment and processing) and valve control module. The system program flow chart is shown in Figure 6. (Due to limited space, the program code is omitted - Editor's note)


4 Technical indicators
Power supply: DC3.6 V ER-18505 lithium battery, life ≥ 6 years.
Static power consumption: water meter controller, 10μW.
Static current ≤ 25μA, switch valve current ≤ 180 mA.
M1 card read and write times ≥ 10,000 times.
Motor valve response time ≤ 4 s.
Error with base meter display: ± 0.01 m3.
Use water temperature: -4 ~ 42℃.
Ambient humidity ≤ 96%.

5 Main functions of the system
The M1 card prepaid smart water meter, in addition to integrating prepayment, tiered water price billing, fault detection and other functions, also has the following special functions:
① Battery undervoltage reminder function. When the battery power is lower than 2.7 V, the water meter will automatically close the valve to remind the user to replace the battery; at the same time, the remaining water volume and the actual water consumption record data will be locked. After swiping the "user card", the valve can still be opened for use. After ten days, the valve will be closed and the card cannot be used to open the valve again. After replacing the new battery, the original water use information data remains unchanged.
② Anti-illegal water theft function. In the case of strong magnetic interference, the water meter will automatically close the valve; at the same time, the water meter will record various interference states. The water meter is equipped with an anti-disassembly device. When it encounters self-disassembly and assembly, the water meter will enter a locked state.
③ Query function. In order to facilitate users to grasp the water use situation in a timely manner, they can check the "accumulated usage", "remaining amount", "unit price" and "monthly usage" at any time during use.
④ Automatic alarm function. When the remaining water volume is less than the set alarm volume, the water meter will automatically close the valve to remind users to purchase water.
⑤ 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 source; at this time, the water meter valve can only be opened by recharging the "user card" to purchase water.
⑥ Anti-rust valve design. The valve will automatically open and close once at around 3 am on the 7th, 14th, 21st, and 28th of each month, and the valve will not be completely closed to prevent the valve from rusting and achieve the purpose of activating the battery.

Conclusion
The intelligent M1 card water meter designed in this paper has been successfully developed and applied to the first phase of the new construction of Yuyuan Community of Huazhong University of Science and Technology and has passed the acceptance. The intelligent water meter integrates prepayment, tiered water price billing, fault detection and other functions. It has the characteristics of clear reading, accurate measurement, convenient management and control, etc. It is suitable for matching with intelligent building systems to realize centralized meter reading and remote control. It can be widely used in water meter centralized reading places such as residential communities, schools, and factories. In addition, the water meter has water price parameters (such as current unit price, tiered water price, etc.) and an accurate real-time clock (used as a time standard for multi-rate calculation). More importantly, the recharge is based on the amount rather than the amount of water, which avoids the trouble of mutual conversion and change during recharge, effectively improves the modernization level of residents' water metering and charging management, and has achieved good results in practical applications.

Reference address:Design of contactless Mifarel card prepaid smart water meter

Previous article:Hopkinson rod based high g shock sensor calibration
Next article:Application of touch screen technology in industrial control

Latest Industrial Control Articles
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号