summary of the invention
The present invention is directed to the defect of prior art, propose a kind of NFC radio frequency CPU card intelligent gas meter.
A kind of NFC radio frequency CPU card intelligent gas meter, is made up of master control borad and NFC radio-frequency module;
Described master control borad structure is as follows: the first single-chip microcomputer respectively with liquid crystal display drive circuit, external data storage circuit, real time clock circuit, flow pulse gathers and magnetic protection interface circuit, power-off reset protection circuit, and valve drives interface circuit, button display and control logic circuit of swiping the card, NFC radio-frequency module communication interface circuit, MCU DLL (dynamic link library) circuit is connected with power management module, and power management module is connected with power supply;
Described external data storage circuit is used for the permanent storage of control system critical data;
Described real time clock circuit is used for for history destiny certificate, gas price adjustment, strong inspection comdemning period and ladder gas price provide clock foundation;
Described button display and control logic circuit of swiping the card are for controlling button displaying time and trigger NFC radio-frequency module startup work;
Described NFC radio-frequency module communication interface circuit realizes communication by connector or cable and NFC radio-frequency module;
Described NFC radio-frequency module structure is as follows: second singlechip respectively with NFC wireless transmitter receiver circuit, power supply, main control board data communication interface circuit be connected; NFC wireless transmitter receiver circuit carries microstrip antenna with pcb board and is connected; NFC wireless transmitter receiver circuit is connected with main control board data communication interface circuit with power supply respectively;
Described main control board data communication interface circuit is for realizing the data interaction between the first single-chip microcomputer and second singlechip;
It is mutual with second singlechip non-contact data that described NFC wireless transmitter receiver circuit is used for realization.
Described flow pulse collection and magnetic protection interface circuit select open type reed capsule dipulse flow signal to sample, magnetic protection and no pulse protection.
Described first single-chip microcomputer is MSP430F series monolithic; Described second singlechip is MSP430G series monolithic.
Described power management module comprises power-fail detection circuit, low power detection circuit, mu balanced circuit and high tension protection circuit; Power-fail detection circuit, low power detection circuit, mu balanced circuit is connected with the first single-chip microcomputer respectively, high tension protection circuit ground connection.
Described high tension protection circuit adopts Transient Suppression Diode 5KP series and overcurrent protector BK series.
Beneficial effect of the present invention: NFC radio frequency CPU card intelligent gas meter of the present invention, at non-working condition condition ShiShimonoseki screen, is spread its tail during use automatically, save power, opposing high voltage capability is strong, and safety coefficient is high, and circuit voltage is stablized, numerical value is supplemented in reading with money and amendment numerical value is convenient, reliably.
embodiment 1
A kind of NFC radio frequency CPU card intelligent gas meter, is made up of master control borad and NFC radio-frequency module;
As shown in Figure 1, described master control borad structure is as follows: the first single-chip microcomputer respectively with liquid crystal display drive circuit, external data storage circuit, real time clock circuit, flow pulse collection and magnetic protection interface circuit, power-off reset protection circuit, valve drives interface circuit, button display and control logic circuit of swiping the card, NFC radio-frequency module communication interface circuit, MCU DLL (dynamic link library) circuit is connected with power management module, and power management module is connected with power supply;
Described power management module comprises power-fail detection circuit, low power detection circuit, mu balanced circuit and high tension protection circuit; Power-fail detection circuit, low power detection circuit, mu balanced circuit is connected with the first single-chip microcomputer respectively, high tension protection circuit ground connection.
MSP430F series monolithic selected by described first single-chip microcomputer, there is extra low voltage and super low-power consumption, be applicable to being applied to and adopt the battery powered environment that works long hours, adopt 16 reduced instruction sets, there is power-supply management system flexibly, multiple clock scheme and serial plate carry programming, be integrated with 16 bit registers and constant generator, code efficiency is high, embedded digital controls oscillator DCO, wakes μ s switching time 3 ~ 6 up, is designed with 16 bit timing devices, comparer, segment encode lcd driver and general purpose I/O pin.
Described power supply selects use cost cheap and the general dry cell power supply of AA type easily bought, and design service life is greater than 1 year, and operating voltage is DC6V(DC1.5Vx4).
Described external data storage circuit (EEPROM) is for the permanent storage of control system critical data, adopt CAT24WC series, I2C communication modes, data retention cycle is greater than 100 years, be greater than 100,000 times effectively erasable, this circuit work power, by single-chip microcomputer mouth line traffic control, is in non-powering state at ordinary times, to prevent the improper rewriting of data and to save system power dissipation.For ease of product maintenance, adopt the pluggable encapsulation of DIP8, facilitate system data to shift.
Described mu balanced circuit (LDO) adopts Seiko S-812C series cmos voltage voltage stabilizer, for control circuit provides DC3V and DC3.3V power supply, S-812C series LDO voltage stabilizer has the features such as height is withstand voltage, super low-power consumption, low voltage difference and larger output current, is applicable to requiring that low power consuming product uses.
Described low-voltage detection circuit adopts Seiko S-808 series high-accuracy voltage detecting device, there is low-power consumption (1uA), the features such as high precision (5%) and low cost, this circuit provides DC3.6V and DC4.5V two to keep off the low electro-detection of battery, guarantees the power work environment that control circuit is stable.When battery electric quantity is not enough, send battery low-voltage signal to the first single-chip microcomputer, the first single-chip microcomputer is after receiving useful signal, and preserve data to EEPROM, valve-off, sends alarm indication instruction.
Described power-fail detection circuit completes the detection of power-off signal, and single-chip microcomputer is after receiving useful signal, and preserve data to EEPROM, valve-off, sends alarm indication instruction simultaneously.Solving battery power down shakes the system disorders and random number problem that likely cause to need emphasis to consider.
Described high voltage protection circuit (ESD) adopts Transient Suppression Diode 5KP series and overcurrent protector BK series, prevents the high voltages such as electrostatic to the impact of control system.
Described MCU DLL (dynamic link library) circuit: this circuit, without the need to impressed voltage, can carry out repetition programming to single-chip microcomputer FLASH program area, is convenient to the program updates after design phase production debugging and batch production.
Described NFC radio-frequency module communication interface circuit realizes carrying out shake communication by connector or cable and radio-frequency module, and interface defines 6 line systems, comprises DC3V and ground wire, 4 SPI serial communication bus.Realize the data interaction between radio-frequency module MCU and main control board MCU, the reading and returning completing radio frequency CPU card and NFC device is write.
Described liquid crystal display and driving circuit (LCD): liquid crystal display adopts segment code type single color display screen; for showing maximum 99999.99 numerical information (as: surpluses; cumulative amount, unit price value and parameters etc.) and fixed character field (as: " residue " " adds up " " low electricity " and " owe to measure " " wrong card " " pass valve " " protection " " unit " etc.); driving circuit adopts the built-in LCD of single-chip microcomputer to drive, and provides LCD to show dedicated port line by configuration I/O.
Described real time clock circuit (RTC) selects SD2403AP real-time timepiece chip, and be equipped with the sub-battery ER14250H of specialized lithium, the Theoretical Design life-span reaches more than 15 years, can meet gas meter, flow meter requirement in serviceable life in 10 year, this real-time clock is mainly history destiny certificate, gas price adjustment, strong inspection comdemning period and ladder gas price and provides basis of time.
Described flow pulse collection and magnetic protection interface circuit select the sampling of open type reed capsule dipulse flow signal, magnetic protection and no pulse protection; pulse equivalency is 0.1m3/P; designed life breaks more than 500,000 magnetic fluxs, and dipulse metering can solve in monopulse metering and easily occur shaking the many enumeration problems caused.
Described power-off reset protection circuit: when the first single-chip microcomputer operating voltage is in zero working point, boundary (near minimum operating voltage); I/O port status is likely in abnomal condition; to such an extent as to affect peripheral circuit generation misoperation, cause system random number, fall the problems such as number and deadlock.For avoiding the generation of this phenomenon; circuit design adopts voltage checking chip to realize dragging down the pressure of the first monolithic processor resetting pin; namely certain value between critical point and low voltage point is by single-chip microcomputer forced resetting; reliably preserve with data before protection system power down, also can meet the requirement of the first single-chip microcomputer electrification reset in addition.
Described valve drives interface circuit can select 2 kinds of schemes, scheme one is transistor coupling control circuit, two way valve drive current more than 500mA can be provided, valve adopts electromechanical integration two-way without stall and pass type valve, reliable open and close number of times is greater than 8000 times, and running current is lower than 50mA.Scheme two adopts special valve driving chip, can provide the two way valve drive current more than 1200mA, provides level combinations by configuration single-chip microcomputer 2 delivery outlets to driving chip.
Single display inquiry is not only in described button display and control logic circuit effect of swiping the card, because the working current of radio frequency module circuit is larger, long-time unlatching radio-frequency module will greatly shorten the serviceable life of battery, therefore design adopts button logic of swiping the card effectively can avoid the generation of above problem, also can ensure the ageing of wireless card reading and stability simultaneously.
As shown in Figure 2, described NFC radio-frequency module structure is as follows: second singlechip respectively with NFC wireless transmitter receiver circuit, power supply, main control board data communication interface circuit be connected; NFC wireless transmitter receiver circuit carries microstrip antenna with pcb board and is connected; NFC wireless transmitter receiver circuit is connected with main control board data communication interface circuit with power supply respectively;
Described second singlechip (MCU) is MSP430G series monolithic, is the mixed-signal processor based on 16bitRISC, aims at and meets super low-power consumption, Ultra Low Cost demand and designing.Most high primary frequency can reach 16Mips, and Flash reaches as high as 16KBytes, and RAM reaches as high as 512Bytes, minimum encapsulation TSSOP14.
Described power supply takes from the DC3V of master control borad, and this supply voltage is controlled by master control borad single-chip microcomputer, only have when master control borad detected button swipe the card input signal time, just opened by this power supply control, the term of validity is the liquid crystal display time, and liquid crystal display terminates rear shutoffs and powers.
Described main control board data communication interface circuit realizes carrying out shake communication by connector or cable and master control borad, and interface defines 6 line systems, comprises DC3V and ground wire, 4 SPI serial communication bus.Realize the data interaction between radio-frequency module MCU and main control board MCU.
Described NFC wireless transmitter receiver circuit be based on NXP radio frequency chip CV520 realize with radio frequency CPU card or NFC device non-contact data mutual, CV520 is a low-voltage, low cost, contactless read-write chip that volume is little, frequency of operation 13.56MHz, support ISO/IEC14443TypeA and MIFARE communication protocol, effective communication distance is less than 20mm.
Described pcb board carries microstrip antenna and NFC wireless transmitter receiver circuit at same circuit board, and exempt from feeder line and connect, rectangular microstrip designs, and be made up of 4 circle inductive coils, frequency 13.56MHz, distance of reaction is less than 20mm.
As shown in Figure 3, it can realize following function to the logical flow chart of above-mentioned NFC radio frequency CPU card gas meter, flow meter work:
(1) Non-contact radio-frequency CPU card prepaying charge, adopts and meets the stored value card of financial PBOC2.0 standard and CPU card encryption logic and layer-management issuing mechanism, is the new all-purpose card system schema with most high safety grade.
(2) compatible NFC function, is applicable to up-to-date intelligent handheld device near field communication standard, supports that Third-party payment supplements mode with money.
(3) the history storage of destiny certificate, can the longest preservation accumulation gas consumption of 24 months.
(4) ladder support gas price function, algorithm comprises with gas peak valley ladder and time period consumption ladder, and wherein time period consumption ladder can realize 2 sections 3 grades and arrange the maximum 6 grades of ladder gas prices of combination.
(5) anti-dead table function, has 2 grades and extremely shows protection, the grade that decontrols that every grade of protection is corresponding different.
(6) strong inspection arranges function, can arrange according to demand and enable good general's function of regularly registering one's residence, the pre-prompting of strong inspection, protection of exceeding the time limit.
(7) unit price metering, amount balance, prestore in table the amount of money and existing unit price, and button gas equivalent converts by unit price in table and performs.
(8) preset price modification function, preset new gas price by subscriber card and price modification card and enable the date, there is delayed price modification tracing function.
(9) exceed the time limit to scrap function, can arrange table tool life cycle, expire pre-prompting, exceeds the time limit to use mandatory protection.
(10) button function of swiping card, meet system low-power consumption design, radio-frequency module is in off working state for a long time, and after only having button, liquid crystal display powers up work before terminating, the validity that can ensureing while low power consuming swipes the card communicates and stability.
(11) subscriber card data are returned and are write acquisition function, and table tool system data returns by subscriber card and data collecting card writes management system, are convenient to analysis gas situation and the maintenance of table tool.Design logic purchases gas for user purchases after gas must be swiped the card the same day, otherwise gas writing operation is sold in management system restriction, returns write ageing requirement to reach user data.