Radio frequency card type identification circuit

By designing the RF card type circuit, using the microcontroller and circuit unit to directly judge the voltage signals of low-frequency cards and high-frequency cards, the problem of the existing technology medium- and low-frequency cards requiring special readers to identify, and achieve low-cost and efficient card type distinction.

CN223065423UActive Publication Date: 2025-07-04HENGYANG LINGHAO ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202422470927.3
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-07-04
Estimated Expiration
2034-10-12

AI Technical Summary

Technical Problem

In the prior art, low-frequency cards and high-frequency cards need to be identified on dedicated readers respectively, resulting in high cost and low efficiency, and it is inconvenient to use dedicated readers without the need to read chip content.

Method used

A radio frequency card type circuit is designed, including an ID card discrimination voltage generation unit, an IC card discrimination voltage generation unit and a microcontroller unit. The voltage signals of low-frequency cards and high-frequency cards are directly judged through the signals and circuit design output by the microcontroller to achieve type distinction.

Benefits of technology

The discrimination of low-frequency card and high-frequency card types on the same device is realized, the operation process is simplified, the cost is reduced, and the card types are distinguished without decoding the encoded signal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN223065423U_ABST
    Figure CN223065423U_ABST
Patent Text Reader

Abstract

A radio frequency card type identification circuit comprises an ID card discrimination voltage generation unit, an IC card discrimination voltage generation unit and a microcontroller unit. The PWM signal output end of the microcontroller unit is connected to the low-frequency cycle signal input end of the ID card discrimination voltage generation unit, and the clock output end and the first I / O output end are respectively connected to the high-frequency cycle signal input end and the state control signal input end of the IC card discrimination voltage generation unit; the ID card discrimination voltage output end of the ID card discrimination voltage generation unit and the IC card discrimination voltage output end of the IC card discrimination voltage generation unit are respectively connected to the first ADC analog voltage input end and the second ADC analog voltage input end of the microcontroller unit. The circuit does not need to decode coded signals replied by the near-field low-frequency card and the high-frequency card, and only needs to directly judge the coupling voltage signals of the near-field low-frequency card or / and the high-frequency card, so that the types of the ID and IC radio-frequency cards can be distinguished.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The utility model belongs to the technical field of radio frequency identification, and particularly relates to a radio frequency card type discrimination circuit. Background Art

[0002] The applications of contactless passive radio frequency cards are very extensive. The main types are low-frequency cards operating at 125 kHz and high-frequency cards operating at 13.56 MHz. Both low-frequency cards and high-frequency cards have their own dedicated readers. The card reading module in the dedicated reader usually consists of a dedicated card reading chip as the core. One is the relatively high cost, and the other is that low-frequency cards and high-frequency cards need to be read and identified on the corresponding dedicated readers respectively. In some occasions where it is not necessary to read the chip content, only the types of low-frequency cards and high-frequency cards need to be distinguished, or only need to judge whether the card can be powered on and work properly, etc., using a dedicated reader is inconvenient and inefficient. Summary of the Invention

[0003] The purpose of the utility model is to provide a radio frequency card type discrimination circuit for the defects of the existing technologies, including an ID card discrimination voltage generation unit, an IC card discrimination voltage generation unit and a microcontroller unit. The PWM signal output end of the microcontroller unit is connected to the low-frequency cycle signal input end of the ID card discrimination voltage generation unit, and the clock output end and the first I / O output end are respectively connected to the high-frequency cycle signal input end and the state control signal input end of the IC card discrimination voltage generation unit; the ID card discrimination voltage output end of the ID card discrimination voltage generation unit is connected to the first ADC analog voltage input end of the microcontroller unit, and the IC card discrimination voltage output end of the IC card discrimination voltage generation unit is connected to the second ADC analog voltage input end of the microcontroller unit.

[0004] The ID card discrimination voltage generation unit includes an inductance coil L11, an NPN transistor V11, a PNP transistor V12, a resistor R11, a resistor R12, a resistor R13, a resistor R14, a capacitor C11, a capacitor C12, a capacitor C13, a capacitor C14, and a diode D11; the bases of the NPN transistor V11 and the PNP transistor V12 are both connected to one end of the resistor R11, and the other end of the resistor R11 is the input terminal of the low-frequency signal; the emitters of the NPN transistor V11 and the PNP transistor V12 are both connected to one end of the inductance coil L11, the other end of the inductance coil L11 is connected to one end of the capacitor C11, and the other end of the inductance coil L11 is simultaneously connected to one end of the resistor R12; the collector of the NPN transistor V11 is connected to the first power supply, the collector of the PNP transistor V12 is connected to the common ground, and the other end of the capacitor C11 is connected to the common ground; the anode of the diode D11 is connected to the other end of the R12, and the cathode of the diode D11 is respectively connected to one ends of the capacitor C12, the capacitor C13, and the resistor R13; the other ends of the capacitor C13 and the resistor R13 are both connected to the common ground, and the other end of the capacitor C12 is the output terminal of the ID card discrimination signal voltage; one ends of the resistor R14 and the capacitor C14 are connected to the output terminal of the ID card discrimination signal voltage, and the other ends of the resistor R14 and the capacitor C14 are both connected to the common ground; in the ID card discrimination voltage generation unit, there is also an in-phase amplifier circuit for the ID card discrimination signal voltage to amplify the ID card discrimination signal voltage to obtain the ID card discrimination voltage; the output terminal of the in-phase amplifier circuit for the ID card discrimination signal voltage is the output terminal of the ID card discrimination voltage.

