Intelligent IC card water meter controller based on MSP430 single chip microcomputer

Publisher:考古专家Latest update time:2012-08-08 Source: 电子设计工程 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction
With the popularization of IC card applications, it is possible to use IC cards to achieve "prepaid water fee management". The current electronic water meters can be mainly divided into network type and discrete type according to the meter reading method. Since the old water meter system needs to be modified in some occasions, if the network meter reading method is used, the meter reading line needs to be laid, which brings great problems to the construction. The discrete IC card water meter charging system does not need to consider this problem, which provides great convenience for management departments and users.

1 Hardware Circuit Design
This controller uses the MSP430 microcontroller as the control core. The MSP430 series microcontroller is a 16-bit RISC architecture, ultra-low power mixed signal processor launched by TI in the United States since 1996. The power supply uses a low voltage of 1.8 to 3.6 V, and the power consumption is only 0.1 μA in RAM data retention mode, 250 μA/MIPS in active mode, and the IO port leakage current is only 50 nA (general microcontrollers are 1 to 10 μA). It is very suitable for the design of battery-powered equipment such as water, gas, heat, and electricity meters. The microcontroller system diagram is shown in Figure 1. The overall circuit scheme of the system is shown in Figure 2.

a.JPG

1.1 IC card interface circuit design
The German Siemens SLE 4442 card is used to communicate with the single-chip microcomputer to complete the functions of water meter control, user recharge and water volume checking. The IC card interface circuit is the hub for connecting the IC card and the single-chip microcomputer. This design is compatible with both 4442 cards and T5557 cards. The circuit reserves the interface between the single-chip microcomputer and the IC card. The card type can be flexibly selected according to the design needs. The SLE4442 card follows the I2C protocol, and the read and write timing is similar to I2C.
Generally speaking, the IC card can be used as long as it is directly connected to the single-chip microcomputer, but in order to make the design more stable, some resistors are added between the IC card and the single-chip microcomputer to achieve the purpose of protection. In addition, the IO port and the card in place detection require pull-up resistors to ensure that they can operate normally. The water meter standard requires that the water meter must have an anti-static function, so in the design of the IC card holder, a TVS tube is added to ensure that the IC card holder can still work normally after being subjected to static electricity. [page]
1.2 Design of E2PROM circuit
The CAT24WC02 chip is used. It is a 2 Kb serial E2PROM, compatible with the 400kHz I2C bus, with an operating voltage range of 1.8 to 6.0 V, low-power CMOS technology, and has a write protection function. When WP is high, it enters the write protection state. The page write buffer and self-timed erase cycle are 1 000 000 program/erase cycles, and can save data for 100 years. 8-pin DIPSOIC or TSSOP package, the temperature range is divided into commercial grade, industrial grade and automotive grade. This system uses a storage chip to store data in the water meter. The data stored in the E2PROM will not be lost after power failure, thus avoiding data loss caused by power failure, and the reliability is high.
1.3 Design of power supply detection circuit
The power supply detection circuit is mainly used to detect low voltage. When the power supply voltage is too low, it is detected by the low voltage detection circuit, and corresponding operations are performed to avoid unnecessary errors. The specific working principle is shown in Figure 3. When PWR_CHECK_EN is high, this circuit works. At this time, Q9 is turned on, the base of Q8 is low, the VBAT terminal is always high, Q8 is turned on, and the voltage of the WR_CHECK pin is obtained by dividing the voltage of R17 and R20. After that, the voltage of the PWR_CHECK terminal is used as the input terminal of the internal ADC of the MSP430, and compared with the 1.5 V power supply to obtain the comparison result to determine whether it is low voltage. The function of the capacitor is to prevent AD sampling errors caused by voltage mutations. The PWR_CHECK_EN port setting is mainly for low power design. Low voltage detection requires a certain time interval. When detection is not required, this port is set high to save power consumption.

b.JPG

1.4 Design of pulse detection circuit
MSP430F149 microcontroller can provide up to 1 digital I/O interface, namely P1~P7. The I/O port of MSP430 microcontroller has 8 pins. Each I/O pin can be independently set as input or output direction, and each I/O wiring can be read or written independently. The registers of all interfaces can be set or cleared independently. MSP430 series microcontrollers have rich I/O port resources and interrupt resources, among which P1 and P2 ports have interrupt capabilities. In this design, the interrupt capability of P1 and P2 ports can be used to realize the measurement of pulses. Using interrupts to complete measurement is conducive to saving microcontroller resources.

c.JPG


The pulse detection circuit is shown in Figure 4. Four reed switches evenly distributed in a ring are used to count pulses. When a magnet approaches the reed switch, the reed is attracted. At this time, just connect one end of the reed switch to the ground and the other end to the I/O port of the microcontroller. Set the I/O port of the microcontroller to allow interrupts. As the impeller rotates, the magnet in the base meter also rotates. After one circle, the four reed switches are attracted respectively, and the I/O port completes 4 counts through interrupts, thus completing the counting of pulses.

