Web Site:
www.parallax.com
Forums:
forums.parallax.com
Sales:
sales@parallax.com
Technical:
support@parallax.com
Office:
(916) 624-8333
Fax:
(916) 624-8003
Sales:
(888) 512-1024
Tech Support:
(888) 997-8267
RFID Read/Write Module, Serial (#28440)
Designed in cooperation with Grand Idea Studio (www.grandideastudio.com), the Parallax Radio
Frequency Identification (RFID) Read/Write Module provides a low-cost solution to read and write passive
RFID transponder tags up to 3 inches away. The RFID transponder tags provide a unique serial number
and can store up to 116 bytes of user data, which can be password protected to allow only authorized
access.
The RFID Read/Write Module can be used in a wide variety of hobbyist and commercial applications,
including access control, user identification, robotics navigation, inventory tracking, payment systems, car
immobilization, and manufacturing automation.
Features
Low-cost method for reading and writing
passive, 125 kHz RFID transponder tags
Up to 116 bytes of user data storage on a
single tag
Optional security features prevent tag from
being read or written without password
Bi-color LED for visual indication of status
Key Specifications
Power requirements: +5 VDC; < 10 mA idle,
approx. 100-200 mA active
Communication: asynchronous serial 9600 bps,
(8N1); 5 V TTL-level, non-inverted
Dimensions: 3.25 x 2.45 in (8.26 x 6.2 cm)
RFID Tag Compatibility
The RFID Read/Write Module works exclusively with
the EM Microelectronics EM4x50 1kbit R/W
transponder tags. A variety of different tag types and
styles exist, with the most popular ones made available
from Parallax.
Each tag contains a unique, read-only serial number (one of 2
32
, or 4,294,967,296 possible combinations)
and 116 bytes of user data area stored in a non-volatile EEPROM (Electrically Erasable Read Only
Memory). The user data area can be optionally secured with a 32-bit password to allow only authorized
read and write operations.
The RFID Read/Write Module provides, with a single command, legacy support for the EM
Microelectronics EM4100 read-only tags that are used with Parallax’s RFID Card Reader Serial (#28140)
and USB (#28340).
Copyright © Parallax Inc.
RFID Read/Write Module, Serial (#28440)
v1.0 6/29/2010 Page 1 of 10
Connections
The RFID Read/Write Module easily interfaces to any host microcontroller using only four connections
(VCC, SIN, SOUT, GND).
Pin
1
2
3
4
Pin Name
VCC
SIN
SOUT
GROUND
Type
P
I
O
G
Function
System power. +5V DC input.
Serial input from host. TTL-level interface, 9600 bps, 8 data
bits, no parity, 1 stop bit.
Serial output to host. TTL-level interface, 9600 bps, 8 data bits,
no parity, 1 stop bit.
System ground. Connect to power supply’s ground (GND)
terminal.
Note: Type: I = Input, O = Output, P = Power, G = Ground
Use the following example circuit for connecting the Parallax RFID Read/Write Module:
Copyright © Parallax Inc.
RFID Read/Write Module, Serial (#28440)
v1.0 6/29/2010 Page 2 of 10
Usage
There are many ways to use the RFID Read/Write Module and associated tags, but the three most
common are as follows:
1) Read Only: Read the tag’s unique, non-changing 32-bit serial number
2) Read/Write: Read from and write up to 116 bytes of publicly accessible user data on the tag
3) Read/Write (Protected): Read from and write up to 116 bytes of password-protected user data
on the tag. In this mode, you must enter the correct 32-bit password in order for read and write
operations to be successful.
The RFID Read/Write Module is controlled by the host via a serial communications interface. The unit
waits in an idle state until it receives a valid header and command from the host, at which time the
module will perform the command and return a status/error byte indicating a success or failure and
command-specific data (if any). The module will then re-enter the idle state and wait for the next valid
header and command.
A visual indication of the RFID Read/Write Module’s state is given with the on-board LED (Light Emitting
Diode). When the module is successfully powered-up and is in an idle state, the LED will be GREEN;
when the module is in an active state (for example, searching for a valid tag or performing an operation
on the tag), the LED will be RED.
The face of the tag should be held parallel to the front or back face of the antenna (where the majority of
RF energy is emitted). If the tag is held sideways (for example, perpendicular to the antenna), you'll
either get no reading or a poor reading distance. Only one transponder tag should be held up to the
antenna at any time. The use of multiple tags at one time will cause tag collisions and the reader may
not detect any of them. The tags available in the Parallax store have a read distance of approximately
3 inches. Actual distance may vary slightly depending on the size of the transponder tag and
environmental conditions of the application.
Communication Protocol
The RFID Read/Write Module is controlled by the host via a standard, asynchronous serial
communications interface configured at 9600 bps, 8 data bits, no parity, 1 stop bit, and least significant
bit first (8N1). The serial data expected and transmitted by the RFID Read/Write Module is 5V TTL-level,
non-inverted.
To communicate with the RFID Read/Write Module, the user must first send a three-byte header string of
!RW (in ASCII), followed by the desired single-byte command (in hexadecimal). Certain commands
require additional data to be sent along with the command. A status/error byte and a varying number of
data bytes will be returned depending on the command called.
Copyright © Parallax Inc.
RFID Read/Write Module, Serial (#28440)
v1.0 6/29/2010 Page 3 of 10
Command Set
0x01: RFID_Read
Read data from a specified address
Input: Address location (1 byte), valid locations are 1-33 decimal
Output: Status byte (1 byte) + data (4 bytes)
Example:
SEROUT RFID_TX, Baud, ["!RW", RFID_Read, ADDR_Serial]
SERIN RFID_RX, Baud, [err, STR data\4]
' Read tag's serial number
' Get status byte & data bytes
0x02: RFID_Write
Write data to a specified address
Input: Address location (1 byte), valid locations are 3-31 decimal + data (4 bytes)
Output: Status byte (1 byte)
Example:
' Write $FEEDBEEF to address 3 (User Data Area)
SEROUT RFID_TX, Baud, ["!RW", RFID_Write, 3, $FE, $ED, $BE, $EF]
SERIN RFID_RX, Baud, [err] ' Get status byte
Note: After writing the specified data to the tag, the RFID Read/Write Module automatically performs a
read function to verify that the data has properly been written.
0x03: RFID_Login
Login to the tag (required to use password protection features)
Input: Password (4 bytes), default = 0x00000000
Output: Status byte (1 byte)
Example:
' Login to tag with password
SEROUT RFID_TX, Baud, ["!RW", RFID_Login, $00, $00, $00, $00]
SERIN RFID_RX, Baud, [err]
' Get status byte
0x04: RFID_SetPass
Change the tag’s password
Input: Current password (4 bytes) + new password (4 bytes)
Output: Status byte (1 byte)
Example:
' Change password from current ($00000000) to new ($FEEDBEEF)
SEROUT RFID_TX, Baud, ["!RW", RFID_SetPass, REP $00\4, $FE, $ED, $BE, $EF]
SERIN RFID_RX, Baud, [err] ' Get status byte
Copyright © Parallax Inc.
RFID Read/Write Module, Serial (#28440)
v1.0 6/29/2010 Page 4 of 10
0x05: RFID_Protect
Enable (lock) or disable (unlock) the tag’s password protection.
Input: Mode (1 byte), 0x00 to unlock, 0x01 to lock
Output: Status byte (1 byte)
Example:
SEROUT RFID_TX, Baud, ["!RW", RFID_Protect, 1] ' Lock the tag
SERIN RFID_RX, Baud, [err]
' Get status byte
Note: When the tag is locked, a successful login using the RFID_Login command is required before you
can enable/disable password protection, change the tag’s password, or read/write to the tag. If the tag is
locked and you are not successfully logged in, the RFID_Read command will return four bytes of 0x00 in
place of the actual user data and the RFID_Write command will return an error.
0x06: RFID_Reset
Log out and reset the tag.
Input: None
Output: Status byte (1 byte)
Example:
SEROUT RFID_TX, Baud, ["!RW", RFID_Reset]
SERIN RFID_RX, Baud, [err]
' Reset the tag
' Get status byte
Note: All user data will remain stored on the tag. You will need to re-login using RFID_Login if you want
to access a locked tag after calling this command. You can also reset the tag by removing it from the
proximity of the RFID Read/Write Module.
0x0F: RFID_ReadLegacy
Read the 40-bit unique serial number from an EM Microelectronics EM4100 read-only tag (used with
Parallax’s RFID Card Reader Serial, #28140, and USB, #28340).
Input: None
Output: Header (1 byte) + data (10 bytes) + footer (1 byte)
Example:
SEROUT RFID_TX, Baud, ["!RW", RFID_ReadLegacy]
SERIN RFID_RX, Baud, [header, STR data\10, footer]
' Read EM4100 unique serial #
' Get header, data, and footer
Note: The header and footer are used to identify that a correct string has been received from the
reader (they correspond to a line feed and carriage return characters, respectively). The middle ten bytes
are the tag's unique ID sent in a printable ASCII string. For example, for a tag with a valid ID of
0F0184F07A, the following bytes would be sent: 0x0A, 0x30, 0x46, 0x30, 0x31, 0x38, 0x34, 0x46, 0x30,
0x37, 0x41, 0x0D.
Copyright © Parallax Inc.
RFID Read/Write Module, Serial (#28440)
v1.0 6/29/2010 Page 5 of 10