[0005] The IC card discrimination voltage generation unit includes a control gate U21, an inductance coil L21, an NPN transistor V21, resistors R21, R22, R23, R24, R25, R26, R27, capacitors C21, C22, C23, C24, C25, C26, C27, C28 and diodes D21, D22; the two input terminals of the control gate U21 are respectively a high-frequency wave signal input terminal and a status control signal input terminal, the output terminal of U21 is connected to one end of the inductance coil L21, and the other end of the inductance coil L21 is respectively connected to one end of capacitors C21 and C22; the other end of capacitor C22 is connected to the cathode of diode D21, and both ends of capacitor C23 are respectively connected to the cathode of diode D21 and the common ground; the anode of diode D21 is connected to one end of capacitor C25, and both ends of resistor R22 and capacitor C24 are respectively connected to the anode of diode D21 and the common ground; both ends of resistor R21 are respectively connected to the anode of diode D21 and the first power supply; the other end of capacitor C25 is connected to the base of the NPN transistor V21, both ends of resistor R23 are respectively connected to the base of the NPN transistor V21 and the first power supply, and both ends of resistor R23 are respectively connected to the base of the NPN transistor V21 and the common ground; both ends of resistor R26 and capacitor C26 are respectively connected to the emitter of the NPN transistor V21 and the common ground, and both ends of resistor R25 are respectively connected to the collector of the NPN transistor V21 and the first power supply; both ends of capacitor C27 are respectively connected to the collector of the NPN transistor V21 and the anode of diode D22, the cathode of diode D22 is the IC card discrimination signal voltage output terminal, and both ends of resistor R27 and capacitor C28 are respectively connected to the cathode of diode D22 and the common ground; the IC card discrimination voltage generation unit further includes an IC card discrimination signal voltage in-phase amplification circuit that amplifies the IC card discrimination signal voltage to obtain the IC card discrimination voltage; the output terminal of the IC card discrimination signal voltage in-phase amplification circuit is the IC card discrimination voltage output terminal.

[0006] The microcontroller unit includes a microcontroller, a reset circuit, a crystal oscillator circuit and a first power supply; resistors R30 and capacitor C30 form the reset circuit, crystal XT31, capacitors C31 and C32 form the crystal oscillator circuit, and the first power supply and the common ground supply power to the microcontroller; the microcontroller includes a clock output terminal, a first I / O output terminal, a PWM signal output terminal, a first ADC analog voltage input terminal and a second ADC analog voltage input terminal.

[0007] The microcontroller unit also includes an ID card confirmation indication circuit and an IC card confirmation indication circuit; the ID card confirmation indication circuit includes an ID card confirmation indicator LED31 and a resistor R31 connected in series, one end of the series circuit of LED31 and resistor R31 is connected to the second I / O output terminal of the microcontroller, and the other end is connected to the first power supply or the common ground; the IC card confirmation indication circuit includes an IC card confirmation indicator LED32 and a resistor R32 connected in series, one end of the series circuit of LED32 and resistor R32 is connected to the third I / O output terminal of the microcontroller, and the other end is connected to the first power supply or the common ground.

[0008] The control gate U21 is a 2-input AND gate, and the microcontroller is STM32F103C8T6. The frequency of the crystal XT31 is 13.56 MHz.

[0009] The radio frequency card described above includes an ID card and an IC card; the ID card is a 125 kHz low-frequency card; the IC card is a 13.56 MHz radio frequency card and is a Type A IC card that complies with the ISO14443A protocol standard.

[0010] The beneficial effects of the present utility model are as follows: The same device (i.e., the same complete circuit) is used to discriminate the types of low-frequency cards and high-frequency cards, and it is not necessary to read the contents of the low-frequency cards and high-frequency cards during discrimination; the discrimination circuit does not use a dedicated decoding chip, nor does it demodulate the encoded signal and then decode the encoded content by the microcontroller. That is, it is not necessary to decode the encoded signals returned by the low-frequency cards and high-frequency cards. It only needs to directly judge the voltage signals returned by the low-frequency cards or high-frequency cards to realize the judgment of whether there is a (normally powered and working) low-frequency card in the near field and whether there is a (normally powered and working) high-frequency card in the near field, and realize the discrimination and distinction of the types of low-frequency cards and high-frequency cards, which is simple and easy to implement and has a low cost. Description of the Drawings

[0011] Figure 1 It is a structure diagram of the radio frequency card type discrimination circuit;

[0012] Figure 2 It is an embodiment of the ID card discrimination voltage generation unit;

[0013] Figure 3 It is an embodiment of the IC card discrimination voltage generation unit;

[0014] Figure 4 It is an embodiment of the microcontroller unit;

[0015] Figure 5 It is a flow chart of the radio frequency card type discrimination process;

[0016] Figure 6 It is an example diagram of the ID card discrimination sequence sampling data when there is no ID card in the near field;

[0017] Figure 7 It is a diagram showing the sampling data of the ID card discrimination sequence when there is an EM4305 ID card in the near field;

[0018] Figure 8 It is a diagram showing the sampling data of the ID card discrimination sequence when there is a T5557 ID card in the near field;

[0019] Figure 9 It is a diagram showing the sampling data of the IC card discrimination sequence when there is no IC card in the near field;

[0020] Figure 10 It is a diagram showing the sampling data of the IC card discrimination sequence when there is an S70 IC card in the near field;

[0021] Figure 11 It is a diagram showing the sampling data of the IC card discrimination sequence when there is an S50 IC card in the near field. Detailed implementation

[0022] The following further explains the present utility model in conjunction with the accompanying drawings. The radio frequency card described in the present utility model is a non-contact passive radio frequency card, that is, a radio frequency tag (electronic tag), including an ID card and an IC card. Further, the ID card is a 125kHz low-frequency card, for example, a low-frequency card using chips such as EM4100, EM4305, T5577, etc.; the IC card is a 13.56MHz radio frequency card and is a Type A IC card that complies with the ISO14443A protocol standard.

