News
IC card intelligent water meter
Published on:2014-12-30 9:48:38 Hits:

This paper introduces the IC card smart meter hardware design and software processes. The table has a high reliability, stability and service life, water can be prepaid, remote transmission and remote control.

Keywords smart meter IC card MCU

0 Introduction

IC card prepaid water meters based on traditional water meter for the parent table, sit on the piano with a single effort to achieve the new water control instrumentation. The one-meter effort control circuitry required to sit on the piano on the basis of the re-design of the original meter and valve control box and assembled together. In order to improve the IC card water meter precision, reliability and stability, in the design of a user-friendly design. Reduce power consumption and improve the service life, while reducing costs, not only to achieve a pre-paid, but also to achieve remote control and remote transmission of information.

Using Microchip's new microcontroller PIC16C72, in order to achieve intelligent meter, the meter has an automatic counting, automatic water supply without water, automatically save data, automatic alarm, limiting daily water consumption and other functions.

1 hardware design

Figure 1 is a block diagram of the hardware system, including the PIC16C72 microcontroller, brown-out detection circuit, pulse sampling circuit, memory, IC card interface, valve control circuit, display circuit and power supply circuit. In order to reduce power consumption, chip all use CMOS low-power devices.

1.gif

Block diagram of a hardware chart

SCM 1.1

PIC16C72 is a low voltage with 2K memory, high-performance 8-bit microcontrollers, low power idle and power-down mode. The main feature of this chip is: 2.0-6.0V wide operating voltage, low-power state current of less than 5 A, since also on reset circuit, equipped with electronic watchdog, with asynchronous serial communication port provides two timing counter, all instruction is a single byte instructions, using ASIC structure; internal procedures encrypted form, high security. Time programmable chip price is very low for the development and mass production.

1.2 Power Down Memory

EEPROM electrically erasable memory is critical circuits in the system. It not only ensures reliable power system saves all the data, but also to prevent the program runaway caused by accidental loss of data RAM area, it is crucial to improve the reliability of the system. This system uses EEPROM AT93C46, its storage capacity is 1024, the internal of 128 × 8-bit or 64 × 16 bits. 93C46 serial three-wire SPI chip operation, under instruction synchronous clock timing of receiving data port. Instruction code for nine decimal code, with seven directives, people want to read, erase enabled, erase, write, full wipe, all written and erased prohibited. The chip erase time soon, there is the programming enable protection, high reliability, endurance of up to one million times the amount of data is very suitable for small water meter system. Figure 2 shows the 93C46 microcontroller and wiring diagram.

1.gif

Figure 2 93C46 microcontroller and wiring diagram

1.3 IC card interface circuit

IC card production company selected Siemens SLE4442, the chip has a hardware logic circuit, the data is divided into the user area, password area, storage area, etc., store data access must first compare the password in the password comparison error four times since the chip lock, a higher level of security.

Figure 3 shows the CPU and IC card wiring diagram, graph form using the I 2 C bus, supports ISO / 7816-3 synchronization protocol geography. In actual use, to prevent insertion of foreign matter such as iron, V DD application CPU port individually controlled. IC card memory can store user code. The degree or amount of water purchased and other data, at each pulled into the IC card, switch S is closed, wake up and read by an interrupt port microcontroller IC card. In confirmation of the IC card is valid, read and added to the degree in which the water table, so that IC cards instead of all the work in the past manual meter reading charges.

1.gif

Figure 3 CPU and IC card wiring diagram

1.4 shows the circuit

System to reduce power consumption, the use of LCD display, and PIC16C72 no ability to drive the LCD, so using HT162LCD driver ASIC. The chip can work in static or dynamic mode, the maximum driving 128 pixels, sleep current of less than 9 A, with only three microcontroller connected to the port.

1.5 Other

① pulse sampling. There are mechanical meter runner, using magnets to cooperate with the reed, to be completed pulse sampling, CPU test pulses software debounce program.

② brown-out detection circuit. Using HT7039 chip consumes only 1 A complete battery current can detect loss of pressure. MAX810 can also be used here, such as chips.

③ power. The system uses an external three on the 5th battery. Its internal backup 1.2Ah lithium battery, use an external battery is connected, the system of water supply, if the external battery lost pressure, immediately turn off the valve, spare battery to ensure the safety valve is closed. Single-chip quiescent current of 10 A sleep less common battery can be used for more than 1 year.

2 software design

Software by the main program, power down interrupt routine, the interrupt routine and pulse interrupt routine consisting of the IC card, Figure 4, Figure 5, Figure 6 and Figure 7 are a flowchart of four software program.

1.gif

1.gif

1.gif

1.gif

Figure 7 IC card interrupt the flow chart

Main program to complete and close the valve to determine how much water, usually in a sleep state. When the remaining water table autumn 5m 3, the inner table buzzer beep to alert the user of water remaining small, dashing to purchase water. The remaining amount in the table for 0:00, cut off valve to stop water supply, thus completing the water must first pay the way. Brownout interrupt program is CPU battery after detecting loss of pressure, all data written to the EEPROM RAM area to ensure that the next power safety readout. IC card interrupt program when the user inserts the IC card, read the card data, and determine the legality of the data after the implementation of the cumulative purchase of water and open the valve to restore the water supply. Pulse interrupt is the easiest program to ensure that the correct calculation of water. 3 interrupt can wake up CPU, the main program after being awakened, after executing a program go to sleep.

Attention in the design of low-power design. Memory can be, IC card with CPU power port control, whenever power when reading and writing, not only reduces power consumption, but also to prevent the IC card is inserted into the mouth piece of iron cause power short circuit occurs.

To prevent the valve does not work for a long time cause rust, may from time to time a CPU Auto Shape valve to prevent the valve from rusting.


收缩
  • 电话咨询

  • 86 400 888 7116