Background technology
The development of RFID technique (REID) has brought increasing convenient, such as
Logistic track, identification, all-purpose card etc..The NFC technique in RFID of growing up now on smart mobile phone also
Being a dark horse, sharing electronic business card, picture, the application connection etc. of APP smart mobile phone third party application have
Its figure.The application vector of these non-contact technologies is all card reader and card itself, and card reader is being read
The electric current of dozens or even hundreds of milliampere generally all can be consumed, in handheld device and to merit during card taking sheet
The application that consumption is sensitive, such as door lock industry, this is a bigger application bottleneck.
Card reader to be known has card whether in its " field domain ", and present usual way has three kinds:
1) capacitance detecting method
This is similar with touch key-press principle, usual situation card reader in a dormant state, when there being card close
When, changing the capacitance size around card reader induction region, single-chip microcomputer detects this capacitance variations
Just wake up card reader up and carry out normal read-write operation, after having operated, be again introduced into park mode.But, this
Detection mode is limited to by card reader configuration design, and size and the shape of this induction region directly affects
The sensitivity of capacitance variations.And the impact of the environmental factors such as temperature, humidity change, electric capacity itself also can become
Changing, this needs a powerful software algorithm to support.Owing to capacitance detecting is belonging to electric field field, and block
The reading of sheet is belonging to high frequency magnetic field, this certain interference that can bring Card Reader when.It addition, in order to
Capture owing to card is near the capacitance variations caused, need to increase many accessory external testing circuits to catch this
Individual change, relatively costly.
2) the resonance method
On the premise of not starting card reader, by Single-chip Controlling produce high-frequency impulse (13.56MHz, one
As continue 20us~50us), if there being card will become near this high-frequency signal, the voltage signal modulated
Changing, built-in AD (analog digital conversion) module of single-chip microcomputer detects when this changes it is known that there is card to lean on
Closely.The shortcoming of this method is intended to increase a lot of peripheral components, it is desirable to have extra crystal oscillator, amplifier and filtering
Circuit etc., if single-chip microcomputer does not has integrated A/D module, then also need to an external AD conversion chip, even if
Single-chip microcomputer has been internally integrated A/D module, and after opening A/D module, the operating power consumption of single-chip microcomputer will increase immediately
A lot, so also resulting in the increase of card reader power consumption.
3) query method
This method is modal method, need not increase any extra device.If card reader reads
It is ISO14443A card, asking card instruction as long as intermittently sending, seeing and returning with or without answer signal.Inspection
The principle surveying other cards is also similar to.But, owing to card is usually passive device, it is typically necessary Card Reader
After device unlatching signal radiates a period of time, after waiting that the voltage that the coupling of card interior loop obtains reaches certain value,
Could receive and resolve the order that card reader is launched.Such as just specify in ISO14443-3 agreement stipulations, Card Reader
Device must open after radio-frequency radiation 5ms could firing order, now main flow RFID/NFC read head chip
Open and launch the power consumption after receiving typically all close to 100mA, say, that card reader needs dry in 5ms disappearing
The electric current of consumption 100mA.If power consumption to be reduced, just can only reduce card seeking frequency, and this card seeking frequency and
User's impression is the most directly related.In order to there be preferable Consumer's Experience, general card seeking frequency be desirable that 3Hz with
On, in order to reach this Consumer's Experience, the average power consumption of this scheme is 5ms × 100mA/333ms=1.5mA.
In battery powered sensitive power consumption application, this power consumption is flagrant.
Summary of the invention
Present invention mainly solves circuit components used by original card detection device and method more, relatively costly,
And consuming more power consumption, be vulnerable to interference, reliability is the highest, suitable for application in low-power consumption simultaneously
Handheld device and the technical problem of sensitive power consumption industry;A kind of radio frequency card detection apparatus and radio-frequency card thereof are provided
Detection method, its circuit structure is simple, and components and parts used are less, and cost is relatively low, and needs the merit consumed
Consuming relatively low, be not easily susceptible to interference simultaneously, reliability is high, meets low-power consumption handheld device and sensitive power consumption row
The application of the non-contact card of industry needs.
Another object of the present invention is to provide a kind of radio-frequency card detection method, and it passes through self-adapting regulation method, keeps away
Exempt from the interference brought due to temperature, humidity and change in voltage, it is to avoid owing to the impact of environmental factors causes false touch
Send out, improve the reliability of radio-frequency card detection further.
The above-mentioned technical problem of the present invention is mainly addressed by following technical proposals: the present invention penetrates
Frequently card detection apparatus, including single machine unit, Transmit Receive Unit and detecting circuit, in single machine unit has
Putting comparator, single machine unit is connected with Transmit Receive Unit, the outfan of Transmit Receive Unit and detection electricity
The input on road is connected, and the outfan of detecting circuit is connected with the input of the built-in comparator of single machine unit.
The unlatching launch time of Transmit Receive Unit is controlled, when single machine unit controls radio-frequency receiving-transmitting by single machine unit
During unit opener transmissions, Transmit Receive Unit has an AC signal and exports to detecting circuit, through inspection
Wave circuit sends the signal input to the built-in comparator of single machine unit after processing, and comparator can be defeated
Going out a level, set the time through one section, single machine unit controls Transmit Receive Unit and closes transmitting signal
Time, opening timing device carries out timing simultaneously, and after a period of time, comparator output level inverts, single-chip microcomputer list
When unit detects this reverse signal, stop timing immediately, it is thus achieved that a time value.Do not have radio-frequency card close
Time, this time all floats about time value Threshold, and Threshold is pre-determined not have
Have radio-frequency card near time a time value, when have card near time, this time value can increase rapidly, because of
As long as this judges the threshold value when whether the difference of the time value sampled and Threshold sets more than one,
Just can confirm that and whether have card to close on.When confirming to have card to close on, it is then turned on whole complete agreement and reads
The process of card, such card seeking power consumption can be substantially reduced, and meets low-power consumption handheld device and sensitive power consumption row
The application of the non-contact card of industry needs.Certainly, when the single machine unit used does not has built-in comparator, logical
Cross and set up an external comparator and also can realize.But when selecting external comparator, its operating current it is also contemplated that
Power consumption may be increased.
As preferably, described detecting circuit include electric capacity C20, electric capacity C21, resistance R15, resistance R16,
Resistance R17 and diode D, the outfan of described Transmit Receive Unit is connected with the positive pole of diode D, electricity
The positive pole of one terminating diode D of the parallel circuit that appearance C20 and resistance R17 is linked to be, other end ground connection, two
The negative pole of pole pipe D is connected with one end of resistance R15, the other end of resistance R15, and a road connects described monolithic
The inverting input of the built-in comparator of machine unit, the parallel connection that another road is linked to be through electric capacity C21 and resistance R16
Circuit ground, the in-phase input end of the built-in comparator of single machine unit connects reference voltage Vref.Diode D
Use Rectifying Schottky diodes.Transmit Receive Unit is opened when launching, and has the exchange of a 13.56MHz
Signal exports, and for reducing power consumption consideration, single machine unit controls to only last for 20us this launch time,
This signal is allowed to charge to electric capacity C21 through diode D.Resistance R15 and electric capacity is determined by simulation calculation
The desired value of C21 so that in 20us, electric capacity C21 is fully charged.Comparator in-phase input end connects one
Individual fixing reference voltage Vref, when Transmit Receive Unit is not turned on launching, the homophase input of comparator
Terminal voltage is more than anti-phase input terminal voltage, comparator output high level;Open after launching, when electric capacity C21 fills
During full electricity, comparator output low level;After the signal battery has fired of 20us, single machine unit is closed and is penetrated
Frequently the transmitting of Transmit-Receive Unit, and opening timing device timing immediately, at this time the electricity of electric capacity C21 passes through resistance
R16 discharges, when electric capacity C21 electric discharge causes its voltage to be reduced to the reference voltage Vref of comparator in-phase input end
Under time, comparator output high level, output level overturn, single machine unit detects that this level overturns
Stopping the timing of intervalometer after signal immediately, it is thus achieved that a time value, this time value is exactly electric capacity C21
Discharge time.Within the identical opening time of Transmit Receive Unit, there is card when card reader, due to electricity
Source coupling, the discharge time of electric capacity C21 can than do not have card near time much larger, card is from card reader
The nearest, this discharge time is the biggest.The technical program is through judging this of size discharge time, comes
Determine whether that card is close, thus realize the detection of radio-frequency card.When confirming to have card to close on, then open
Opening whole complete agreement and read the process of card, such card seeking power consumption can be substantially reduced.Resistance R17 is individual
Pull down resistor, in order to prevent when Transmit Receive Unit is not turned on launching, inputs to the positive pole of diode D
The floating that the signal of end exists is uncertain.
As preferably, described radio frequency card detection apparatus includes indicating member and usb interface unit, and instruction is single
Unit and usb interface unit are connected with described single machine unit respectively.Indicating member is used for indicating various work
State and whether have card to close on, usb interface unit is easy to transmit various data, is improved the motility used.
As preferably, described single machine unit includes that single-chip microcomputer U3, single-chip microcomputer U3 use MSP430 monolithic
Machine;Described Transmit Receive Unit includes rf chip U1, crystal oscillator XT and antenna ANT, radio-frequency receiving-transmitting
Chip U1 uses TRF79XX rf chip;The 1 foot meridian capacitor C37 of single-chip microcomputer U3 and electric capacity C38
Parallel circuit ground connection, 2 feet of single-chip microcomputer U3 are connected with 27 feet of rf chip U1, single-chip microcomputer U3
6 feet be connected through 13 feet of resistance R21 and rf chip U1,12 feet of single-chip microcomputer U3,13 feet,
18 feet, 19 feet, 20 feet and 21 feet respectively with 28 feet of rf chip U1,25 feet, 21 feet, 24
Foot, 23 feet and 26 feet are connected, and 16 feet of single-chip microcomputer U3 are connected with the outfan of described detecting circuit 3,
28 feet of rf chip U1 are through resistance R2 ground connection, and 25 feet of rf chip U1, a road is through electricity
Resistance R3 ground connection, another road connects 14 feet of voltage VIN, rf chip U1 through resistance R32 through resistance R1
Being connected with 26 feet of single-chip microcomputer U3,12 feet of rf chip U1 are through resistance R33's and single-chip microcomputer U3
27 feet are connected, and 30 feet of rf chip U1,31 feet are connected with 3 feet, 1 foot of crystal oscillator XT respectively,
The 3 foot meridian capacitor C1 ground connection of crystal oscillator XT, the 1 foot meridian capacitor C2 ground connection of crystal oscillator XT, 2 feet of crystal oscillator XT
And 4 equal ground connection of foot;The parallel circuit that the 5 foot meridian capacitor C5 of rf chip U1 and electric capacity C15 are linked to be
Being connected with one end of inductance L1, the other end of inductance L1 is connected with one end of inductance L2, and inductance L2's is another
One end is connected through one end of resistance R18 with resistance R10, the other end of resistance R10 and described detecting circuit
Input be connected, inductance L1 and inductance L2 and contact, a road through electric capacity C7, electric capacity C18 ground connection,
A road is also had through electric capacity C8 ground connection, inductance L2 to be parallel with electric capacity C3 through electric capacity C16 ground connection, another road,
The also contact of inductance L2 and resistance R18, a road is through electric capacity C9, electric capacity C19 ground connection, and also a road is through electric capacity
C10 ground connection, another road is through also contact and the radio-frequency receiving-transmitting core of electric capacity C11 ground connection, electric capacity C7 and electric capacity C18
8 feet of sheet U1 are connected, and the also contact of electric capacity C9 and electric capacity C19 is connected with 9 feet of rf chip U1;
The also contact of resistance R18 and resistance R10 is connected with one end of resistance R5, resistance R7, resistance R5 and resistance
The series circuit of R4 is in parallel with resistance R7, and the other end of resistance R7 is through the electricity in parallel of electric capacity C4 and electric capacity C6
Road is connected with one end of antenna ANT, the other end ground connection of antenna ANT, resistance R9, electric capacity C12 and electric capacity
C13 is in parallel with antenna ANT respectively.Circuit structure is simple, and reliability is high, low in energy consumption.
As preferably, described radio frequency card detection apparatus includes indicating member and usb interface unit, and instruction is single
Unit and usb interface unit are connected with described single machine unit respectively;Described indicating member includes luminous two
Pole pipe D1, light emitting diode D2 and light emitting diode D3, light emitting diode D1 is through resistance R25 and single-chip microcomputer
30 feet of U3 are connected, and light emitting diode D2 is connected through 29 feet of resistance R26 and single-chip microcomputer U3, and luminous two
Pole pipe D3 is connected through 28 feet of resistance R27 and single-chip microcomputer U3;Described usb interface unit includes driving core
Sheet U4, transient suppressor U5 and USB interface J5, driving chip U4 uses CP2102 driving chip, wink
State suppressor U5 uses SN75240 transient suppressor, and 23 feet of single-chip microcomputer U3 are through resistance R22 and drive core
26 feet of sheet U4 are connected, and 22 feet of single-chip microcomputer U3 are connected through 25 feet of resistance R24 and driving chip U4,
7 feet of driving chip U4 and 8 feet are connected, and through the parallel circuit ground connection of electric capacity C41 and electric capacity C42, with
Time be connected with one end of resistance R28, the other end of resistance R28 is through wire jumper J4 and 1 foot of USB interface J5
Being connected, 5 feet of driving chip U4 are connected with 2 feet of USB interface J5 through resistance R29, driving chip U4
4 feet be connected with 3 feet of USB interface J5 through resistance R30,1 foot of USB interface J5,2 feet, 3 feet
It is connected with 3 feet of transient suppressor U5,5 feet, 7 feet respectively, 5 feet of USB interface J5 and transient state suppression
2 feet of device U5,4 feet, 6 feet, the 8 equal ground connection of foot, 6 feet of USB interface J5,7 feet, 8 feet and 9 feet
And connect, and through resistance R31 ground connection, the 3 foot ground connection of driving chip U4,11 feet of driving chip U4 after connecing
Through resistance R20 ground connection, 9 feet of driving chip U4 are connected through 6 feet of resistance R23 and driving chip U4,
The 6 foot meridian capacitor C39 of driving chip U4 and the parallel circuit ground connection of electric capacity 640.Indicating member is used for indicating
Various duties and whether have card to close on, usb interface unit is easy to transmit various data, improves and uses
Motility, and circuit structure is simple, and reliability is high, low in energy consumption.
The radio-frequency card detection method of the present invention is, the radio-frequency receiving-transmitting list described in described single machine unit controls
The unlatching launch time of unit;When single machine unit controls Transmit Receive Unit opener transmissions, radio frequency is received
Bill unit has an AC signal and exports to described detecting circuit, detecting circuit process after output signal again
To the built-in comparator of described single machine unit, comparator output low level;When single machine unit controls to penetrate
Frequently, when Transmit-Receive Unit is closed and launched signal, opening timing device carries out timing simultaneously, after a period of time, due to institute
The output signal of the detecting circuit stated changes and makes described comparator output high level, now, single-chip microcomputer
Unit stops intervalometer timing immediately, it is thus achieved that time value T, single machine unit calculate Δ T
The value of=T-Threshold, Threshold be pre-determined do not have radio-frequency card near time a time value,
When threshold value OFFSET that Δ T sets more than, then single machine unit is thought has radio-frequency card to close on, and opens
Radio-frequency card reads process, otherwise then thinks and close on without radio-frequency card, is not turned on radio-frequency card and reads process.Significantly drop
Low card seeking power consumption.
As preferably, described detecting circuit include electric capacity C20, electric capacity C21, resistance R15, resistance R16,
Resistance R17 and diode D, the outfan of described Transmit Receive Unit is connected with the positive pole of diode D, electricity
The positive pole of one terminating diode D of the parallel circuit that appearance C20 and resistance R17 is linked to be, other end ground connection, two
The negative pole of pole pipe D is connected with one end of resistance R15, the other end of resistance R15, and a road connects described monolithic
The inverting input of the built-in comparator of machine unit, the parallel connection that another road is linked to be through electric capacity C21 and resistance R16
Circuit ground, the in-phase input end of the built-in comparator of single machine unit connects reference voltage Vref;Described penetrates
Frequently card test method is: when single machine unit controls Transmit Receive Unit opener transmissions, radio-frequency receiving-transmitting
Unit has an AC signal output, and this signal diode D in described detecting circuit is to electric capacity
C21 charges, when electric capacity C21 is fully charged, and the built-in comparator output low level of described single machine unit;Warp
Spend one period set, single machine unit when controlling Transmit Receive Unit closedown transmitting signal, open simultaneously
Opening intervalometer and carry out timing, now the electricity of electric capacity C21 is discharged by resistance R16, when electric discharge causes electric capacity
When the voltage of C21 is reduced under the reference voltage Vref of described comparator, comparator output high level,
Single machine unit stops intervalometer timing immediately, it is thus achieved that time value T, single machine unit calculate Δ
The value of T=T-Threshold, Threshold be pre-determined do not have radio-frequency card near time a time value,
When threshold value OFFSET that Δ T sets more than, then single machine unit is thought has radio-frequency card to close on, and opens
Radio-frequency card reads process, otherwise then thinks and close on without radio-frequency card, is not turned on radio-frequency card and reads process.Significantly drop
Low card seeking power consumption.
As preferably, described pre-determined do not have radio-frequency card near time time value Threshold
Being a dynamic value, dynamic value Threshold is obtained by self-adapting regulation method, described self-adaptative adjustment
Method comprises the steps:
A. in described single machine unit, open up a spatial cache Buf [i], i=0~11, first take 12
Without radio-frequency card close to time intervalometer time sampling value, these 12 time sampling values are averaging, with this put down
Average is filled in Buf [0]~Buf [11], and spatial cache Buf [i] has just had initial value;
B. first pass through weighting algorithm obtain dynamic value Threshold:
Threshold1=(Buf [0]+Buf [1]+Buf [2])/8,
Threshold2=(Buf [3]+Buf [4]+Buf [5])/8,
Threshold3=(Buf [6]+Buf [7]+Buf [8])/4,
Threshold4=(Buf [9]+Buf [10]+Buf [11])/2,
Threshold=(Threshold1+Threshold2+Threshold3+Threshold4)/4;
Then newly enter time sampling value T and described dynamic value Threshold are compared,
If (T-Threshold) > OFFSET, OFFSET are setting values, OFFSET is a constant, is considered as
There is radio-frequency card close;If (T-Threshold) < OFFSET is taken as fluctuation of sampling normally, then by this
Individual T and Buf [i] newly entered compares, and the initial value of i is 0, if T more than Buf [i] with regard to direct substitution fall this
Individual Buf [i], if T less than Buf [i], then i=i+1, is assigned to Buf [i] T, after have again and meet
The Buf [i] that first and recently the T value newly entered of normal sampling fluctuation is replaced compares, successively
Analogize, as i=12, need to reclassify 0;
C. often newly enter time sampling value T, repeat step b, thus obtain dynamic value Threshold.
This constant of OFFSET, is a most suitable value by selecting after many experiments.In experiment,
By card near card reader, such as distance card reader 5cm, obtain time value Y, do not have card near time obtain
Time value X, just obtains this value of OFFSET by Y-X.Through many experiments, select a most suitable value,
Setting value as OFFSET.
In actual use, (such as battery supplies often due to the change of temperature, humidity and card reader voltage
Piezoelectric voltage changes), also result in the situation that time value Threshold when not blocking close changes, thus
Cause Δ T more than threshold value OFFSET.These environmental factorss meeting false triggering card reader, causes the identification of mistake to have
Card is close.But, the change that these factors cause is all slowly varying, and the technical program is by using
Self-adapting regulation method obtains dynamic value Threshold, and T discharge time every time detected is dynamic with this
Value Threshold compares, and so can avoid the false triggering brought due to environmental factors, improves reliability.
In the technical program, i value is the biggest, and sampled value Buf [i] is the newest, Buf [i] value newly entered, in weighting
Algorithm occupies and more weights proportion, make dynamic value Threshold of acquisition more meet under prevailing circumstances and do not have
Block close to time time sampling value, reduce the impact that brings of environmental factors to a greater extent, it is to avoid false triggering.
The invention has the beneficial effects as follows: testing circuit simple in construction, components and parts used are less, and cost is relatively low,
And it is substantially reduced whether detection card closes on the power consumption of required consumption, simultaneously by self-adapting regulation method,
Avoid the interference brought due to temperature, humidity and change in voltage, it is to avoid owing to the impact of environmental factors causes by mistake
Trigger, improve reliability, meet the application of the non-contact card of low-power consumption handheld device and sensitive power consumption industry
Need.
Embodiment: the radio frequency card detection apparatus of the present embodiment, as it is shown in figure 1, include single machine unit 1, penetrate
Frequently Transmit-Receive Unit 2, detecting circuit 3, indicating member 4 and usb interface unit 5, in single machine unit 1 has
Put comparator, Transmit Receive Unit 2, indicating member 4 and usb interface unit 5 respectively with single machine unit 1
Being connected, the outfan of Transmit Receive Unit 2 is connected with the input of detecting circuit 3, detecting circuit 3 defeated
Go out end to be connected with the input of the built-in comparator of single machine unit 1.
As shown in Figure 2 and Figure 3, single machine unit 1 includes that single-chip microcomputer U3, single-chip microcomputer U3 use MSP430
Single-chip microcomputer;Transmit Receive Unit 2 includes rf chip U1, crystal oscillator XT and antenna ANT, radio-frequency receiving-transmitting
Chip U1 uses TRF79XX rf chip, and the frequency of crystal oscillator XT is 13.56MHz;Detecting circuit 3
Including electric capacity C20, electric capacity C21, resistance R15, resistance R16, resistance R17 and diode D.Single-chip microcomputer
The 1 foot meridian capacitor C37 of U3 and the parallel circuit ground connection of electric capacity C38,2 feet of single-chip microcomputer U3 and radio-frequency receiving-transmitting
27 feet of chip U1 are connected, and 6 feet of single-chip microcomputer U3 are through 13 feet of resistance R21 and rf chip U1
Being connected, 12 feet of single-chip microcomputer U3,13 feet, 18 feet, 19 feet, 20 feet and 21 feet are respectively and radio-frequency receiving-transmitting
28 feet of chip U1,25 feet, 21 feet, 24 feet, 23 feet and 26 feet are connected, rf chip U1
28 feet through resistance R2 ground connection, 25 feet of rf chip U1, a road through resistance R3 ground connection, another
Road connects 14 feet of voltage VIN, rf chip U1 through resistance R32's and single-chip microcomputer U3 through resistance R1
26 feet are connected, and 12 feet of rf chip U1 are connected through 27 feet of resistance R33 and single-chip microcomputer U3, penetrate
Frequently 30 feet of transceiving chip U1,31 feet are connected with 3 feet, 1 foot of crystal oscillator XT respectively, the 3 of crystal oscillator XT
Foot meridian capacitor C1 ground connection, the 1 foot meridian capacitor C2 ground connection of crystal oscillator XT, 2 feet and 4 feet of crystal oscillator XT all connect
Ground;Parallel circuit that the 5 foot meridian capacitor C5 of rf chip U1 and electric capacity C15 are linked to be and inductance L1's
One end is connected, and the other end of inductance L1 is connected with one end of inductance L2, and the other end of inductance L2 is through resistance R18
Being connected with one end of resistance R10, the other end of resistance R10 is connected with the positive pole of diode D, electric capacity C20
The positive pole of one terminating diode D of the parallel circuit being linked to be with resistance R17, other end ground connection, diode D
Negative pole be connected with one end of resistance R15, the other end of resistance R15, a road and 16 feet of single-chip microcomputer U3
Be connected, i.e. the inverting input of the built-in comparator of single-chip microcomputer U3, another road is through electric capacity C21 and resistance R16
The parallel circuit ground connection being linked to be, the in-phase input end of the built-in comparator of single-chip microcomputer U3 connects reference voltage Vref,
In the present embodiment, this reference voltage Vref uses the internal reference voltage 0.5V, inductance L1 of single-chip microcomputer U3
With the also contact of inductance L2, a road is through electric capacity C7, electric capacity C18 ground connection, and also a road is through electric capacity C16 ground connection,
Another road, through electric capacity C8 ground connection, inductance L2 is parallel with the also contact of electric capacity C3, inductance L2 and resistance R18,
One tunnel is through electric capacity C9, electric capacity C19 ground connection, and also a road is through electric capacity C10 ground connection, and another road is through electric capacity C11
Ground connection, electric capacity C7 and electric capacity C18 and contact be connected with 8 feet of rf chip U1, electric capacity C9 with
The also contact of electric capacity C19 is connected with 9 feet of rf chip U1;Resistance R18 and resistance be R10's and connect
Point is connected with one end of resistance R5, resistance R7, and the series circuit of resistance R5 and resistance R4 is with resistance R7 also
Connection, the other end of resistance R7 is connected with one end of antenna ANT through the parallel circuit of electric capacity C4 and electric capacity C6,
The other end ground connection of antenna ANT, resistance R9, electric capacity C12 and electric capacity C13 are in parallel with antenna ANT respectively.
Indicating member 4 includes light emitting diode D1, light emitting diode D2 and light emitting diode D3, luminescence two
Pole pipe D1 is connected through 30 feet of resistance R25 and single-chip microcomputer U3, and light emitting diode D2 is through resistance R26 and list
29 feet of sheet machine U3 are connected, and light emitting diode D3 is connected through 28 feet of resistance R27 and single-chip microcomputer U3.USB
Interface unit 5 includes driving chip U4, transient suppressor U5 and USB interface J5, and driving chip U4 uses
CP2102 driving chip, transient suppressor U5 uses SN75240 transient suppressor, 23 feet of single-chip microcomputer U3
Being connected through 26 feet of resistance R22 and driving chip U4,22 feet of single-chip microcomputer U3 are through resistance R24 and driving
25 feet of chip U4 are connected, and 7 feet of driving chip U4 and 8 feet are connected, and through electric capacity C41 and electric capacity C42
Parallel circuit ground connection, be connected with one end of resistance R28 simultaneously, the other end of resistance R28 through wire jumper J4 with
1 foot of USB interface J5 is connected, and 5 feet of driving chip U4 are through resistance R29 and 2 feet of USB interface J5
Being connected, 4 feet of driving chip U4 are connected with 3 feet of USB interface J5 through resistance R30, USB interface J5
1 foot, 2 feet, 3 feet be connected with 3 feet of transient suppressor U5,5 feet, 7 feet respectively, USB interface J5
5 feet and 2 feet of transient suppressor U5,4 feet, 6 feet, the 8 equal ground connection of foot, 6 feet of USB interface J5,
7 feet, 8 feet and 9 feet also connect, and through resistance R31 ground connection, the 3 foot ground connection of driving chip U4 after connecing, drive
11 feet of dynamic chip U4 are through resistance R20 ground connection, and 9 feet of driving chip U4 are through resistance R23 and driving chip
6 feet of U4 are connected, the 6 foot meridian capacitor C39 of driving chip U4 and the parallel circuit ground connection of electric capacity C40.
The radio-frequency card detection method of above-mentioned radio frequency card detection apparatus is: controlled rf chip by single-chip microcomputer U3
The unlatching launch time of U1;When single-chip microcomputer U3 controls rf chip U1 opener transmissions, radio frequency
Transceiving chip U1 has an AC signal output, and this signal diode D in detecting circuit 3 gives electricity
Hold C21 charging, when electric capacity C21 is fully charged, the built-in comparator output low level of single-chip microcomputer U3;Through one
The time that section sets, in the present embodiment, this sets the time as 20us, single-chip microcomputer U3 control radio-frequency receiving-transmitting
Chip U1 closes when launching signal, and single-chip microcomputer U3 opens timer internal simultaneously and carries out timing, now electric capacity
The electricity of C21 is discharged by resistance R16, when electric discharge causes the voltage of electric capacity C21 to be reduced to single-chip microcomputer U3's
Time under the reference voltage Vref of built-in comparator, comparator output high level, when single-chip microcomputer U3 detects
Stop intervalometer timing during this level reverse signal immediately, then obtain time value T, by single-chip microcomputer U3
Calculate Δ T=T-Threshold value, Threshold be pre-determined do not have radio-frequency card near time one
Time value, when threshold value OFFSET that Δ T sets more than, then single-chip microcomputer U3 thinks has radio-frequency card to close on,
Open radio-frequency card and read process, otherwise then think and close on without radio-frequency card, be not turned on radio-frequency card and read process.
In the present embodiment, pre-determined do not have radio-frequency card near time time value Threshold be
Dynamic value, dynamic value Threshold is obtained by self-adapting regulation method, self-adapting regulation method include as
Lower step:
A. in single-chip microcomputer U3, open up a spatial cache Buf [i], i=0~11, first take 12 without radio frequency
Block close to time intervalometer time sampling value, these 12 time sampling values are averaging, fill out by this meansigma methods
Being charged in Buf [0]~Buf [11], spatial cache Buf [i] has just had initial value;
B. first pass through weighting algorithm obtain dynamic value Threshold:
Threshold1=(Buf [0]+Buf [1]+Buf [2])/8,
Threshold2=(Buf [3]+Buf [4]+Buf [5])/8,
Threshold3=(Buf [6]+Buf [7]+Buf [8])/4,
Threshold4=(Buf [9]+Buf [10]+Buf [11])/2,
Threshold=(Threshold1+Threshold2+Threshold3+Threshold4)/4;
Then by newly enter time sampling value T and the dynamic value that obtained by above-mentioned weighting algorithm
Threshold compares, if (T-Threshold) > OFFSET, OFFSET are setting values, is
Individual constant, has been considered as radio-frequency card close;If (T-Threshold) < OFFSET is taken as normally
Sampling fluctuation, then T and Buf [i] this newly entered compares, and the initial value of i is 0, if T is more than Buf [i]
With regard to direct substitution fall this Buf [i], if T less than Buf [i], then i=i+1, is assigned to Buf [i] T;
The Buf [i] having the T value newly entered meeting normal sampling fluctuation first and to be recently replaced the most again enters
Row compares, the like, as i=12, need to reclassify 0;
C. often newly enter time sampling value T, repeat step b, thus obtain dynamic value Threshold, often
Dynamic value Threshold that the secondary discharge time detected, T and newly calculated compares.
Testing circuit simple in construction of the present invention, components and parts used are less, and cost is relatively low, and are substantially reduced inspection
Survey whether card closes on the power consumption of required consumption, pass through self-adapting regulation method simultaneously, it is to avoid due to temperature,
The interference that humidity and change in voltage are brought, it is to avoid owing to the impact of environmental factors causes false triggering, improves reliable
Property, meet the application needs of the non-contact card of low-power consumption handheld device and sensitive power consumption industry.