[0023] Figure 1 It is a circuit structure diagram for discriminating the type of radio frequency card, including an ID card discrimination voltage generation unit 100, an IC card discrimination voltage generation unit 200, and a microcontroller unit 300. The PWM signal output terminal of the microcontroller unit 300 is connected to the low-frequency cycle signal input terminal CLK1 of the ID card discrimination voltage generation unit 100, and the clock output terminal MCO and the first I / O output terminal I / O1 are respectively connected to the high-frequency cycle signal input terminal CLK2 and the status control signal input terminal TK2 of the IC card discrimination voltage generation unit 200. The ID card discrimination voltage output terminal VO12 of the ID card discrimination voltage generation unit 100 is connected to the first ADC analog voltage input terminal ADC1 of the microcontroller unit 300, and the IC card discrimination voltage output terminal VO22 of the IC card discrimination voltage generation unit 200 is connected to the second ADC analog voltage input terminal ADC2 of the microcontroller unit 300.

[0024] Figure 2This is an embodiment of an ID card discrimination voltage generation unit, which includes an inductance coil L11, an NPN transistor V11, a PNP transistor V12, a resistor R11, a resistor R12, a resistor R13, a resistor R14, a capacitor C11, a capacitor C12, a capacitor C13, a capacitor C14, and a diode D11. The bases of the NPN transistor V11 and the PNP transistor V12 are both connected to one end of the resistor R11, and the other end of the resistor R11 is the input terminal CLK1 of the low-frequency signal; the emitters of the NPN transistor V11 and the PNP transistor V12 are both connected to one end of the inductance coil L11, the other end of the inductance coil L11 is connected to one end of the capacitor C11, and the other end of the inductance coil L11 is also connected to one end of the resistor R12; the collector of the NPN transistor V11 is connected to the first power supply +VDD1, the collector of the PNP transistor V12 is connected to the common ground GND, and the other end of the capacitor C11 is connected to the common ground GND; the anode of the diode D11 is connected to the other end of R12, and the cathode of the diode D11 is respectively connected to one ends of the capacitor C12, the capacitor C13, and the resistor R13; the other ends of the capacitor C13 and the resistor R13 are both connected to the common ground GND, and the other end of the capacitor C12 is the output terminal VO11 of the ID card discrimination signal voltage; one ends of the resistor R14 and the capacitor C14 are connected to the output terminal VO11 of the ID card discrimination signal voltage, and the other ends of the resistor R14 and the capacitor C14 are both connected to the common ground GND.

[0025] Figure 2 In the embodiment, the NPN transistor V11 and the PNP transistor V12 are 2SC9013 and 2SC9012 respectively. They can also be 2SC8050 and 2SC8550 respectively, or 2SC9014 and 2SC9015 respectively, etc.; the resistance values of the resistors R11, R12, R13, and R14 are 200Ω, 200Ω, 330kΩ, and 510kΩ respectively; the capacitances of the capacitors C11, C12, C13, and C14 are 4700pF, 1000pF, 1000pF, and 4700pF respectively, the diode D11 is 1N4148, and the inductance of the inductance coil L11 is 345μH. The resonance frequency of L11 and C11 is 125kHz; since the operating frequency range of the ID radio frequency card is 100kHz to 150kHz, the low-frequency signal CLK1 is generated by the microcontroller using pulse width modulation, allowing for deviation, that is, it is not necessarily exactly 125kHz. Therefore, the inductance coil L11 is wound by itself, and its inductance, including the capacitance of the capacitor C11, should be adjusted according to the actual frequency of the low-frequency signal CLK1 to make the resonance frequency as consistent as possible with the actual frequency of the low-frequency signal CLK1. Figure 2 In the circuit, except for L11 and C11, the parameters of other circuit elements can be adjusted and changed within a certain range.

[0026] Figure 2 In the embodiment of the ID card discrimination voltage generation unit, it further includes an in-phase amplifier circuit for the ID card discrimination signal voltage that amplifies the ID card discrimination signal voltage VO11 to obtain the ID card discrimination voltage VO12; the in-phase amplifier circuit for the ID card discrimination signal voltage is composed of a resistor R15, a resistor R16, and an operational amplifier U11; the reference resistance values of the resistor R15 and the resistor R16 are 2 kΩ and 300 kΩ respectively, and the operational amplifier U11 selects a single-supply rail-to-rail operational amplifier. For example, select a single operational amplifier LMV321, SGM8521, or select a single-supply dual operational amplifier LMV358, SGM8522, or select other single-supply rail-to-rail operational amplifiers.

[0027] Figure 3 For the embodiment of the IC card discrimination voltage generation unit, it includes a control gate U21, an inductor coil L21, an NPN transistor V21, resistors R21, R22, R23, R24, R25, R26, R27, capacitors C21, C22, C23, C24, C25, C26, C27, C28, and diodes D21, D22. Figure 3 In the embodiment, the two input terminals of the control gate U21 are respectively the high-frequency signal input terminal CLK2 and the status control signal input terminal TK2, the output terminal of U21 is connected to one end of the inductor coil L21, and the other end of the inductor coil L21 is respectively connected to one end of the capacitor C21 and the capacitor C22; the other end of the capacitor C22 is connected to the cathode of the diode D21, and both ends of the capacitor C23 are respectively connected to the cathode of the diode D21 and the common ground GND; the anode of the diode D21 is connected to one end of the capacitor C25, and both ends of the resistor R22 and the capacitor C24 are respectively connected to the anode of the diode D21 and the common ground GND; both ends of the resistor R21 are respectively connected to the anode of the diode D21 and the first power supply +VDD1; the other end of the capacitor C25 is connected to the base of the NPN transistor V21, both ends of the resistor R23 are respectively connected to the base of the NPN transistor V21 and the first power supply +VDD1, and both ends of the resistor R23 are respectively connected to the base of the NPN transistor V21 and the common ground GND; both ends of the resistor R26 and the capacitor C26 are respectively connected to the emitter of the NPN transistor V21 and the common ground GND, and both ends of the resistor R25 are respectively connected to the collector of the NPN transistor V21 and the first power supply +VDD1; both ends of the capacitor C27 are respectively connected to the collector of the NPN transistor V21 and the anode of the diode D22, the cathode of the diode D22 is the IC card discrimination signal voltage output terminal VO21, and both ends of the resistor R27 and the capacitor C28 are respectively connected to the cathode of the diode D22 and the common ground GND.

