IC card automatic refueling machine design

introduction

As we all know, the "Golden Card" project (ie, electronic money project) is one of the key projects of China's national economic information construction. Compared with magnetic cards, IC cards are widely used in financial, telecommunications, transportation, and service sectors because of their anti-magnetic, moisture-proof, safe, confidential, and non-wearing characteristics. We designed a new type of IC card automatic refueling machine for the refueling center of a certain group company in Anhui Province. The driver refueled with the “oil storage value IC card” issued by the company, and the management personnel passed the “oil quantity statistics IC card” on the fuel. The settlement management of the use situation replaces the traditional management method of manual registration and settlement, and realizes the automation of fueling and management.

1 IC card introduction

The IC card is an integrated circuit chip embedded in a plastic substrate, packaged in the form of a card, the chip has the ability to write human data and store data. We use the AT24COIA memory type IC card produced by American ATMEL Company. The serial EEPROM AT24COIA has a capacity of 1Kb (128x 8 bits), a number of times of erasing of 1001), and a data retention period of up to 100 years. The module used in this IC card conforms to the ISO/IEC7816 protocol, and its contacts are shown in Figure 1. Here cI (VCC) is the power supply terminal; c2 (NC) is not used, c3 (SCL) is the serial clock input terminal, c4 (GND) is the ground terminal, c5 (NC) is unused; c6 (SDA) is the serial port. Data input/output.


EEPROM module contact schematic

2 hardware components

The fuel dispenser control system consists of a single-chip microcomputer and memory, measurement and control, IC card interface, keyboard and display, watchdog, etc. The hardware block diagram is shown in Figure 2.


Figure 2 tanker hardware block diagram

The core of the whole machine control system is a cost-effective 89C51 single-chip microcomputer with 4K bytes of EEPROM as the program memory of the system, which simplifies the system structure. In addition, a NVSRAM DCM0064 (8K bytes) is extended as the data memory of the system to store the user's fueling information. Because the non-volatile SRAM-NVSRAM (Nonvolatile SRAM) has the EPROM, it is not easy to lose data. Change, like ordinary SRAM, can quickly read and write data, the number of reading and writing is unlimited, and its power consumption is very small, the connection method in the system is exactly the same as the general SRAM6264.

Fuel quantity detection We use a high precision vortex flow sensor, which outputs a linear relationship between the electric pulse frequency and the flow rate. At the same time, the measurement range is wide, the repeatability is good, and the long-distance non-destructive measurement is convenient. After the electric pulse signal is amplified, it is used as the input signal INTO of the external interrupt 0 of the MCU through optical isolation (TLP521), so that the frequency can be measured by combining the timer TO. The P2.5 of the single-chip microcomputer drives the 12V low-voltage relay (JRC 12M) through the transistor power amplifier (9013), and the coil of the start-stop contactor of the oil pump motor and the coil of the oil-circuit on-off solenoid valve are controlled by the contact of the relay to realize Automatic refueling.

The schematic diagram of the IC card interface circuit designed according to the electrical characteristics of the IC card is shown in Figure 3. Among them, TO (single-chip microcomputer as the regular output) provides serial clock input signal; serial I/0 is realized by P2.6 of single-chip microcomputer; TI (8 9C51 as regular input) detects the power supply of IC card, to protect IC card The current-limiting power supply is adopted; whether the IC card in the deck is detected by the single-chip microcomputer INT1 (also as a conventional input), and when the IC card is inserted, the micro switch SWi-SW2 is closed, the LED is bright, and the LED is off. .


Figure 3 IC card interface circuit schematic

The keyboard and display interface are important components of the human-machine interface. Here, the P1 port of the single-chip microcomputer directly constitutes a 4x4 non-encoded keyboard, including a 0-9 numeric key, a decimal point, a start key, a stop key, a statistics key, a query key, a calibration key, and the like. Among them, the start button: first insert the IC card by the user, wait for the staff to preset the amount of oil, ready to press the start button to achieve automatic refueling, the amount of oil added to the preset will automatically stop; stop button: used for the refueling process The abnormal situation is artificial shutdown; the statistics key: the management personnel inserts the statistics IC card, press the statistics key to write the summarized data to the card; the inquiry key: used to query the user information; the adjustment key: used for adjustment Real Time Clock.