2 Software Design
The software mainly involves system clock configuration, IC card and single-chip microcomputer communication, low voltage detection program, E2PROM related program, alarm program, valve control program, LCD display program, etc. Here we mainly introduce the program design of pulse detection and communication module.
2.1 Pulse detection program
The pulse detection part is an important part of the water meter. It is mainly used for flow measurement. The entire conversion system of the water meter is based on this. The flow rate is an important indicator of the performance of the water meter. The principle of pulse detection is: when a magnet approaches the reed switch, the reed of the reed switch is attracted. According to the fact that when the four reed switches are attracted once, it means that the water flows through one circle (in this program, it is set that when the water flows through five circles, it means 1 m3 of water), the water consumption can be obtained. At this time, the cumulative water consumption is increased by 1 and stored in the E2PROM. The specific flow chart is shown in Figure 5. [page]

d.JPG

2.2 Communication Module Programming
The SLE 4442 card mainly includes three memories: 256×8-bit E2PROM main memory (address 0 to 31 is the protected data area, 24 bytes after 32 to 255 are the application data area, the data reading and writing in this area is not restricted, and the erasure and writing are affected by the encrypted memory data verification results), 32×1-bit PROM protection memory (one-time programming to protect the main memory protection data area, prevent some fixed identification parameters from being changed, and the protection memory is also affected by the encrypted memory data verification results), 4×8-bit E2PROM encryption memory. The card reading and writing process is shown in Figures 6 and 7.

e.JPG

3 Conclusion
This paper discusses the design of an IC card intelligent water meter controller with MSP430 microcontroller as the control core. The controller has the functions of water volume measurement, conversion and recharge, various abnormality inspection, and has RF and M-Bus meter reading expansion interfaces. The system realizes the electronic and intelligent charging of water, changes the unreasonable situation of charging after water use, and promotes the scientific management of water metering and charging. The device has the characteristics of simple operation, low power consumption, convenience, reliability, etc., and has a good prospect for promotion and use.

Reference address:Intelligent IC card water meter controller based on MSP430 single chip microcomputer

Previous article:Brief introduction to the timing diagram inside the microcontroller
Next article:Design of serial communication between DSP and single chip microcomputer in high power UPS

Recommended ReadingLatest update time:2024-11-16 16:02

MSP430 PWM
As for MSP430F149, there are timers A and B inside, called TimerA3 and TimerB7, so there can be 8 PWM outputs, namely TA1, TA2, TB1, TB2, TB3, TB4, TB5, TB6, which realize the adjustment and control of PWM duty cycle and output the desired PWM signal. The other two TA0 and TB0 are used for PWM cycle (or frequency) cont
[Microcontroller]
MSP430 capacitive touch wheel and LED PWM output design
Introduction As a practical and fashionable human-computer interaction method, capacitive touch technology has been widely used in various electronic products, ranging from light switches to tablet computers and touch tables. What follows is a test of how product designers can use their wisdom to design the product
[Power Management]
MSP430 capacitive touch wheel and LED PWM output design
Explanation and correction of MSP430 MCU __delay_cycles precise delay
    Here, I will discuss the issue of using __delay_cycles delay in MSP430 microcontroller.     IAR for MSP430 compiler provides a compiler built-in precise delay function (not a real Function) to provide users with accurate delay, the function prototype is:         __intrinsic void __delay_cycles(unsigned long __cycl
[Microcontroller]
How to get started with MSP430 microcontrollers for beginners
    I found that some beginners don't know how to start learning MSP430 and how to effectively master the basic application of MSP430 microcontrollers. So, in my opinion, I will talk about my suggestions for some beginners, and interested beginners may refer to it. I hope to give you a little guidance on the way to get
[Microcontroller]
MSP430 Timer A and B interrupt timing 1 second operation
/******************** TimerA0 1 second timer TIMER B 1 second timer overflow interrupt : MCLK = 2MHz DCOCLK LFXT1 = 32768Hz ACLK ***********************/ #include msp430x14x.h unsigned int i; unsigned int times,times_b; unsigned int sec; /***** Timer A initialization********/ void TimerA_Init(void) { TACT
[Microcontroller]
Design of exhibition hall personnel registration and entry system based on MSP430F149 microcontroller
    This article mainly describes the design of a personnel registration and entry system using video image analysis technology. Infrared signals of people entering and leaving the museum are collected and sent to the single-chip microcomputer MSP430F149. The single-chip microcomputer processes the signals to count th
[Microcontroller]
Design of exhibition hall personnel registration and entry system based on MSP430F149 microcontroller
MSP430F5299 clock setting (24M) and counter A usage
///////////////24MHZ时钟设置//////////////////////////////////////////////////////////////   UCSCTL3 |=SELREF__REFOCLK;    __bis_SR_register(SCG0);     //disable the FLL control loop    UCSCTL0=0X0000;//            //Set lowest possible DCOx,MODxSCG0    UCSCTL1=DCORSEL_7;           //Select DCO range 24MHz opreation      
[Microcontroller]
Design of Switching Power Supply Using MSP430 Microcontroller
1 Introduction The MSP430 series microcontroller is a new generation of 16-bit microcontroller produced by TI in the United States. It is an ultra-low power mixed signal processor (MixedSignal Processor). It has the advantages of low voltage, ultra-low power consumption, powerful processing capability, stable s
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号