[0028] Figure 3 In the embodiment, the NPN transistor V21 is 2SC9013, and 2SC8050, 2SC9014, etc. can also be selected; the resistance values of the resistors R21, R22, R23, R24, R25, R26, and R27 are 22 kΩ, 22 kΩ, 100 kΩ, 47 kΩ, 7.5 kΩ, 1 kΩ, and 5.1 kΩ respectively; the capacitance values of the capacitors C21, C22, C23, C24, C25, C26, C27, and C28 are 100 pF, 150 pF, 150 pF, 100 pF, 100 pF, 10000 pF, 100 pF, and 100 pF respectively; the diodes D21 and D22 are both 1N4148, and the inductance of the inductor coil L21 is 1 μH. The high-frequency radio signal CLK2 is generated by a 13.56 MHz crystal oscillator; the inductor coil L21 is wound by itself, and its inductance, including the capacitance value of the capacitor C21, should be adjusted to make the resonance frequency as consistent as possible with the frequency of the high-frequency radio signal CLK2. Figure 3 In the circuit, except for L21 and C21, the parameters of other circuit elements can be adjusted and changed within a certain range.

[0029] Figure 3 In the embodiment of the IC card discrimination voltage generation unit, it further includes an in-phase amplifier circuit for the IC card discrimination signal voltage that amplifies the IC card discrimination signal voltage VO21 to obtain the IC card discrimination voltage VO22; the in-phase amplifier circuit for the IC card discrimination signal voltage is composed of the resistors R28 and R29 and the operational amplifier U22; the reference resistance values of the resistors R28 and R29 are 51 kΩ and 300 kΩ respectively, and the operational amplifier U22 selects a single-supply rail-to-rail operational amplifier. For example, a single operational amplifier LMV321 or SGM8521 is selected, or a single-supply dual operational amplifier LMV358 or SGM8522 is selected together with the operational amplifier U11, or other single-supply rail-to-rail operational amplifiers are selected.

[0030] Figure 3In the embodiment, the control gate U21 is a 2-input AND gate 74HC08, and four 2-input AND gates on the same chip 74HC08 are paralleled for use to improve the driving ability; the control gate U21 can also be other 2-input AND gates or 2-input NAND gates. For example, a 2-input AND gate CD4081 can be selected, or a 2-input NAND gate 74HC00, CD4011, etc. can be selected. Similarly, multiple 2-input AND gates on the same chip are paralleled for use, or multiple 2-input NAND gates on the same chip are paralleled for use to improve the driving ability; when the control gate U21 is a 2-input AND gate or a 2-input NAND gate, the state control signal TK2 is effective when it is at a high level, and the high-frequency cycle signal CLK2 can be applied to the inductor coil L21 through the control gate U21; when the state control signal TK2 is at a low level, it is invalid, and the high-frequency cycle signal CLK2 cannot be applied to the inductor coil L21 through the control gate U21. The control gate U21 can also be a 2-input OR gate or a 2-input NOR gate. For example, a 2-input OR gate 74HC32, CD4071 can be selected, or a 2-input NOR gate 74HC02, CD4001, etc. can be selected; similarly, multiple 2-input OR gates on the same chip are paralleled for use, or multiple 2-input NOR gates on the same chip are paralleled for use to improve the driving ability; when the control gate U21 is a 2-input OR gate or a 2-input NOR gate, the state control signal TK2 is effective when it is at a low level, and the high-frequency cycle signal CLK2 can be applied to the inductor coil L21 through the control gate U21; when the state control signal TK2 is at a high level, it is invalid, and the high-frequency cycle signal CLK2 cannot be applied to the inductor coil L21 through the control gate U21.

[0031] Figure 4 This is an embodiment of a microcontroller unit. Among them, the microcontroller MCU3, the reset circuit, the crystal oscillator circuit, and the first power supply form a microcontroller minimum system. The model of the microcontroller MCU3 is STM32F103C8T6. The resistor R30 and the capacitor C30 form the reset circuit. The crystal XT31, the capacitor C31, and the capacitor C32 form the crystal oscillator circuit. The first power supply +VDD1 and the common ground GND supply power to the microcontroller MCU3. The ADC analog voltage input terminals ADC_12IN0 and ADC_12IN1 of the microcontroller MCU3 respectively input the ID card discrimination voltage VO12 and the IC card discrimination voltage VO22. The PWM signal output terminal TIM2_CH4 outputs the low-frequency cycle signal CLK1. The clock output terminal MCO outputs the high-frequency cycle signal CLK2. The I / O level output terminal PB0 outputs the state control signal TK2.

[0032] Figure 4 In it, the frequency of the crystal XT31 is 13.56 MHz, and the first power supply +VDD1 is 3.3 V. Figure 4For other component parameters, they can be selected in the usual way of forming a minimum system. For example, the resistance value of resistor R30 is 10 kΩ, and the capacitance values of capacitors C30, C31, and C32 are 0.1 μF, 22 pF, and 22 pF respectively. Figure 4 In the embodiment, the clock output terminal MCO is programmed and configured to output a crystal oscillation frequency of 13.56 MHz. The microcontroller MCU3 can be of other models, and the requirements that need to be satisfied simultaneously include: being able to output the system clock frequency (i.e., the oscillation frequency of the crystal oscillator 13.56 MHz); having two 8-bit (and above) ADCs that can independently perform high-speed continuous sampling of 8 bits, and the ADC conversion time for continuous sampling is not higher than 3 μs; having a programmed PWM output; having an I / O level control output. Low-cost STM32 F103 series single-chip microcomputers, such as STM32 F103T series and STM32 F103C series single-chip microcomputers, all meet the requirements. If the oscillation frequency of 13.56 MHz is not output by the single-chip microcomputer, an independent oscillation circuit can also be used to generate and output a high-frequency cycle signal CLK2 of 13.56 MHz.

