Abstract Introduced the IC card smart meter hardware and software design process. The table has a high reliability, stability and life, can achieve pre-paid water supply, long-distance transmission and remote control
Key words: smart meter IC card MCU
0 INTRODUCTION
IC card is the traditional pre-paid water meters of water meters for the home table, with single-get-Qin effort to achieve control of the new water meters. The instrument of single-get-Qin efforts in the control circuit to be on the basis of the original water meter re-designed control valve box and assembled together. In order to improve the IC card meter precision, reliability and stability in the design used in the design concept of human nature. In lower power consumption, improve service life and lower costs at the same time, not only to achieve pre-paid, but also to achieve remote control and remote transmission of information.
Microchip companies using the new SCM PIC16C72, in order to achieve the intelligent meter, the meter is automatically count, automatic water supply, automatically save data, automatic alarm, restrictions on water use, and other functions.
1 hardware design
Figure 1 is a block diagram of the hardware, including PIC16C72 SCM, brown-out detection circuit, pulse sampling circuit, memory, IC card interface, the valve control circuit, the display circuit and power circuit. To reduce power consumption, all selected CMOS chip low-power devices.

Figure 1 block diagram of hardware
1.1 Microcontroller
PIC16C72 with 2 K is a memory of low-voltage, high-performance 8-bit microcontrollers, low-power idle and power-down mode. The chip is the main features of :2.0-6 .0 V-voltage, low-power state current of less than 5 A,Since also a power-on reset circuit, equipped with electronic watchdog, with asynchronous serial communication mouth, provide two timing counters, all the instructions for single-byte instructions, using ASIC structure; internal procedures encryption shape, confidentiality high. One-time programming chip prices very low, apply to the development and mass production.
1.2 Power-down memory
Erasable EEPROM memory system is the key circuit. It not only can guarantee that when the electricity system all the reliable data preservation, but also to prevent process accidents caused by RAM-run areas of data loss, it is the key to improving system reliability. The system used EEPROM AT93C46, its storage capacity of 1024, internal as 128 8-bit or 64 16λ. 93C46 for the three-SPI serial chip operation, the clock timing of receiving data simultaneously under the command mouth. Script for the nine metric yards, with seven orders, the desire of the people reading, so as to erase, erase, write, the whole shining, write and erase the entire ban. The chip erase time soon, so as to erase protection, high reliability and erase up to 1 million the number of times, very little data applicable to the water system. Figure 2 gives a 93 C46 and SCM wiring diagram.

Figure 2 93C46 microcontroller and wiring diagram
1.3 IC card interface circuit
Selection of Siemens IC card production SLE4442, the chip hardware with internal logic circuit judge, divided into user data, passwords, storage areas, storage areas need to compare data access password, the password wrong comparison after the chip four times since Lock, a higher level of security.
Figure 3 IC card for the CPU and the wiring diagram, map used in the form of I 2 C-bus, support synchronous Yu ISO/7816-3 agreement. In actual use, in order to prevent foreign body inserted metal plates, etc., V DD control of CPU mouth alone. IC card memory can store user code. Degree or the amount of water purchased and other data, in each into the IC card, switch S was closed, interrupted by SCM I wake up and read the IC card. In recognition as the legitimate IC card, which read degree water and the sum of the table, so instead of the IC card on the last meter reading of the charges all the work.

Figure 3 CPU and the IC card wiring diagram
1.4 show circuit
System to reduce power consumption, using LCD display and LCD capacity PIC16C72 not drive, use HT162LCD drive ASIC. The chip can be static or dynamic way to work, the biggest to drive 128 pixels, sleep current of less than 9 A, with only three connections SCM mouth line.
1.5 Other
pulse sampling. Meter runner in the machinery, and the use of magnets in the spring with sampling to be completed pulse, CPU in the test pulse when needed to be software Fangdou Dong procedures.
brown-out detection circuit. HT7039 chips used only current consumption of 1 A complete test battery lost pressure. Here can also use such as MAX810 chip.
power. 3 system uses an external battery power supply on the 5th. Its internal reserve 1.2 Ah Li-ion battery, an external battery to use good, the water supply system, if an external battery lost pressure, valve clearance immediately, spare batteries to ensure safety valve closed. SCM sleep after 10 A quiescent current in the following ordinary batteries can be used for more than one year.
2 software design
Software from the main program, brown-out interrupt procedures, procedures for pulse suspension and interruption procedures of IC cards, Figure 4, Figure 5, Figure 6 and 7 respectively for the four procedures of the software flow chart.

Figure 4 main program flow chart

Figure 5 brownout interrupted flow chart

Figure 6 pulse interrupted flow chart

Figure 7 IC card interrupted flow chart
Main program to complete the main water valve clearance and the number of judgement, usually in a state of sleep. When the water table in the autumn of the remaining 5 m 3, table buzzer sent the prompt to remind the few remaining water users, Please click here purchase water. Table for the remainder of 0:00 to cut off the valve and stop the water supply, water must first complete the payment method. Power-down process is interrupted in the CPU test pressure after the loss to the battery, RAM all the data into the area in EEPROM, to ensure that the next power-security read out. IC Card interrupted the proceedings when users insert the IC card, read the card data, and data to determine the legitimacy after the implementation of the cumulative purchase water, and open the water valve. Pulse disruption is the most simple procedures to ensure that the correct calculation of water. Three interruption may awaken CPU, main program in awaken after implementation of a process to sleep.
Attention in the design of a low-power design. Can be memory, IC card I used CPU power control, whenever the power supply when reading and writing, not only can reduce power consumption, but also prevent the IC card I inserted metal plates caused by power short circuit to happen.
To prevent the valve does not work the rust long dead, from time to time CPU automatically shape a valve, the valve to prevent rust.
|