
Hello.
I have been interested in RFID technology for a long time and today I would like to present the development of my old design, namely an RFID card reader with an integrated antenna on a PCB.
Due to the complicated structure of the antenna (small distances between the paths), the board was ordered from an external company. The heart of the project is the Attiny13A microcontroller and the EM4095 transreceiver. I used the processor in a DIP housing, because I do not have an adapter for SMD programming. Except for one resistor, everything else is in the SMD 1206. The circuit is unusual because virtually all other projects are based on large processors, eg Atmega8, Atmega32, PIC16Fxx etc., but I couldn't find something on such a small circuit.
The reader reads cards as standard UNIQUE at 125kHz . Cards are encoded with a 64-bit unique serial number.
As I mentioned, the board was commissioned to an external company - XXXXX. I am very pleased with the performance - no short circuits, despite the small distance between the tracks. High-quality tin-plating, metallization and solder mask - does not come off when heated with a soldering iron. I think that the most interesting element of the board is the antenna - it has a range of about 8 cm with the Unique card. The board has a 3x godpin strip - Tx respectively - data transmission in the TTL, GND, VCC standard (5V, also checked 3.3V - works, but the range is visibly smaller).
On the board, in addition to the processor and strip mentioned above, there is an LED signaling the card reading and the standard application of the EM4095 chip.
Firmware - microcontroller software
The software has been significantly changed compared to the first version published in the topic Link .
* increased transmission speed to 19200bps
* data is not sent as ASCII characters but as data bits. I gave up the data as ASCII code due to the simpler implementation of the algorithm in the receiving programs, either on the PC or on the AVR. Data sent this way may not be readable in some programs (eg PuTTY or hyperterminal), so I recommend Bray ++ Terminal. After putting the terminal in HEX mode, we get nice data.
* added XOR checksum. The biggest disadvantage of the previous version was the lack of a checksum. The XOR checksum is calculated according to the algorithm: (1-byte of card code data) XOR (2-byte of data card codes) XOR (3-byte of data card codes) XOR (4-byte of data card codes) XOR (5-byte of data codes cards),
e.g. we have a card specified with numbers in hexadecimal notation: 28 00 B8 60 7A then the XOR checksum looks as follows:
(28) xor (00) xor (B8) xor (60) xor (7A) = (28) ^ (00) ^ (B8) ^ (60) ^ (7A) = 8A
The reader sends 9 bytes of data:
1. # 7Eh - transmission start symbol
2.1-byte card code data (MSB)
3.2-byte card code data
4. 3-byte card code data
5. 4-byte card code data
6.5-byte card code data (LSB)
7. # 5Eh - symbol of transm. check totals
8. Checksum - XOR checksum
9. # 7Ch - symbol of end of transmission
If the card is kept in the reader field continuously, such a frame is sent every 700ms. The reader informs that the card has been read by lighting the LED for 350ms.
Due to the lack of a hardware USART interface in the microcontroller, it was necessary to use a software implementation of the UART. It is a constantly developed version and I hope that it is free from bugs and flaws. At this point, I have a question for more experienced users: how do you test this type of solution?
The program, during its work cycle, after the initial reading of the card number, decodes it (Manchester encoding) and checks the parity, this prevents sending an incorrectly received code to the receiving device (e.g. some interference, etc.).
Of course, the program was written in C (Avr Studio 4 + WinAVR-20100110) and partly in Assembler - I cannot imagine implementing this problem in the BASCOM environment for such a small processor as Attiny13. BASCOM offers RFID support through a few simple commands, but it is a terribly suboptimal solution, it takes up an awful lot of memory and is suitable for Atmega rather than Attiny.
The program takes 788 bytes.
Gross costs
Board: PLN 27 / piece (prototype)
EM4095: PLN 10
Attiny 13A: PLN 4.5
General cargo: less than PLN 1
I wrote a PC software for the reader in C # 2010. I chose the platform mainly because of the license for the entire Visual Studio package, but also the built-in, very good serial port control. The program receives data from a designated serial port, analyzes them in terms of header and checksum compliance - if everything is correct - the data goes to the user. In a similar style, I wrote uC programs in the two most popular C languages (avr-gcc) and BASCOM-BASIC.
Due to the inability to make a tile with home methods, I do not publish the pattern of the paths.
When selecting capacitors for EM4095, using the Excel file provided by the manufacturer may be inconvenient, so I wrote a simple program EM4095 Dsigner Tool presenting the data in an accessible form.
Plans for the future:
In the future, I plan to modify the Attiny PCB in SMD and add a Watch-Dog to the program.
When soldering, unfortunately I touched one via with the tip, which made it an unsightly "tuber". I am also not satisfied with the angular goldpin strip, but it was the only one I had.
To sum up:
I am very pleased with the design. It does the job and I hope it looks nice.
In the attachment I am adding a diagram, a program for receiving data (you can see what the interface looks like), the EM4095 Designer Tool program, about which I wrote earlier, and catalog notes for the EM4095 system.
I do not include the HEX file this time.
I used materials widely available on the Internet to develop the project.
Moderated By androot:Removed the name of the tile company - surreptitious advertising
A few pictures:






Cool? Ranking DIY