[0033] Figure 4 In the embodiment, an ID card confirmation indication circuit and an IC card confirmation indication circuit are further included. The ID card confirmation signal LED1 is output from the I / O level output terminal PA11, and the IC card confirmation signal LED2 is output from the I / O level output terminal PA12, both of which are valid for low level. When PA11 is at low level, it controls the ID card confirmation indicator LED31 to light up, and when PA11 is at low level, it controls the IC card confirmation indicator LED32 to light up. The ID card confirmation indication circuit includes the ID card confirmation indicator LED31 and resistor R31 connected in series. One end of the series-connected LED31 and resistor R31 is connected to the ID card confirmation signal LED1 output terminal of the microcontroller MCU3, and the other end is connected to the first power supply +VDD1; if LED1 is valid for high level, the other end is connected to the common ground GND. The IC card confirmation indication circuit includes the IC card confirmation indicator LED32 and resistor R32 connected in series. One end of the series-connected LED32 and resistor R32 is connected to the IC card confirmation signal LED2 output terminal of the microcontroller MCU3, and the other end is connected to the first power supply +VDD1; if LED2 is valid for high level, the other end is connected to the common ground GND. Resistors R31 and R32 are current-limiting resistors, and their resistance values are both 300 Ω. Figure 4In the embodiment, the ADC analog voltage input terminals ADC_12IN0 and ADC_12IN1 of the MCU3 are respectively the first ADC analog voltage input terminal ADC1 and the second ADC analog voltage input terminal ADC2, the PWM signal output terminal TIM2_CH4 is the first PWM signal output terminal PWM1, the I / O level output terminal PB0 is the first I / O output terminal I / O1, the I / O level output terminal PA11 is the second I / O output terminal I / O2, and the I / O level output terminal PA12 is the third I / O output terminal I / O3.

[0034] Figure 5 It is a process flow chart for RF card type discrimination. The control steps of the microcontroller unit are as follows:

[0035] Step 1: Send a low-frequency wave signal CLK1. After W1 ms, start continuously sampling the ID card discrimination voltage VO12 and save it as the ID card discrimination sequence. The number of continuously sampled data is N1, and the continuous sampling period is T1. After the continuous sampling ends, stop sending the low-frequency wave signal CLK1. The value range of W1 is from 1 ms to 3 ms, and the typical value is 1 ms.

[0036] Step 2: Perform N1 - 2 data comparisons on the ID card discrimination sequence in sequence. In each data comparison, if the difference between the previous adjacent data of the ID card is greater than the threshold ε1, or the difference between the previous adjacent data of the ID card is greater than the threshold ε1, then the ID card difference is valid; otherwise, the ID card difference is invalid. Count the number of valid ID card differences in N1 - 2 data comparisons as E1.

[0037] Step 3: Perform discrimination processing on whether there is a near-field ID card. If the number of valid ID card differences E1 is greater than the threshold M1, it is determined that there is a near-field ID card; otherwise, it is determined that there is no near-field ID card. Further, repeat Steps 1 to 2. If the average value of the number of valid ID card differences E1 after repeating multiple times is greater than the threshold M1, it is determined that there is an ID card; otherwise, it is determined that there is no ID card. Further, when it is determined that there is an ID card, control to send an effective pulse of the ID card confirmation signal LED1 to light up LED31. The width of the effective pulse of the ID card confirmation signal LED1 is greater than or equal to 1 s and less than or equal to 10 s. Determining that there is a near-field ID card means that there is a near-field ID card that can achieve spatial (contactless) coupling of RF signals through a coupling element to achieve energy transfer, that is, there is a near-field ID card that can be powered on and work normally.

[0038] Step 4: Control to make the status control signal TK2 effective for W2 ms. The value range of W2 is from 15 ms to 50 ms, and the typical value is 15 ms. Its purpose is to provide stable energy to a near-field IC card if there is one.

[0039] Step 5: The control status control signal TK2 issues a WUPA control command and then makes the control status control signal TK2 effective. After issuing the WUPA control command, continuous sampling of the IC card discrimination voltage VO22 is started and saved as an IC card discrimination sequence. The number of continuously sampled data is N2, and the continuous sampling period is T2. After continuous sampling is completed, the control status control signal TK2 becomes ineffective, and the application of the high-frequency signal CLK2 to the inductance coil L21 is stopped.

[0040] Step 6: Starting from the N3th data position of the IC card discrimination sequence, the IC card discrimination sequence is sequentially subjected to N2 - N3 - 2 data comparisons. In each data comparison, if the difference between the adjacent data after the IC card is greater than the threshold ε2, or the difference between the second adjacent data after the IC card is greater than the threshold ε2, or the difference between the third adjacent data after the IC card is greater than the threshold ε2, then the IC card difference is valid; otherwise, the IC card difference is invalid. The number of times the IC card difference is valid in N2 - N3 - 2 data comparisons is counted as E2.

[0041] Step 7: If the number of times the IC card difference is valid E2 is greater than the threshold M2, it is determined that there is an IC card in the near field; otherwise, it is determined that there is no IC card in the near field. Further, steps 4 to 6 are repeated. If the average value of the number of times the IC card difference is valid E2 after repeating multiple times is greater than the threshold M2, it is determined that there is an IC card; otherwise, it is determined that there is no IC card. Further, when it is determined that there is an IC card, a valid pulse of the IC card confirmation signal LED2 is controlled to be issued to light LED32. The width of the valid pulse of the IC card confirmation signal LED2 is greater than or equal to 1 s and less than or equal to 10 s. Determining that there is an IC card in the near field means that there is an IC card in the near field that can achieve spatial (contactless) coupling of radio frequency signals through a coupling element and achieve energy transfer, that is, there is an IC card in the near field that can be powered on and work normally.

