The easiest way to operate the RFID. An UART serial module interface to Bolt 18F2550 microcontroller.
Author: Moises Melendez Reyes
In a previous project, an RFID module with SPI interface microcontroller 18F2550 Bolt system, with the possibility of reading or writing data to the ISO-14443A tag was described.
Although the SPI interface is the most economical solution for handling RFID, the management of the SPI protocol and commands to the RFID module represents considerable extra work for the microcontroller firmware programmer. Furthermore, the RFID-MF522 and RC522 modules used for the SPI interface, operate at a voltage of 3.3 volts, requiring an additional voltage regulator circuit.
A much simpler solution, if more costly, is to use an RFID-UART interface which greatly simplifies the job of programming the firmware, since the available UART commands are very simple to use. For example, you may request from the microcontroller the ISO-14443A tag's serial number only sending the command '01 'through the serial port. And for convenience, the module operates with a voltage of 5v.
The company is selling a device that can be used in this project: the RFID-UART module
GENERAL DESCRIPTION OF THE PROJECT:
In this project, using a Samsung Galaxy mobile phone as a receiver and display of data, an UART RFID read-write, with operating frequency of 13.56 MHz and serial interface, connected to a Bolt 18F2550 system is described.
Another option for RFID data display, is to use a Laptop computer, either Windows 8 or 7, running Hyperterminal. By means of a USB-Serial cable, the Bolt microcontroller transmits information to the computer via the serial port at a speed of 9600 bps as shown in Figure 3.
The system can be used in the following applications: access control, attendance control, public transportation, parking of vehicles, electronic payment systems, inventory control, registry of credentials in schools and sports clubs, and many others.
THE ISO-14443A TAGS S50:
The UART RFID device receives information from ISO-14443A type tags. These tags contain an EEPROM with capacity of 1 Kb of data storage space. This project tests were performed with both types, card and keychain.
THE BLUETOOTH LINK:
To establish communication between the microcontroller and the mobile, a bluetooth module HC-06 with serial port is used, which allows the wireless transmission of RFID data received by the Bolt microcontroller to the mobile phone. This link, which is a Class 2 in the Bluetooth standard, can operate up to a distance of 10 meters.
In the mobile phone, an application called BlueTerm should run. BlueTerm which is a terminal emulator that allows visualization of the ASCII data sent by the Bolt system.
Several test functions for both tag reading and for writing new data were developed.
In particular, a very simple test function that allows to observe the serial number tag on the Bolt system and displaying the data on your LCD (see Figure 1) was developed.
The firmware ANSI C functions available to the RFID-UART module are described in detail below.
FIRMWARE FUNCTIONS AVAILABLE IN BOLT 18F2550 MICROCONTROLLER
To complete the system tests the user must assemble the test equipment as in Figures 1 and 2, shown at the top of this page. Its operation requires the proper firmware has been previously loaded to Bolt system, following the instructions given right away.
The complete folder MPLAB IDE project with the C18 compiler is:
In this program, 7 basic functions for managing RFID-UART module are provided. From these functions is that the user may subsequently deploy their own application. The functions are:
To test each function, the project file should be opened using MPLAB IDE (file RFIDmoduleC18swserie.mcp) and, once the MPLAB window is ready, in the source program (RFIDmoduleC18swserie.c), locate the 7 functions listed in the table above.
Symbols '//' (indicating comment) must be removed, so that only the function to be tested will be enabled, for example, in the figure below, the user selected function showSerialNumber( ).
Now, you must compile the program (> Project> Built All) and load the resulting file RFIDmoduleC18swserie.hex into your Bolt system. This file is located in the subdirectory named 'Release' in the project folder.
In each test, the tag should be approached at a distance of 2 to 5 cms. to the RFID-UART device, and remain in that position until observing the results on the LCD display or on your mobile phone.
WRITE NEW DATA ON THE TAG:
This function allows writing new data to the tag and requires the user to write directly on the program and recompile. The window below shows how to do it. The user must first clear the comment symbol '//' so as to eneble the writeBlockTAG ( ) function. Subsequently, you must enter the block number (in this example is 22) and the text (in this example is 'Hello how are u!'). And now, you must recompile the program and load the. hex file on the Bolt card.
When approaching the RFID tag, this new information is written to the requested block.
- The program only allows you to type in a block at a time. If you want to write information into multiple blocks, you must repeat the procedure as many times as necessary.
- To write completely new information in the tag, first clear all the EEPROM by using the clearTAG ( ) function.
BLUETERM PROGRAM FOR MOBILE PHONE:
To display the data read from the RFID tag through the UART, the mobile phone must run the application called 'BlueTerm', compatible with the Android operating system (equivalent to 'Hyperterminal' software for Windows), and which is an application of terminal emulator that allows you to send or receive ASCII strings, through the already built-in Bluetooth phone link. This program is free and can be directly downloaded to your mobile phone from the Google Play website.
Manuals spec sheets, and other recommended links: