Home Arduino A look at an NFC shield for the Arduino

A look at an NFC shield for the Arduino

by iainhendry

In this article we look at the open-smart NFC shield, this is basically a MFRC522 based RFID Reader Module which has been added to a basic shield. Lets look at a picture of the shield

This low cost MFRC522 based RFID Reader Module is easy to use and can be used in a wide range of applications.

The MFRC522 is a highly integrated reader/writer IC for contactless communication at 13.56 MHz.

Features:

MFRC522 chip based board
Operating frequency: 13.56MHz
Supply Voltage: 3.3V
Current: 13-26mA
Read Range: Approx 3cm with supplied card and fob
SPI Interface
Max Data Transfer Rate: 10Mbit / s
Dimensions: 60mm × 39mm

At the heart of the module/ shield is the MFRC522 IC, lets look at the chip

The MFRC522 is a highly integrated reader/writer IC for contactless communication at 13.56 MHz. The MFRC522 reader supports ISO/IEC 14443 A/MIFARE mode.The MFRC522’s internal transmitter is able to drive a reader/writer antenna designed to communicate with ISO/IEC 14443 A/MIFARE cards and transponders without additional active circuitry. The receiver module provides a robust and efficient implementation for demodulating and decoding signals from ISO/IEC 14443 A/MIFARE compatible cards and transponders.

The digital module manages the complete ISO/IEC 14443 A framing and error detection (parity and CRC) functionality.The MFRC522 supports MF1xxS20, MF1xxS70 and MF1xxS50 products.

The MFRC522 supports contactless communication and uses MIFARE higher transfer speeds up to 848 kBd in both directions.The following host interfaces are provided:

•Serial Peripheral Interface (SPI)
•Serial UART (similar to RS232 with voltage levels dependant on pin voltage supply)
•I2C-bus interface

Parts

Description Link
Arduino Uno Arduino UNO R3
Open smart NFC shield New NFC Shield

 

Code examples

This comes with a library – RFIDMaster

This was the basic code example

[codesyntax lang=”cpp”]

#include <SPI.h>
#include <MFRC522.h>

#define SDA_PIN 10//Chip Select pin
#define RST_PIN 9
MFRC522 mfrc522(SDA_PIN, RST_PIN); // Create MFRC522 instance.

void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
Serial.println(“Scan PICC to see UID and type…”);
}

void loop() {
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}

// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}

// Dump debug info about the card. PICC_HaltA() is automatically called.
mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}

[/codesyntax]

Output

Place the fob next to the shield and open the serial monitor, this is part of what I saw. I have cut it short as there was a lot more data.

Card UID: 5A 02 73 1A
Card SAK: 08
PICC type: MIFARE 1KB
Sector Block 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 AccessBits
15 63 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF [ 0 0 1 ]
62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ]
61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ]
60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ]
14 59 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF [ 0 0 1 ]

 

Links

NFC Shield v1.0 Schematic
MFRC522 datasheet

Summary

This saves having to wire a module to your Arduino but i was disappointed that only D3 , D4 and TX/RX were available. I would have liked the I2C pins to be available to connect an OLED for example, saying that this would only affect an Arduino Uno. An Arduino Mega would be OK.

Also you only get a keyfob and no mifare card but these can be purchased. I had one from an NFC module that I had

At a price of $4.70 at the time of writing this shield will not break the bank and if you do not have the module then this may be a good purchase

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More