[0042] If continuous discrimination of the radio frequency card type is required, steps 1 to 7 are repeatedly executed.

[0043] In step 1, the value range of N1 is 120 to 220, and the typical value is 150; the range of T1 is 50 μs to 120 μs, and the typical value is 100 μs.

[0044] In step 2, the difference between the adjacent data before the ID card refers to the difference obtained by subtracting the data at the adjacent position before the current position from the data at the current position in the ID card discrimination sequence. For example, if the data at the current position is A(i), then the difference between the adjacent data before the ID card is A(i) - A(i - 1); the difference between the second adjacent data before the ID card refers to the difference obtained by subtracting the data at the second adjacent position before the current position from the data at the current position in the ID card discrimination sequence, that is, A(i) - A(i - 2).

[0045] In step 2, the method for determining the value range of the threshold ε1 is as follows: in the state where there is no ID card in the near field, execute step 1; perform N1 - 2 data comparisons on the ID card discrimination sequence in sequence to obtain N1 - 2 differences between adjacent data before the ID card and N1 - 2 differences between the previous adjacent data of the ID card; find M1 maximum values among the N1 - 2 differences between adjacent data before the ID card and the N1 - 2 differences between the previous adjacent data of the ID card, and calculate the average value of these M1 maximum values as A1min; in the state where there is an ID card in the near field, execute step 1; perform N1 - 2 data comparisons on the ID card discrimination sequence in sequence to obtain N1 - 2 differences between adjacent data before the ID card and N1 - 2 differences between the previous adjacent data of the ID card; find M1 maximum values among the N1 - 2 differences between adjacent data before the ID card and the N1 - 2 differences between the previous adjacent data of the ID card, and calculate the average value of these M1 maximum values as A1max; the threshold ε1 takes values between A1min and A1max, and the typical value is the median value between B1min and B1max. Further, A1min takes the maximum value obtained from multiple tests, and A1max takes the minimum value obtained from multiple tests.

[0046] In step 3, the number of repetitions is 2 to 10; the value range of the threshold M1 is 4 to 12. If T1 is small, M1 can be large; if T1 is large, M1 can be a little smaller. For example, when T1 is equal to 100 μs, it is recommended that M1 takes values between 5 - 10.

[0047] In step 5, the value range of N2 is 120 to 220, and the typical value is 150; the range of T2 is 2 μs to 5 μs, and the typical value is 3 μs.

[0048] In step 6, the value range of N3 is 10 to 20, and the typical value is 15; the difference between adjacent data after the IC card refers to the difference obtained by subtracting the data at the adjacent position after the current position from the data at the current position in the IC card discrimination sequence. For example, if the data at the current position is B(i), then the difference between adjacent data is B(i + 1) - B(i + 1); the difference between the previous adjacent data after the IC card refers to the difference obtained by subtracting the data at the second adjacent position after the current position from the data at the current position in the IC card discrimination sequence, that is, B(i) - B(i + 2); the difference between the second previous adjacent data after the IC card refers to the difference obtained by subtracting the data at the third adjacent position after the current position from the data at the current position in the IC card discrimination sequence, that is, B(i) - B(i + 3).

[0049] In step 6, the method for determining the value range of the threshold ε2 is as follows: in the state where there is no IC card in the near field, steps 4 and 5 are executed to find the maximum value of the data after the N3rd data in the IC card discrimination sequence, which is B1min; in the state where there is an IC card in the near field, steps 4 and 5 are executed to find the maximum value of the data after the N3rd data in the IC card discrimination sequence, which is B1max; the threshold ε2 is taken between B1min and B1max, and the typical value is the median value between B1min and B1max; alternatively, the threshold ε2 is greater than or equal to 2B1min (2 times B1min). Further, B1min takes the maximum value obtained from multiple tests, and B1max takes the minimum value obtained from multiple tests.

[0050] In step 7, the number of repetitions is 2 to 10; the value range of the threshold M2 is 2 to 10. If T2 is small, M2 can be large; if T2 is large, M2 can be small. For example, when T2 is equal to 3 μs, M2 is recommended to be taken between 3 and 5.

[0051] In step 5, the control state control signal TK2 issues a WUPA control command (0x52 control command), and its purpose is to wake up the IC card in the IDLE (idle) or HALT (sleep) state. When there is an IC card in the near field and it is woken up, it will reply with an ATQA response code. The WUPA instruction is sent using a 13.56 MHz radio frequency carrier, adopting synchronous, modified Miller (Miller) coding, and the signal is transmitted through 100% ASK (amplitude shift keying). How to use a specific signal coding method to control the control state control signal TK2 to issue a WUPA control command is a conventional technical means mastered by those skilled in the art. Controlling the control state control signal TK2 to issue a WUPA control command can also be replaced by controlling the control state control signal TK2 to issue a REQA control command (0x26), and its purpose is to wake up the IC card in the IDLE (idle) state. When there is an IC card in the near field and it is woken up by the REQA command, it will also reply with an ATQA response code.

