Design of automatic ticket checking machine for vehicle IC card based on single chip PIC

0 Preface

With the advancement of science and technology and the rapid development of social economy, IC cards are increasingly being used in various fields of people's lives. The car IC card automatic ticket checking machine uses the IC card that can be used repeatedly as the payment medium. The user deposits a certain amount in the ticket. When the car is in the car, the card is close to the ticket checking machine. The ticket checking machine automatically deducts the current fare and transfers it to the ticket checking machine. , realized a cashless transaction. The IC card bus automatic ticketing system can not only reduce the labor intensity of the ticket seller, but also avoid work errors, thus improving the management level of the bus company [2]. The IC card automatic ticket checking machine designed in this paper uses PIC microcontroller as the main controller to realize the design requirements of low power consumption and high reliability.

1 Car IC card automatic ticket gate function

The on-board IC card automatic ticket checking machine is a charging device used on the bus. The passenger's card data will be recorded in the in-vehicle device, and then the data in the in-vehicle device will be downloaded by the data collection box or other special equipment and sent to the data collection workstation. Branch office, incoming PC. Finally, the data is transmitted to the head office IC card management center for summary by using the communication line.

1) Ticket checking function: When there is an IC card close to the valid working range of the ticket checking machine, read the identification code of the IC card, identify the passenger category, and perform corresponding reading and writing operations. After successfully deducting the current fare, the buzzer sounds a short “drop” and the green light flashes.
2) Data storage function: Save the data of successful credit card, including turnover, user card number, credit card time, user card type and other data; cards that are incompletely processed or blacklisted can also be recorded.
3) Parameter setting function: The in-vehicle device can set the line, fare, car number, machine number and time through the setting card.
4) Query function: Press the Query button to check the passenger's credit card record, the check-in status and operation status of the driver on duty.
5) Time calibration function: The acquisition box with time calibration task can be used to automatically calibrate the clock of the vehicle.
6) Display function: It can display the passenger card type, card number, credit card time, current fare, card balance; driver card number, check-in time and other information.
7) Alarm function: including voice alarm, indicator light, LCD display. In case of insufficient balance, fake card, incorrect card swiping, blacklist card, etc., timely alarm.
8) Power monitoring function: When the system voltage is too low or power is off, the system takes self-protection measures and saves important data.

2 system hardware structure design

In the design, the low-power PIC series microcontroller is selected as the main controller. The series of single-chip microcomputers have moderate capacity, rich functions, fast running speed, reliable performance and low price, which meet the design requirements of the vehicle-mounted machine. The block diagram is shown in Figure 1.



Figure 1 Block diagram of the automatic ticket gate

2. 1 RS232 and wireless communication

The system is designed with 2 standard RS232 interfaces and a wireless communication interface. One of the RS232 interfaces is for system setup and one for communication. When collecting data, the data acquisition box is generally inserted into the RS232 communication interface for data acquisition, and the collector with wireless communication function can also be used for data collection and downlink blacklisting and operation parameters.

At present, there are many types of wireless communication used in the in-vehicle device, including infrared, bluetooth, and 2. 4G and so on. Wireless infrared technology has large bandwidth and good stability. However, the infrared wireless transmission technology has high requirements on directivity, and cannot be operated with a slight deviation from the angle; in addition, infrared wireless transmission requires higher transmission power.

2. 4G technology can work in duplex mode with a one-way transmission rate of up to 2 Mbps, but at a higher price. Due to the low cost of Bluetooth and good confidentiality, the current technology is quite mature and cost-effective, so Bluetooth technology is used in the design.

2. 2 IC card reading and writing and data storage

When the IC card is close to the reader/writer, the in-vehicle device reads various data information of the IC card and performs corresponding processing. The design uses the 13.56 MHz MF RC500 to read and write the MIFARE1 RF IC card information. The MF RC500 includes a security and password control unit that supports the fast CRYPTOI encryption algorithm and can be used to verify the Mifare1 IC card. The MF RC500 communicates with the IC card up to 100 mm. After the IC card enters the working range, the card and the reader must be authenticated three times in both directions. Only after the authentication is passed can the data be read and written. In addition, the MIFARE1 card has 16 partitions, each partition has its own read and write password and access mechanism, can be applied to different occasions or systems, has a strong scalability, can truly achieve "one card multi-use."