We use the mode 0 to expand the serial port of the 89051, and use 8-bit serial people to output the shift register 74LS164 and the common anode eight-segment LED digital tube to form a display, a total of 8 bits, used to display IC card information, fueling information and related work. Status, etc. The 8 registers are connected in serial mode. Under the action of the synchronous clock TXD, the segment code is quickly moved from the RXD register and then displayed by the LED digital tube. This static display mode not only makes the CPU control simple but also obtains higher Brightness.

The “watchdog” circuit is designed to improve the operational reliability of the microcontroller system. After the system is disturbed, the program may run away, and even "dead" will affect the normal operation of the system, and even involve equipment and personal safety. However, after the MAX705 is composed of a "watchdog", the 89051 is automatically reset after the program runs, and the CPU is resumed. In addition, the CPU can also be manually reset.

3 software design

The tanker software is compiled with MCS-51 assembly language. It adopts structured and modular programming method. It is realized by keyboard scanning and related functions, display processing, oil quantity measurement, IC card reading and writing, oil pump and solenoid valve control, 20ms. Timer interrupt service, external interrupt 0 service module, etc., the main program flow chart shown in Figure 4.


Figure 4 The main program flow chart of the tanker

Reliable reading and writing of IC cards is a key issue in the design of native system software. After analyzing the read and write timing of AT24COIA, it is found that the state change on the serial 1/0 data line SDA must occur during the low effective period of the clock input SCL, and the data is sent to the EEPROM on the rising edge of the clock; When the data on the card is fetched, the data is output on the falling edge of the clock. Similarly, the SDA data change also occurs during the low-valid period of SCL, so the card data can be read during the high validity period of SCL. The following describes the programming implementation by writing an IC card as an example:

Start position


4 Conclusion

The IC card automatic refueling machine designed with 890C51 single chip as the core has high reliability of data storage and good software confidentiality. The practical application in the past year shows that the operation is simple, the reading and writing is stable, and the effect is good, which greatly improves the service efficiency of the fueling center and plays an extremely important role in the modern management of the center. In addition, with the acceleration of the economic information process, the tanker has broad application prospects in commercial gas stations. (Text / (Shanghai Jiaotong University Institute of Automation Li Zhihu Shao Huihe)

References 1. Wang Aiying. Smart Card Technology [M]. Beijing: Tsinghua University Press, 1996
2. He Limin. Design of Single Chip Application System [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 1993

Marine Plywood

Item: Film Faced Plywood
Size: 1220*2440mm,1250*2500mm or as requested
Thickness: 2.5-25mm
Core: poplar, combi, hardwood
Film: chinese brown, dynea brown, black, red
Glue: MR, WBP, Melamine
Density: 500-630kgs/cbm
Moisture: 6-14%
Thickness tolerance: +/-0.5mm
Modulus of Rupture: â‰¥30Mpa

Modulus of Elasticity: â‰¥6000Mpa

1.High bending strength

 

2.Strong nail holding

 

3.Moisture-proof and easy work

 

4.Tight construction and high strength

 

5.No ratten or decay

 

6.Low formaldehyde emission

 

7.The productions are suitable for the construction of viaduct and tall frame building

 

8.If put in boiling water for 48 hours,it still glue sticking and still formed

 

9.If used abide by illustration strictly,it can be reuse more than 50 times

 

10.Solve the problem of leaking and rough surface during construction process.Particular suiltable for watering concreat.


Marine Plywood

Marine Plywood,Marine Plywood Sheet,Certified Marine Plywood,Marin Plywood For Construction

Shouguang Bailing Wood Industry Co., LTD. , http://www.bailingfurniture.com