Identity: Barcodes, Fiducial Markers, RFID

From Interactive Device Design Fall13
Jump to: navigation, search



NFC Demo

We have Adafruit PN532 NFC breakout boards on hand. You have two options of talking to these boards: From Linux or OS X directly, via a USB-TTL cable, or through your Boarduino.

Connect to Arduino

We'll mainly follow these instructions - but with modifications for the Boarduino.


Hardware Connections

Insert the Boarduino, NXP 4050 level shifter chip, and the PN532 breakout board into a breadboard.

Boarduino <-> 4050 chip

Pin numbering: Pin 1 is top left near notch, 8 bottom left, 9 bottom right, 16 top right.

  • Boarduino digital pin 2 is connected to 4050 pin 9 (orange wire)
  • Boarduino digital pin 3 is connected to 4050 pin 11 (yellow wire)
  • Boarduino digital pin 4 is connected to 4050 pin 14 (green wire)

On the breakout board

  • 5V is connected to the Arduino 5V pin (red wire)
  • SCK is connected to 4050 pin 10 (orange wire)
  • MISO is connected to Boarduino pin 5 (blue wire)
  • MOSI is connected to 4050 pin 12 (yellow wire)
  • SSEL is connected to 4050 pin 15 (green wire)
  • GND connects to Arduino ground (black wire)

Also connect 4050 pin #1 to 3.3V on breakout (red wire) and pin #8 to ground on the Boarduino.


Get the PN532 SPI library from GitHub:

Rename the folder - replace dash with underscore (Adafruit_PN532) Place the Adafruit_PN532 library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.

You should now be able to select File > Examples > Adafruit_NFCShield_I2C > readMifare sketch. Upload the sketch to your Arduino with the shield plugged in, open the serial monitor.

You should see something like the following:

Found chip PN532
Firmware ver. 1.6
Waiting for an ISO14443A Card ...

If you tag a card, you'll see output like this:

Found an ISO14443A card
  UID Length: 4 bytes
  UID Value: 0xBA 0xA4 0x90 0x23

Seems to be a Mifare Classic card (4 byte UID)
Trying to authenticate block 4 with default KEYA value
Sector 1 (Blocks 4..7) has been authenticated
Reading Block 4:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

Connect to OS X/Linux

It's also possible to directly connect your board to Linux or OSX using an FTDI Serial-to-USB cable. We have these cables in stock. Instructions are at:

Connect to Windows

Sorry, you're on your own.