[0052] Figure 6 It is a sampling data example diagram (multiple superpositions) of the ID card discrimination sequence when there is no ID card in the near field; Figure 7 It is a sampling data example diagram (multiple superpositions) of the ID card discrimination sequence when there is an EM4305 ID card in the near field; Figure 8Sampling data example diagram (multiple superpositions) of the ID card discrimination sequence when there is a T5557 ID card in the near field. The horizontal axis is from 0 to 200 for all, representing sampling points (including virtual sampling points), the sampling period T1 is 100 μs; the vertical axis is the sampling value for all. At the sampling point of 50, a low-frequency cycle signal CLK1 is sent out; at the sampling point of 60 (W1 equals 1 ms), continuous sampling of the ID card discrimination voltage VO12 starts and ends at the sampling point of 200, and N1 equals 141. The sampling points from 0 to 59 are all virtual sampling points, and the obtained sampling data are not the ID card discrimination sequence data in step 1. That is to say, when implementing the radio frequency card type discrimination, when executing the process of step 1, the sampling points from 0 to 59 do not need to be sampled; Figure 6 、 Figure 7 、 Figure 8 also sampled the sampling points from 0 to 59, and the purpose is to facilitate understanding of the overall picture of the ID card discrimination voltage VO12 in the process of implementing the radio frequency card type discrimination. N1 equals 141, and the ID card discrimination sequence data are A(1) to A(141) in sequence; the ID card discrimination sequence is compared N1 - 2 times, that is, 139 times; the first comparison of the difference between adjacent previous data of the ID card is A(3) - A(2), and the 139th comparison is A(141) - A(140); the first comparison of the difference between the previous adjacent data of the ID card is A(3) - A(1), and the 139th comparison is A(141) - A(139).

[0053] From Figure 6 、 Figure 7 、 Figure 8 it can be seen that after sending out the low-frequency cycle signal CLK1 and amplifying and applying it to the inductance coil L11, the ID card discrimination voltage VO12 rapidly rises to the maximum value VO12max, and then starts to decline, and the start time of the decline is earlier than the smallest W1 time point (the time point when W1 equals 1 ms is the sampling point of 60); W1 takes values from 1 to 3 ms, corresponding to the sampling time points from 60 to 80. Figure 6 When there is no ID card in the near field, VO12 basically maintains a monotonically declining process. After the sampling point of 105, the sampling value of VO12 fluctuates near 0. When the ID card enters the induction area (the coupling area generated by applying the low-frequency cycle signal CLK1 to the inductance coil L11), it will automatically repeat sending the Manchester encoding signal of its own ID number, forming a coupling voltage signal to cause VO12 to fluctuate. After sampling VO12, the fluctuation of this coupling voltage signal is reflected in Figure 7 after the sampling point of 80 (between the sampling points of 80 and 150), Figure 8 after the sampling point of 70 (between the sampling points of 70 and 150). Figure 6 、 Figure 7 、 Figure 8In the embodiment, the sampled data of the ID card discrimination sequence is 8-bit binary data. For 12-bit and 10-bit ADCs, only the high 8 bits are retained, which is equivalent to using 12-bit and 10-bit as 8-bit ADCs, reducing the sampling accuracy and facilitating the improvement of the ADC conversion speed; corresponding to Figure 2 For the circuit, by changing the amplification factor of the in-phase amplification circuit of the ID card discrimination signal voltage (changing the resistance values of resistors R15 and R16), the sampled value corresponding to VO12max (the retained high 8-bit value) is made to be between 245 and 255. The value range of the threshold ε1 is greater than 1 and less than 13, and the typical value is 7.

[0054] Figure 9 is an example diagram (multiple superpositions) of the sampled data of the IC card discrimination sequence when there is no IC card in the near field; Figure 10 is an example diagram (multiple superpositions) of the sampled data of the IC card discrimination sequence when there is a Mifare1S70 IC card in the near field; Figure 11 is an example diagram (multiple superpositions) of the sampled data of the IC card discrimination sequence when there is a Mifare1S50 IC card in the near field. The horizontal axis is from 0 to 200, representing the sampling points (including virtual sampling points), and the sampling period T2 is 3 μs; the vertical axis is the sampled value. At the 20th sampling point, the WUPA control command starts to be issued; at the 30th sampling point, continuous sampling of the IC card discrimination voltage VO22 starts and ends at the 200th sampling point, and N2 is equal to 151. The sampling points from 0 to 49 are all virtual sampling points and no data sampling is performed.

[0055] Figure 9 In, the first high pulse, that is, the high pulse between the 50th and 60th sampling points, is generated due to the influence of the tail of the WUPA command, and because there is no IC card in the near field (no load), the IC card discrimination voltage VO22 surges very high; after the 60th sampling point, the interference data is no more than 10. Figure 10 and Figure 11 In, the first pulse, that is, the pulse between the 50th and 60th sampling points, is also generated due to the influence of the tail of the WUPA command, and because there is an IC card in the near field (with load), the IC card discrimination voltage VO22 surges much lower than when there is no card. Figure 10 and Figure 11 In, after the near-field IC card receives the WUPA command, it uses subcarrier load modulation Manchester coding to reply with the ATQA response, and the modulation causes a coupled voltage signal, that is, the IC card discrimination voltage VO22 fluctuates. After sampling VO22, this coupled voltage signal fluctuation is reflected in Figure 10 and Figure 11 after the 60th sampling point (between the 60th and 90th sampling points).

