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.
Previous article:SPI communication design between MCU and DSP
Next article:Urban parking space management system based on Internet of Things
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Methods and Techniques for Learning Circuit Diagrams (2nd Edition)
- The problem of increasing brackets in single chip computer programming
- lin communication problem
- La la la, sneak peek! The MM32 eMiniBoard is here!
- PD fast charging and QC3.0 fast charging protocol literacy
- MSP430 MCU Development Record (26)
- esp8266 for micropython - Tmall Genie turns on the light
- Can anyone recommend a driver chip that is compatible with TMC2208, or a chip with the same function?
- EEWORLD University Hall----PID Control Behind Drones
- Question: About multi-channel output voltage regulation