The memory EEPROM 24C64 is used to store data such as turnover, user card number, and blacklist. When the IC card is read and written, after successfully swiping the card, the amount of the deducted amount and the user card number will be automatically stored in 24C64.

2. 3 display and button design

The display is mainly used to complete the display of the amount deducted by the ticket checking machine and the balance of the IC card held by the user. Designed with a 128 × 64 LCD display with a font, it features low power consumption, high reliability and simple circuitry.

The button is designed with a query button and a set button. The operator presses the inquiry button once to query the last passenger's credit card record, and then presses once to query the previous passenger's credit card record; press the inquiry button twice to query the driver card number, check-in time and turnover. Press the setting button to set parameters, check the settings of the vehicle-mounted device and cancel the alarm.

2. 4 power monitoring circuit

Due to some factors, the system voltage may be too low or power down, and the power monitoring circuit can be used to save data and prevent data loss. This section selects the DS1232 monitor chip to complete. The DS1232 is a power-supply monitoring chip with a watchdog function that outputs a reset pulse on power-up, power-down, voltage transients, and crashes, making it ideal for power-supply monitoring circuits.

3 system software design

3. 1 main program

The main program flow is shown in Figure 2. In the first step, each module is initialized before the system starts to check the ticket. In the second step, when there is no IC card close to the effective working area of ​​the ticket checking machine, the display module on the ticket checking machine displays "welcome ride" and time. When there is an IC card close, first verify whether it is an IC card issued by the system. If not, use a buzzer to alarm, if yes, perform a card reading operation; in step 3, read the IC card's signature code. Identify whether the IC card is an administrator card, a driver card, or a passenger card, and execute the corresponding processing procedure. If it is not these 3 types of cards, it is judged to be a fake card and cannot be swiped.



Figure 2 main program flow chart

3. 2 passenger card processing

The processing subroutine flow of the passenger card is shown in Figure 3. After determining the passenger card, the system performs identification according to the second set of feature codes, and determines whether the card is a discount card, an elderly card, a student card, or a normal card. After the judgment is completed, the system will deduct the current fare from the balance in the IC card according to the fare set in advance, and add the deducted amount to the turnover, and save the credit card record. In order to make the system more user-friendly, after the passengers swipe the card successfully, the system makes a “beep” sound and the green light is on. When the amount in the passenger card is less than the current fare, the system will sound an alarm of “嘀, 嘀”, and the voice prompts “Insufficient balance, please coin”, the red light is on. The driver can press the setup button once to cancel the alarm. When the amount in the passenger card is less than 5 yuan, the system will prompt “please recharge” after each successful card swiping.



Figure 3 passenger card processing subroutine flow chart

3. 3 blacklist card processing

In order to prevent the illegal use of forged cards and lost cards, the system will compare the blacklists when reading the passenger card number. If a blacklist card is found, an "嘀嘀嘀" alarm sounds, the red light flashes, and the card is locked and marked. For the blacklist to be updated in real time. When the data collection box performs data processing in the data collection workstation, the workstation automatically updates the blacklist in the data collection box; when the data collection box performs data collection on the in-vehicle device, the new version blacklist is automatically downloaded to the in-vehicle device.

4 Conclusion

The use of bus on-board automatic ticket checking machines has greatly simplified the charging work in the bus industry and is more open. The designed PIC-based non-contact IC card ticket checking machine has good anti-vibration performance, high reliability and practicability. The charging process takes a short time and is easy to operate, which greatly improves the working efficiency. In addition, the non-contact IC card has a long service life, and the IC card selected in this paper has many partitions and good encryption, which lays a foundation for realizing "traffic card" in the future.

The Knife Set Chef Knife,bread knife,carving knife,utility knife,paring knife,sharpener,kitchen scissor,steak knife.You can choose packing with aluminum case, wooden block, stainless steel block.There are many assembly,for example 8pcs knife set,12pcs knife set ,20pcs knife set and more.The stainless-steel precision-honed blades for long-lasting sharpness.The ergonomic handles promote a comfortable, secure hold.

Knife Set

Knife Set,Professional Knife Set,Chef Knife Set,Knife Block Set

YANG JIANG FEETON HOME PRODUCTS CO., LTD. , https://www.feetonbbq.com

Posted on