[0056] Figure 9 and Figure 10 and Figure 11In the embodiment, the sampled data of the IC card discrimination sequence is 8-bit binary data. For 12-bit and 10-bit ADCs, only the high 8 bits are retained, which is equivalent to using 12-bit and 10-bit as 8-bit ADCs, reducing the sampling accuracy and facilitating the improvement of the ADC conversion speed; correspondingly Figure 3 For the circuit, by changing the amplification factor of the in-phase amplification circuit of the IC card discrimination signal voltage (changing the resistance values of resistors R28 and R29), the maximum value of the IC card discrimination voltage VO22 can be changed, and then the maximum sampled value of the interference signal when there is no card in the near field ( Figure 9 after the sampling point 60 in Figure 10 and Figure 11 the effective sampled value of the ATQA response signal when there is a card in the near field ( Figure 9 and Figure 10 and Figure 11 between the sampling points 60 and 90).

[0057] Writing a program in the microcontroller to implement the function of the RF card type discrimination circuit according to the steps described in the present invention is a conventional technique well-known to those skilled in the art.

Claims

1. A radio frequency card type discrimination circuit, characterized in that It includes an ID card discrimination voltage generation unit, an IC card discrimination voltage generation unit, and a microcontroller unit; the PWM signal output terminal of the microcontroller unit is connected to the low-frequency signal input terminal of the ID card discrimination voltage generation unit, and the clock output terminal and the first I / O output terminal are respectively connected to the high-frequency signal input terminal and the status control signal input terminal of the IC card discrimination voltage generation unit; the ID card discrimination voltage output terminal of the ID card discrimination voltage generation unit is connected to the first ADC analog voltage input terminal of the microcontroller unit, and the IC card discrimination voltage output terminal of the IC card discrimination voltage generation unit is connected to the second ADC analog voltage input terminal of the microcontroller unit.

2. The radio frequency card type discrimination circuit according to claim 1, characterized in that, The ID card discrimination voltage generation unit includes an inductance coil L11, an NPN transistor V11, a PNP transistor V12, a resistor R11, a resistor R12, a resistor R13, a resistor R14, a capacitor C11, a capacitor C12, a capacitor C13, a capacitor C14, and a diode D11; the bases of the NPN transistor V11 and the PNP transistor V12 are both connected to one end of the resistor R11, and the other end of the resistor R11 is the low-frequency signal input terminal; the emitters of the NPN transistor V11 and the PNP transistor V12 are both connected to one end of the inductance coil L11, the other end of the inductance coil L11 is connected to one end of the capacitor C11, and the other end of the inductance coil L11 is simultaneously connected to one end of the resistor R12; the collector of the NPN transistor V11 is connected to the first power supply, the collector of the PNP transistor V12 is connected to the common ground, and the other end of the capacitor C11 is connected to the common ground; the anode of the diode D11 is connected to the other end of the R12, and the cathode of the diode D11 is respectively connected to one ends of the capacitor C12, the capacitor C13, and the resistor R13; the other ends of the capacitor C13 and the resistor R13 are both connected to the common ground, and the other end of the capacitor C12 is the ID card discrimination signal voltage output terminal; one ends of the resistor R14 and the capacitor C14 are connected to the ID card discrimination signal voltage output terminal, and the other ends of the resistor R14 and the capacitor C14 are both connected to the common ground; in the ID card discrimination voltage generation unit, there is also an in-phase amplifier circuit for the ID card discrimination signal voltage to obtain the ID card discrimination voltage; the output terminal of the in-phase amplifier circuit for the ID card discrimination signal voltage is the ID card discrimination voltage output terminal; The IC card discrimination voltage generation unit includes a control gate U21, an inductance coil L21, an NPN transistor V21, resistors R21, R22, R23, R24, R25, R26, R27, capacitors C21, C22, C23, C24, C25, C26, C27, C28, and diodes D21, D22; the two input terminals of the control gate U21 are respectively a high-frequency wave signal input terminal and a status control signal input terminal, the output terminal of U21 is connected to one end of the inductance coil L21, and the other end of the inductance coil L21 is respectively connected to one end of the capacitors C21 and C22; the other end of the capacitor C22 is connected to the cathode of the diode D21, and the two ends of the capacitor C23 are respectively connected to the cathode of the diode D21 and the common ground; the anode of the diode D21 is connected to one end of the capacitor C25, and the two ends of the resistor R22 and the capacitor C24 are respectively connected to the anode of the diode D21 and the common ground; the two ends of the resistor R21 are respectively connected to the anode of the diode D21 and the first power supply; the other end of the capacitor C25 is connected to the base of the NPN transistor V21, the two ends of the resistor R23 are respectively connected to the base of the NPN transistor V21 and the first power supply, and the two ends of the resistor R23 are respectively connected to the base of the NPN transistor V21 and the common ground; the two ends of the resistor R26 and the capacitor C26 are respectively connected to the emitter of the NPN transistor V21 and the common ground, and the two ends of the resistor R25 are respectively connected to the collector of the NPN transistor V21 and the first power supply; the two ends of the capacitor C27 are respectively connected to the collector of the NPN transistor V21 and the anode of the diode D22, the cathode of the diode D22 is the IC card discrimination signal voltage output terminal, and the two ends of the resistor R27 and the capacitor C28 are respectively connected to the cathode of the diode D22 and the common ground; the IC card discrimination voltage generation unit further includes an in-phase amplifier circuit for the IC card discrimination signal voltage to obtain the IC card discrimination voltage; the output terminal of the in-phase amplifier circuit for the IC card discrimination signal voltage is the IC card discrimination voltage output terminal.

3. The radio frequency card type discrimination circuit according to claim 2, wherein The microcontroller unit includes a microcontroller, a reset circuit, a crystal oscillator circuit, and a first power supply; the resistor R30 and the capacitor C30 form the reset circuit, the crystal XT31, the capacitors C31, C32 form the crystal oscillator circuit, and the first power supply and the common ground supply power to the microcontroller; the microcontroller includes a clock output terminal, a first I / O output terminal, a PWM signal output terminal, a first ADC analog voltage input terminal, and a second ADC analog voltage input terminal.

4. The radio frequency card type discrimination circuit according to claim 3, wherein, The microcontroller unit further includes an ID card confirmation indication circuit and an IC card confirmation indication circuit; the ID card confirmation indication circuit includes an ID card confirmation indicator LED31 and a resistor R31 connected in series, and one end of the series circuit of the LED31 and the resistor R31 is connected to the second I / O output terminal of the microcontroller, and the other end is connected to the first power supply; The IC card confirmation indication circuit includes an IC card confirmation indicator light LED32 and a resistor R32 connected in series. One end of the series circuit of LED32 and resistor R32 is connected to the third I / O output terminal of the microcontroller, and the other end is connected to the first power supply.

5. The radio frequency card type discrimination circuit according to claim 4, characterized in that The control gate U21 is a 2-input AND gate.

6. The radio frequency card type discrimination circuit according to claim 5, characterized in that, The microcontroller is STM32F103C8T6.