1 The working principle of the smart card water meter uses internal memory to realize the data storage function. Even in case of power failure, the data can be automatically restored after power-on; the battery management function is used: when the power supply is under voltage, an alarm is prompted, the battery is replaced, and the voltage is changed. When the valve is lower, the valve is shut off and the valve is automatically opened after the system power returns to normal.
The management department can manage the daily maintenance of the water meter of the user community according to the card, such as changing the table, releasing the fault, setting the parameters in the table (pulse constant, minimum usage, maximum usage), and pre-loading the water for commissioning the water. It can measure when the valve is abnormal (such as inner leakage), and deduct this part of the amount when users purchase water to recharge. The fault self-check function is used: a buzzer is used to implement alarming functions such as various status and faults, such as card insertion and fault alarm. Use a hardware password or a specific clear card to clear the data in the table.
The smart card water meter is an intelligent water meter with a built-in pre-paid system. It is based on the Ic card security technology and is equipped with automatic protection and information encryption. Ic card water meter is powered by battery. The water meter and other important parameters are all stored in the E PROM chip. The data can be stored for more than 10 years. In addition, the information in the IC card and the card table is encrypted so that the system is not easily copied and used illegally. The Ic smart card prepayment meter system diagram is shown in FIG. 1 . The system mainly consists of the following components: CPU unit, LCD display, reed flow double pulse, valve control circuit, IC card circuit, power supply detection circuit, fault alarm.
The use of IC cards to achieve data exchange between the table and the management system realizes two-way data exchange. When the user purchases water, the IC card can automatically accumulate the water balance of the water meter and the amount of water purchased this time, and the liquid crystal display, water fee calculation and management (alarm amount, basis Water volume, planned water volume), control functions for supplying and stopping water, and price recharging. When the user swipes the purchased water card (IC card) into the water meter, the on-board system automatically opens the valve after confirming that the card is valid for normal water supply. If the user is allowed to overdraft, swipe the water back until the amount of overdraft water is used and close the valve. Each time the user swipes the purchase water into the watch, the water meter LCD displays the remaining amount of water, and the water amount information such as the remaining amount of water and the state information of the water meter are written back to the water purchase card for storage and query of the water sales management system.
2 The overall design of IC smart water meter system 2.1 Power management using 3.6 V nominal capacity: 1.9 Ah (discharge current: 1 mA, termination voltage: 2.0 V); maximum constant current: 1 A; maximum pulse current: 1.5 A The battery supplies power to the system. When the battery voltage <3 V makes the system static, when the current is <5 A, the comparator in the MCU is used to wake up the microcontroller in an interrupt mode, and the water meter valve is closed and the corresponding data is saved, prompting the user to replace the battery. , less than 2.7 V off valve. With the LCD display, the power supply of the Ic card interface circuit and the like is turned on when it is required to operate, so as to reduce unnecessary current loss.
2.2 Flow Detection The water consumption is converted into a pulse signal and two pulse sensors are used to receive it to prevent the multi-count phenomenon caused by the jitter. Through the program design, it is judged whether the two sensors work normally. If it is not normal, it is considered as strong external magnetic interference and the valve is closed.
2.3 Valve control circuit Under special circumstances, the switch of the water meter valve is controlled. The transistor 8550 and 8050 with a saturation voltage drop of 0.2 V constitute the motor drive circuit, which can not only guarantee the drive current of the motor but also limit the maximum current when the fault is less than 500 mA. . Turn on 3.6 V power supply, motor no-load current 25mA±2 mA, load current <60 mA; touch the ball valve with fingertips without motion; valve motor assembly on the run-in test bench for electronically controlled valve switching 1 000 run-in test; observe the components Normal running performance (valve switch normal, no abnormal sound).
The driver uses the MCU's built-in LCD driver module for driving. Its management system is divided into the following modules:
a. User management module: This module includes user account opening and closing, replacement of cards, change of form, transfer, cancellation and user information inquiry and modification;
b. Sales water business management module: This module includes functions such as purchase of water transactions, purchase of water statistics and daily checkout. When selling water, the system first checks whether the card is a legitimate card through the key management system and checks the information in the database. After the check is passed, the user's water purchase amount (or water purchase amount) is written into the card and the database is updated. The water meter information brought back by the user's card is written in the database. This module requires that a single user can record and count water purchases and water usage for a certain period of time. Users' personal information, such as name and water meter number, can be used to query the user's water purchase, water use, and water meter operation status.
c. Operator information management module: This module includes additional operator functions, operator authorization functions, and password modification functions. The system records every time the operator logs in and operates. Operators operate at different levels. Different operators have different passwords and security levels, and they can only access job-related data.
d. Each tool card production module: This module includes the user card used by the production user, emergency water purchase card and staff for authentication card, production data setting card, modify key card, recovery transfer card and other setting cards, recovery card, and prepaid card , change card, management card, test card, user card, limit card;
e. System maintenance module: including key update, water price maintenance, water meter parameter maintenance, database backup and recovery functions;
f. Report printing module: Each time the operator carries out operations such as account opening, sales of water, and replacement of cards, the system will automatically print out the transaction details. In addition, the operator can also generate a single or comprehensive statistical query and print out the generated report after query. .
3 The LSD4F8108 MCU states that the MCU has high speed and takes full advantage of the internal hardware resources: 8K Flash, 16-bit RISC instruction set, 16-bit timers, 24×4 LCD driver modules and comparator modules. And has the following characteristics:
a. Ultra-low power consumption: Under the condition of 2.2 V, 1 MHz clock, its operating current is between 0.1 A and 300 A according to different operating modes, and its operating voltage range is 1.8 V to 3.6 V;
b. Strong processing power: RISC instruction set, 27 core instructions, and rich addressing modes (7 source operands and 4 destination operands). The number of on-chip registers, there is an efficient look-up table processing method;
c. On-chip peripheral modules are rich: it has FIJIJ+ (frequency-locked loop) clock system, watchdog, 16-bit timer with three capture/compare registers (TimerA), on-chip comparator, 96-segment LCD driver, 48 general purpose I/O pins, and ports P1 and P2 have interrupt capabilities, each pin can individually select the interrupt edge, individually allow interrupts;
d. With five power-saving modes, the power-down current (RAM data retention) can be as low as 0.1 A, providing fast wake-up from standby mode and wake-up time < 6 s. Normally, the MCU is in low power mode 3, traffic detection, Ic card data operations, etc. are all woken up in an interrupt mode to save power. The use of FLASH memory, low-power design, so that when the system is static when the current is <5 A. The application of the MCU in the water meter of the smart card adopts the logic encryption card as the prepaid card, and has good security; it has a powerful power management system and operates at 3.6 V (lithium battery), and the static operating current is <3 A.
Because of these advantages of the MCU, the chip is selected when the IC card is selected for communication and development. Focusing on safety and reducing power consumption, the MCUs have the following features: low operating voltage (1.8 V to 3.6 V); ultra-low power consumption (only 0.1 IxA in operating mode 4); 16-bit RISC architecture (RISC) 150 ns instruction cycle; on-chip JTAG debug interface and FLASH type memory, in-circuit serial programming; support c language and assembly language. This system takes the MCU as the core, built-in LCD driver 24×4 segments, can reduce the volume, reduce the cost, the typical current in sleep mode is only 0.7 IxA; the power supply monitor adopts Ricoh R3111E (can choose the corresponding model according to the set threshold voltage The water meter valve adopts 2.5 V ~ 6 V DC motor. When the water meter is artificially damaged or the purchased water volume is lower than the set value, the water meter will alarm and turn off the valve in time. At the same time, the data will be stored in the internal FLASH; the MFRC522 will be used to read and write the chip. Read and write Mifare 1$50 cards for prepaid functionality.
This design uses the RC522 UART mode to communicate with the MCU. Since the MCU does not have a hardware serial port, TIMERA must be used to simulate the serial port. For the MCU, P1.0 (TimerA capture/compare output) is the TX of the UART and P1.1 (the TimerA capture/compare output) is the RX of the UART. Smart card water meter software design adopts modular design, including measurement function module, motor control module, antimagnetic interference module, Ic card processing module, Ic card and ESAM communication module, alarm module, power failure module, valve control module and display module, etc. .
Due to the many functions involved, it is necessary to allocate various internal resources of the CPU and the timing relationship of each function module. In addition to the two interrupt resources provided by the MCU, the main program of this system mainly uses the query method to query the status flags from each line, such as whether the power supply voltage drops below the allowable value, whether there is magnetic interference or not, the count pulse Whether or not there is a card insertion, etc., and corresponding processing is performed according to the obtained flag.
e. The development method is simple and efficient: The MCU has a JTAG interface, which can be easily downloaded and debugged through the JTAG controller; system initialization, magnetic interference testing, and measurement processing. The system initialization here includes setting the MCU's stack, ports, interrupts, and LCD control registers so that the CPU can work properly. The SAM module in the system is used to store data information and all levels of keys. The initialization of the SAM module is one of them. The content is read into the MCU memory; each test module is the corresponding port state of the test MCU, and the corresponding flag is set to provide the basis for the judgment of each processing module; when a measurement pulse arrives, the measurement processing module will count it. The module also has a software anti-jamming function to prevent miscalculation of the metering pulse; the card processing module implements communication between the CPU card and the SAM module, and data exchange can be performed only when the authentication between them passes, and the card is illegally swiped. Operation is prohibited and prompts are given; the alarm processing module is used to monitor the power supply voltage. Once the voltage drops to a specified value, the standby power supply is enabled and an alarm indication is displayed to prompt the user to replace the battery.
MCU interface design uses 125 ns instruction cycles. Most of the instructions are completed in one instruction cycle. The 16-bit registers and constant generators play the highest code efficiency, and the chip contains hardware multipliers, which greatly saves the operation time. The chip uses a low-power design, has five low-power modes, the supply voltage range is 1.8 V ~ 3.6 V, in the working mode: 2.2 V operating voltage 1 MHz operating frequency of 225A; in standby mode current is 0.7 IxA; power-down mode (RAM data remains unchanged) current is 0.1 A. Therefore, it is particularly suitable for occasions where long-term battery operation is used. It uses a Digitally Controlled Oscillator (DCO), which allows the conversion time from low-power mode to wake-up mode to be less than 6 Ixs. The chip has 8KB+256B Flash Memory and 256B RAM. It adopts serial on-line programming mode to provide users with flexible space for compiling the program and control parameters. The internal security fuse can make the program illegal copy.
Due to the low power consumption, small size, liquid crystal display, key addressing and other requirements of the design, the SCM chip was selected. The SCM chip showed obvious differences with other SCMs in online system design, development, debugging and practical application. Advantage.
4 Conclusion Due to the development of a small, highly integrated valve integrated IC smart meter, in order to achieve the purpose of accurate measurement of water and control of water use, development process can be seen in the FLASH microcontroller full-featured, easy to use, MCU low power consumption , low voltage, high speed and other characteristics, it is suitable for the use of battery-powered work, the use of LSD4F8108MCU to develop the smart card table program, in the Ic card water, gas, warm table applications have broad prospects. The software and hardware design introduced in this article has been implemented through actual operation and has achieved good results.
Globe valve, also known as cut-off valve, is a mandatory sealing valve, so when the valve is closed, pressure must be applied to the valve disc to force the sealing surface not to leak. When the medium enters the valve from under the valve disc, the resistance that the operating force needs to overcome is the friction force between the valve stem and the packing and the thrust generated by the pressure of the medium. The force to close the valve is greater than the force to open the valve, so the valve stem The diameter of the valve should be large, otherwise the failure of the top of the valve stem will occur. According to the connection method, it is divided into three types: flange connection, thread connection and welding connection. After the appearance of the self-sealing valve, the medium flow direction of the globe valve is changed from the top of the valve disc into the valve cavity. At this time, under the action of the medium pressure, the force to close the valve is small, but the force to open the valve is large, and the diameter of the valve stem can be adjusted accordingly. decrease. At the same time, under the action of the medium, this form of valve is also tighter. my country's valve "Three Chemicals" once stipulated that the flow direction of the globe valve should be from top to bottom. When the globe valve is opened, the opening height of the valve disc is 25% to 30% of the nominal diameter. The flow rate has reached the maximum, indicating that the valve has reached the fully open position. Therefore, the fully open position of the globe valve should be determined by the stroke of the valve disc.
Shut-Off Valve,Shutoff Valve,Automatic Shut Off Valve,Auto Shut Off Valve
Jiangsu Qiantu Trading Co., Ltd. , https://www.qtprimingpump.com