Here is a description of the principle and performance of a contactless smart card module. And the detailed program interface with MCS51 microcontroller is given.
1 Overview
The current social life mainly uses contact smart cards, which need to be in contact with the terminals of the reading and writing terminals during work. It is easy to wear, has poor parallelism and long response time. The non-contact smart card can be processed in parallel because it has no contact. Compared with the contact type, the advantages of saving 70%-90% of time are being widely used in medical, transportation, social insurance, taxation and many other fields.
The ID10/15 contactless smart card module provided here is designed for OEMs with long distance, low power consumption and small size.
2 ID10/15 module working principle
The external induction coil of ID10/15 module generates electromagnetic waves of 125KHZ. When the ID-0/1-/15 smart card is within the magnetic field range generated by ID-0/10/15, the coil in the smart card receives the energy of electromagnetic waves. The circuit in the smart card rectifies and stabilizes it as the operating voltage of the card system, and modulates the information from the received amplitude modulation pulse and sends it to the internal control logic, and sends the internal data via the antenna, ID-0/10/ 15 After receiving the data on the smart card, the code is output again according to the output format.
3 ID-0/10/15 module features
Power supply: 5VDC.
Data output interface: There are two data output formats
(1) Wiegand 26 mode
(2) ASCII mode
Card reading distance: 0/7~10cm/12~15cm @5V
Working frequency: 125KHz
Read and write ability: read only
Visual sound indication: indicator light and 2.7KHz buzzer drive output
Volume: 22*20*6mm/26*25*6mm/39*39*9mm
4 ID-0/10/15 module pin definition
Power ground
2. Reset foot (Reset Bar)
3. Antenna A
4. Antenna B
5. Grounding in ASCII mode / 5V for Wiegand 26 mode
6. CMOS/One Output
7. TTL Data/Zero Output
8. Beeper/Led
9. +4.6V~+5.5V
The ID-10 has a card reading distance of 8 cm and the ID-15 has a card reading distance of 14 cm.
5 application examples
5.1 Wiegand 26 mode
In Wiegand 26 mode, the ID-0/10/15 pin connection is as follows:
PIN1: Ground
PIN2: Reset Bar
PIN3, 4: Antenna
PIN5: connect +5VDC
PIN6: DATA 1
PIN7: DATA0
PIN8: Beeper/Led
PIN9: +4.6V~+5.5V
In Wiegand 26 mode, the ID-0/10/15 data pin output waveform is as follows:
Data0
. . .
Data1 950μs 50μs
. . .
50μs 950μs
DATA0 and DATA1 have a total of 26 low-level pulses, each of which represents a BIT data, the first BIT is the even parity of 1-13 BIT, and the 26th BIT is the odd parity of 14-26 BIT, BIT2 -BIT25 A total of 6 DIGITS (one DIGITS per 4 BIT) represents the last six digits of the card number.
{$Page$}
The program that interfaces with the MCS51 microcontroller in this mode is as follows:
ID-0_DATA0: EQU P1.7; P1.7 CONNECT TO DATA0
ID-0_DATA1: EQU P1.6; P1.6 CONNECT TO DATA1
ADDR_1: EQU 30H ;6 BYTES DATA SAVE IN INRAM 30-35H
EVEN_CHECK EQU 00H ;20H_BIT0 SAVE AS EVEN PARITY
ODD_CHECK EQU 01H ;20H_BIT1 SAVE AS ODD PARITY
EVEN_FLAG EQU 02H ;20H_BIT2
TIME_OUT_FLAG EQU 03H ;20H_BIT3
ORG 000BH
LJMP TIMER0_IN
ORG 30H
WIEGAND_START: TMOD, #01H ;
SETB EA
SETB EVEN_FLAG ;SET EVEN CHECK FLAG
CLR TIME_OUT_FLAG
MOV R2, #6 ;TOTAL 6 BYTES DATA
MOV R3, #4 ;4 BITS PER BYTE
MOV R0, #ADDR_1 ;START ADDRESS OF DATA
WIEGAND1: JNB ID-0_DATA0, WIEGAND2; DATA0 IS LOW THEN START TO OUTPUT DATA
JB ID-0_DATA1, WIEGAND1; DATA0 AND DATA1 IS HIGH THEN WAIT DATA
JB TIME_OUT_FLAG, ERR
MOV TH0, #0F8H ;2000US INTERRUPT
MOV TL0, #30H
CLR TIME_OUT_FLAG
SETB TR0 ;TIMER0 START
LCALL DELAY25US
MOV C, ID-0-DATA0
LCALL DELAY175US
JNB ID-0-DATA1, ERR
LJMP WIEGAND3
WIEGAND2: NOP
JB TIME_OUT_FLAG, ERR
MOV TH0, #0F8H ;2000US INTERRUPT
MOV TL0, #30H ;
CLR TIME_OUT_FLAG
SETB TR0 ;TIMER0 START
LCALL DELAY25US ;DELAY 25 μS
MOV C, ID-0_DATA0 ; MOVE DATA IN C REGISTER
LCALL DELAY175US
JNB ID-0-DATA, ERR
WIEGAND3: JNB EVEN_FLAG, WIEGAND_DATA; EVEN IS 0 THEN OUTPUT IS DATA
MOV EVEN_CHECK, C ; OUTPUT IS EVEN CHECK BIT
CLR EVEN_FLAG ; CLR EVEN CHECK BIT
LJMP WIEGAND1 ;RECEIVE DATA
WIEGAND_DATA: RLC A ;
DJNZ R3, WIEGAND1; BYTE IS NOT OVER
ANL A, #00001111B ; BYTE OVER
MOV @R0,A ;SAVE DATA TO INRAM
INC R0 ;INCREASE INRAM ADDRESS
MOV R3, #4 ;4 BITS PER BYTE
DJNZ R2, WIEGAND1 ; READ DATA AGAIN
ODD: JNB ID-0_DATA0, ODD_BIT; WAIT ODD CHECK BIT
JB ID-0_DATA1, ODD;
ODD_BIT: NOP ;
LCALL DELAY25US ;DELAY 25 μS
MOV C, ID-0_DATA0; ODD CHECK BIT
MOV ODD_CHECK, C ; SAVE ODD CHECK BIT
NOP
LJMP OTHER_PROGRAM ;READ CARD OVER
DELAY25US: MOV R4, #11 ;DELAY 25μS
DELAY25US_A: DJNZ R4, DELAY25US_A
NOP
RET
DELAY175US: MOV R4, #86 ;DELAY 175 μS
DELAY175US_A: DJNZ R4, DELAY175US_A
NOP
RET
TIMER0_IN: SETB TIME_OUT_FLAG
CLR TR0
RETI
ERR: NOP ;ERR EXECEL
.
.
.
LJMP WIEGAND_START ;READ DATA AGAIN
5.2 ASCII mode
In ASCII mode, the ID-0/10/15 pin connection is as follows:
PIN1: Ground PIN2: Reset Bar PIN5: Ground
PIN3, 4: Antenna
PIN6: CMOS
PIN7: TTL Data
PIN8: Beeper/Led
PIN9: +4.6V~+5.5V
In ASCII mode, the connection between ID-0/10/15 and MCS51 microcontroller is as follows:
ID-0/10/15 PIN7 80C51 UART
The 80C51 I/O waveform is as follows:
In c mode, ID-0/10/15 output data is 9600 baud rate, 8 data bits, 1 stop bit, no parity.
The output data format in this mode is as follows:
STX(02H) DATA CHSUM CR LF ETX(03H)
The checksum is the result of the 'exclusive or ' of the 5 Binary Data bytes
(the 10 ASCII data characters)
Eg: DATA=0000001164(Hex)
CHECKSUM=75H
STX (02 HEX) is the data apocalypse bit, DATA is the 10-digit card number, CR (0D HEX) is the calculator carriage return, LF (0A HEX) is the calculator line feed, and ETX (03 HEX) is the data stop bit.
The program that interfaces with the MCS51 microcontroller in this mode is as follows:
ID-0/10/15_DATA: EQU P1.7; P1.7 CONNECT TO DATA
ADDR_1: EQU 30H ;6 BYTES DATA SAVE IN INRAM 30-35H
MAIN: MOV SP, #60H ;
MAIN_1: MOV R2, #14; TOTAL 14 BYTES
MOV R0, #ADDR_1 ;
LOOP_BYTE_READ: MOV R3, #8 ;8 BITS PER BYTES
WAIT_DATA1: JB ID-0_DATA, WAIT_DATA1 ; DATA IS HIGH THEN WAIT
WAIT_DATA2: JNB ID-0_DATA, WAIT_DATA2;
LCALL DELAY_BIT_2 ;DELAY 45μS
LOOP_BIT_READ: LCALL DELAY_BIT_1 ; DELAY 95 μS
CLR EA ;INTERRUPT DISABLE
MOV C, ID-0_DATA ; MOVE DATA IN C RESIGTER
RRC A ;
DJNZ R3, LOOP_BIT_READ ; 8 BITS PER BYTE
CPL A ;
MOV @R0,A ;SAVE DATA IN NRAM
INC R0 ; INCREADE INRAM ADDRESS
LCALL DELAY_BIT_1 ;DELAY 95μS
DJNZ R2, LOOP_BYTE_READ; 14 BYTE IS NOT OVER THEN AGAIN
SETB EA ;INTERRUPT ENABLE
LJMP OTHER_PROGRAM ;READ CARD END
DELAY_BIT_1: MOV R4, #46; DELAY 95μS
DELAY_BIT_1_A: DJNZ R4, DELAY_BIT_1_A
NOP
RET
DELAY_BIT_2: MOV R4, #21 ;DELAY 45μS
DELAY_BIT_2_A: DJNZ R4, DELAY_BIT_2_A
NOP
bed side table,nesting side table,modern side table,wood side table
Guangdong Metagarden Trading Co.,Ltd , https://www.smtfurniture.com