The PicoBricks Kit contains an RFID RC522 Reader that enables your projects to use this highly integrated reader/writer IC for contactless communication at 13.56 MHz. The MFRC522 reader supports ISO/IEC 14443 A/MIFARE and NTAG.
In order to use the RFID Kit with the PicoBricks Board, we need to connect it to the board using jumper cables. Refer to the image below for the connection details. You will need six male-female jumper cables, which you should be able to locate in your PicoBricks kit.
After you make the connections shown above, you can proceed to the software side of the project by loading the Libraries and the demo program.
The PicoBricks Library covers the eight basic sensors and switches on the board. However, it does not handle RFID Readers. That's because there are already MicroBlocks libraries that work with those components.
Here we will look at how to load the RC522 library into MicroBlocks IDE to enable us to control the RFID reader.
When you open the MicroBlocks IDE, you will notice a Libraries + entry just below the left category selections.
After clicking on the +, you will be presented with the opening menu of the Library selections:
Select Sensing from the list to display the sensor library options
Scroll down and select RFID (RC522) from the list, and the library will be loaded into the IDE.
The left side Libraries listing will now include the RFID (RC522) library.
We have provided a small program that will let you exercise the reader to detect the RFID tag and card included with your kit.
Open a Browser session with the MicroBlocks IDE and download the program from the link below and load it into the IDE.
DOWNLOAD: RFID-SPI Demo
Your IDE should look like this:
NOTE that either loading the program from the download link, or drag&dropping the program script picture onto the IDE will help you get started with the demo. In either case, the RC522 library will be included in the demo program and you do not have to separately load it per instructions in the previous section.
The demo program initializes the RFID reader in SPI mode using pin 17. SPI mode uses pin 17 as the SDA pin, ie: data transmissions occur over this pin.
While this program is using the OLED display located on the PicoBricks card, it also displays its progress information on the IDE as well.
Once the reader connection is established, the program enters a loop of detecting and displaying RFID card information both on the OLED display and the IDE.
As it is running, one can hold up the NFC keychain or the card unit up against it and the corresponding RFID will be displayed in decimal and hex notation on the OLED display and the IDE.
As the NFC items are removed, the program will indicate it with a no card detected message.
RFID Readers operate on different frequencies. As such, cards and tags compatible with a given frequency will not work with a different frequency. Make sure to verify that readers used in your projects and the tags and cards you intend to deploy are compatible with each other.
Although the RC522 chip supports I2C and UART in addition to SPI, the MFRC-522 board supports only SPI without making permanent board modifications (e.g. carefully drilling a hole in an exact location). We do not recommend making such modifications.
MicroBlocks supports both I2C and Serial modes of operation. RC522 library has a block for I2C address initialization. We suggest to use it with a board that supports I2C without any hardware modifications.
If your projects do not permit you to use the six pins required for the SPI connections, you can look into obtaining a Serial or I2C mode RFID Reader, that work without hardware modifications. We present one of each below to help you out with your search. You can find more options on the web.
Connection diagram for the PicoBricks Kit:
Here is a demo program to try out with this board.
DOWNLOAD: RFID-SERIAL Demo
Here is a demo program to try out with this board.
Make sure you adjust the I2C address to the specs of your reader board.
DOWNLOAD: RFID-I2C Demo
You may have noticed in the above selections that they are using different frequency ranges to operate. Here is a bit more detail about the different readers and their operational specifications, courtesy of Resource Label Group.
There are a variety of RFID tags on the market today, differentiated by frequency range (low, high and ultra-high). Each RFID type can be either active (powered), passive (un-powered) or semi-passive (battery-assisted).
|LOW-REQUENCY (RFID)||HIGH-FREQUENCY (HF)||ULTRA-HIGH-FREQUENCY (UHF)|
|FREQUENCY RANGE||30 to 300 KHz||3 to 30 MHz||300 MHz to 3 GHz|
|COMMON FREQUENCY||125 KHz or 134 KHz||13.56 MHz (NFC)||860 to 960 MHz (UHF Gen 2)|
|RELATIVE COST||$$||$$ - $$$||$|
|READ RANGE||<= 10cm||<= 30 cm||<= 100 m|
|BENEFITS||More resistant to interferece
by liquids and metals
|Higher memory capabilities,
NFC tags can function as both
reader and tag
|Lower cost, with good read range
and fast read rates.
|COMMON APPLICATIONS||Animal tracking, automobile
|Promotional packaging and labels,
contactless payment, library collections
|Inventory control, item-level tracking,
supply chain visibility and efficiency.
LF RFID tags have slower read rates and shorter read ranges than UHF or HF, but they’re less susceptible to interference by liquids and metals because they have a longer wavelength. Because of this, they’re often used in applications where an RFID label is affixed to a metal substrate, such as inventorying beer kegs or automobiles.
HF RFID tags have longer read range and higher memory capabilities, making them well-suited to cataloging library media or for use in tracking bracelets for theme parks. Within the HF RFID category are a common type of smart label: Near field communication (NFC) tags.
NFC vs. HF RFID
NFC tags are a subcategory of HF RFID technology. All NFC tags are HF RFID tags, but not all HF RFID tags are NFC tags. NFC operates in a very specific subset of the high-frequency range —13.56 MHz— and have very different use cases and implementation considerations from other RFID categories.
Key differences between NFC and other RFID categories
One key difference is that NFC tags have a much smaller read range, often requiring the reader and tag to be no more than a few centimeters apart. And while other RFID types allow for entire pallets of tags to be read at once, NFC tags must be read one at a time. With larger memory capabilities and two-way communication capabilities, though, NFC tags are much more useful for storing and communicating large amounts of information — making them an incredibly valuable tool in promotional campaigns.
Applications for NFC tags
NFC technology provides secure, one-to-one coupling, making it useful for contactless payment applications such as ApplePay™. And because almost all smartphones function as NFC readers, NFC tags are popular in promotional labels and posters, and are also a good tool for personalized customer engagement. To learn how brands have leveraged NFC technology, read our articles on NFC applications in wine labels or in the healthcare industry.
UHF RFID tags are considered the “supply chain frequency” because they’re generally lower priced than the other types, while still providing good read ranges and rates. Common applications include item-level tracking, retail inventory control and driving supply chain efficiencies.
Wal-Mart, Target and the Department of Defense (DoD) mandate that their suppliers provide RFID tags with every product and pallet. This reduces the need for manual inventorying, as hundreds of tags can be read simultaneously. And it allows them to more accurately identify incoming inventory by reading entire truckloads of products at a time.
Active RFID tags have a battery and periodically transmit signals, useful in location tracking applications. Because the battery in active tags can boost signal strength, they tend to have a longer read range (up to 100 meters).
Passive tags remain dormant until they receive a radio signal from a reader. The energy from the reader’s signal is used to turn the tag on and reflect an information-carrying signal back to the reader.
Semi-passive (or battery-assisted) RFID tags contain a battery, but do not transmit a periodic signal like active RFID tags. Instead, the battery is only used to turn the tag on when a signal is received — this allows all energy from the reader’s signal to be reflected back.
Because active tags tend to be much more expensive, they are often only used to track very high-value assets, such as equipment in the construction, automobile or healthcare industries. Passive tags —especially ultra-high frequency (UHF) and near field communication (NFC)— are the most widely used for product and pallet labels.
Now go ahead and have fun with the RFID Readers.