Ever heard of RFID reader? Actually, it is a device applied with a wireless non-contact system that using radio frequency electromagnetic field (EMF) to read/transfer info from a tag attached to an object. The tag used contains info that stored electronically (likes ID) and can be read by RFID reader. RFID reader is commonly used for automatic identification in door lock system (security), item pricing in hypermarket (inventory management), office (ID identification in personnel management), school (student ID card) and so on. In this tutorial, a project on creating a wireless RFID reader will be implemented. The model of RFID reader used here is RFID reader 232N (RFID-IDR-232N) which actually can be connected to PC directly through RS232 using the DB9 (Male) of its cable for sending tag’s IDs scanned to computer.Somehow, the establishment of a wireless RFID reader enable the RFID reader to be place a t a further distance from the PC since the cable length constraint is eliminated but still can sends the tag’s IDs scanned to PC through the wireless link. This consequently improve the RFID reader portability. The wireless module used in this project is XBee. In order to simplify the process of setting up the circuit of wireless RFID reader, XBee Starter Kit, SKXBEE (with XBee module) is used instead since it consists of onboard logic shifter that allow UART communication with 5V device while XBee is 3.3V device and RS232 chip combined USB port that allow direct communication between computer and XBee. Bascally, the concept of wireless RFID reader can be illustrated by the flow diagram below.
Figure 1: Flow diagram of wireless RFID reader
As seen from Figure 1, the USB (Male) of RFID reader cable will be connected to 5V supply output of Breadboard Power Stick 5V 3v3 (BPS-5-3) through using a Breakout USB Type A Female (BB-USB-AR) so it will be power up when the wireless RFID reader circuit is turn on (by turn on the power adapter DC 12V connected to BPS-5-3). While, SKXBEE#1 (with XBee #1) is connected to PC with direct communication between them using USB cable. The RFID reader is also connected to wireless RFID circuit through Female RS232 cable and UART to RS232 converter (URS232A). The wireless RFID circuit contains SKXBEE# 2 (with XBee #2).
**Since the RFID reader is a RS232 peripheral device that can interface with computer directly but not microcontroller or XBee in this case (since TTL UART is used), a level shifter circuit likes URS232A is needed.
When the ready connected circuit is power up, pre-configured XBee#1 and XBee#2 will associate with each other to establish wireless link for communication. Also, the RFID reader is ready to scan the RFID card (which contains 10 digit ID stored electronically inside it). The ID info will be read by RFID reader, and then transmitted to XBEE#2 through URS232A. Next, through the wireless link, the ID info will be sent from XBee #2 to XBee #1. As the XBee #1 received the ID info, it will send it to hyperterminal of PC for displaying. Amazing, isn’t it? Well, let’s start!!
- SKXBEE driver, can download here.
- XCTU 22.214.171.124 Installer (Win XP, 2000, Vista and 7, 32-bit and 64-bit compatible), you can download under “attachment” here.
- Hyperterminal, can download here.
- RFID-IDR-232N user manual, can download here.
- SKXBEE Board USB driver installation guide, User manual and other related materials can be downloaded from Cytron Technologies, SKXBEE.
- XBee Series 1 datasheet, X-CTU Config & Test Guide and other related materials can be downloaded from Cytron Technologies, XBee Series 1.
- Tutorial and Sample Project
- Tutorial wirelesss Servo Controller Using XBee
**Before proceed to next following sections, users are urged to read through related references, especially “Tutorial and Sample Project” and “Tutorial wireless Servo Contoller Using XBee” for better understanding on how to configure XBee modules and why configuration is needed so that they can be used for wireless communication in controlling your microcontroller circuit wirelessly through using a computer. Also, please read through the user manual of RFID-IDR-232N for better understanding on its working principle.
Part I: Install USB Driver for SKXBEE.
1. Download SKXBEE USB driver installer.
2. Install the USB driver for SKXBEE by following the instructions stated in USB driver installation guide.
Part II : Configure XBees Using X-CTU software
**In configuration of XBees used in this tutorial:
- Self address and destination address of XBee #1 are set to “1111” and “2222”.
- Self address and destination address of XBee #2 are set to “2222” and “1111”.
1. Download X-CTU installer which suits your computer system.
2. Extract the installer.zip file and double-click the .exe setup file in the extracted folder for X-CTU installation.
3. After the installation is completed, please do not launch the X-CTU software yet. Next, connect the SKXBEE#1 (with XBee#1) to PC using USB cable (Type B).
Figure 2: Connect SKXBEE Board to the PC
4. After that, launch the X-CTU software through the shortcut on Desktop. A window will appears as below.
Figure 3: X-CTU start up window with “PC Setting” tab
5. Choose the USB Serial Port (COM26, in this case) and press the “Test/Query button”. Then, a window will pops up as below.
Figure 4: “COM test” window that showing communication status
6. Click OK and then open the “Terminal” tab. The X-CTU Terminal window appears as shown below.
Figure 5: X-CTU Terminal window
7. Enter the command as shown in the sequence below:
**Each line of command will be response with a “OK” message if the command is entered in a correct way.
Line #1: Enter “+++”
Meaning: Initiate AT command mode
Line #2: Enter “atmy1111″ and press “Enter”
Meaning: Setting XBee module address as “1111″
Line #3: Enter “atwr” and press “Enter”
Meaning: Write the XBee module address into non-volatile space
Line #4: Enter “atdl2222″ and press “Enter “
Meaning: Setting destination address (or address of wireless device to be transmitted to) as “2222″ for transmitting purpose
Line #5: Enter “atwr” and press “Enter”
Meaning: Write destination address of XBee for transmission into non-volatile space
Line #6: Enter “atcn” and press “Enter”
Meaning: Terminate the AT command mode
8. The completed command for configuring XBee #1 is shown by the window below:
Figure 6: Completed command for configuring XBee #1
9. Close the X-CTU sofware and remove the SKXBEE #1 (with XBee #1) from PC. Connect SKXBEE #2 (with XBee #2) to PC and launch the X-CTU software again.
**In this time, the USB Serial Port shown in the “COM” list is not COM26 (in this case) any more since different SKXBEE (SKXBEE#2) is connected to the PC. In this case, the USB Serial Port shown is “COM70” instead.
10. Repeat procedure from step 5 to step 7. In step 7, instead of same as previous, do the following modifications for command Line #2 and command Line #4:
Line #2: Enter “atmy2222″ and press “Enter”
Meaning: Setting XBee module address as “2222″
Line #4: Enter “atdl1111″ and press “Enter”
Meaning: Setting destination address (or address of wireless device to be transmitted to) as “1111″ for transmitting purpose.
11. The configurations for communication for both XBees are done here. The completed command for configuring XBee #2 is shown by the window below.
Figure 8: Completed command for configuring XBee #2
Part III: Establish the Wireless RFID Reader Circuit
1. Let’s start with some soldering works. Cut part of 1 x 40 ways straight pin header (Male) into 1 X 5 ways pin header (Male) solder it on to the Break USB Type A Female (BB-USB-AR) as show below.
a) Bottom View b) Top view
Figure 9: Soldered Breakout USB A Type Female
1. Plugin the Breadboard Power Stick (BPS-5-3), SKXBEE#2 (with XBee #2) and Breakout USB Type A Female (BB-USB-AR)onto the breadboard as shown below.
**Breadboard Power Stick (BPS-5-3) is used to provide regulated 5v to power up SKXBEE#2 and URS232A.
**Breakout USB Type A Female (BB-USB-AR) is used to extend the 5V supply from Breadboard Power Stick 5V s3V3 (BPS-5-3) to power RFID reader through the USB (Male) of its cable.
2. Based on the schematic in Figure 10 and the connections diagrams in Figure 11, complete the circuit of wireless RFID reader.
b) Connection at SKXBEE#2 c) Overview of connection at URS232A
d) UART connection at URS232A e) Connection at BB-USB-AR
f) RJ11 connector connected to RFID reader
Figure 11: Connections diagrams
3. The completed circuit is shown in Figure 12 below.
Figure 13: Complted wireless RFID reader circuit design using Fritzing
4. Connect the SKXBEE#1 (with XBee#1) to PC.
5. Connect the power adapter Dc 12V to Breadboard Power Stick (BPS-5-3) so as to provide regulated 5v to power up SKXBEE#2 and URS232A.
Part IV: Set up HyperTerminal in PC for displaying data received (RFID card ID)
1. Extract the downloaded HyperTerminal zip.file.
2. In the extracted folder, double click the hypertrm.exe to launch the software.
3. Enter name for the new connection (for example: XBee Connection) and click OK.
3. Choose the installed COM port for SKXBEE#1 from the “Connect using:” combo box (COM26 is choosen in this demonstration) and click OK.
4. Under the COM properties/Port setting, click the “Restore Defaults” button and click OK.
5. The above configurations will set up a serial communication with:
- Baudrate = 9600
- Databits = 8
- Parity = None
- Stop bits = 1
- Flow control = None
**The default baudrate of XBees used in this project is 9600 bps.
6. After the new connection has been finished set up, the XBee#1 of SKXBEE#1 will be called automatically for connection.
7. Now, user can try to scan the RFID card with the RFID reader as shown below.
a) Scan the RFID card with RFID reader b) The RFID Card ( The ID is “0013317967” in this case)
Figure 14: Scan the RFID card with the RFID reader
**At the moment the RFID card scanned by the RFID reader, the RFID reader will emits a beep sound. The indicator of RFID will turns into green light a while and turns back to red light as default.
8. The RFID card ID will be displayed in the hyperterminal as shown in Figure 15 below in which the ID displayed conforms to the ID of RFID card used in this demonstration.
Figure 15: Display the ID of RFID card in hyperterminal
**As seen from Figure 14, the ID info displayed in hyperterminal contains strange icon before the first digit and after the last digit of the ID. Actually, this is not a strange phenomenon as it is related to the protocol of RFID reader (RFID-IDR-232N) used in this project when sending the ID info which have been read from RFID card. The RFID-IDR-232N will sends ID read with 1 byte of “start of heading” (0x01), followed by 10 bytes of ASCII character (ID) and a byte of “start of text “(0x02). Hence, when the byte 0x01 (start of heading) is printed as ASCII, an icon looks like “white smiling face” will be printed while when the byte 0x02 (start of text) is printed as ASCII, an icon looks like “black smiling face” will be printed instead.
9. The project of wireless RFID reader is considered done here. Users are encouraged to develop further on wireless RFID reader so as to extends its use in other fields.
Thanks for reading this tutorial. See ya!!