NFC (Near-field communication) is a protocol that enable 2 devices to communicate typically smart phone device and NFC tags / devices to establish communication by getting them together range of 4 cm at 1.6 inch defends of usage and antenna circuitry. NFC device are used in contactless payment system, security, marketing, transportations, Bluetooth fairing. Etc. NFC also can be found on your mobile phones that can act as electronic identity documents and keycards working on a low speed connection.


Each NFC device can work in 3 modes, can be NFC Card Emulation it means that NFC device such as smart phones can act as smart cards allowing the smart phones to transact as payment or ticketing. NFC devices also allows you two write / read information stored on NFC tags in embedded in labels, tickers, passports or smart posters. NFC PTP (Pear to Pear) allows you to NFC enabled devices to communicate with each other devices to exchange information.

The diagram below demonstrate how to used NFC devices with your microcontrollers. As you can see the diagram below there are two options the first option is wired using i2C (2 Wire Communication), second option is wired using SPI (Serial Peripheral Interface) below are the component required for this test.

Required Components

  • Arduino Microcontroller, ESP8266 12, 12E, ESP8266 NodeMCU, ESPDuino, ATMEGA328 16/12, ATMEGA32u4 16/8/ MHz, ESP8266, ATMEGA250 16 MHz, ATSAM3x8E, ATSAM21D, ATTINY85 16/8 MHz (Note: The Diagram below is using NANO. (please refer to the respective pin-outs)
  • NFC Module / NFC Shield / NFC MCU Integrated
  • Solder Less Bread Board
  • Jumper Wires / DuPont Wires

Wiring Guide

When you save and upload the code below unto your MCU w/d the module/shield attached you can now begin testing and show the message burn-in your tags, when you upload the code into the MCU then opening the serial monitor you will see the message 14CORE | NFC – i2C Test Code TAG Reader see below code to write data into your TAGS to read from your smart phone.

Source Code for i2C

Source Code for SPI

Writing on NFC Tag Source Code

Downloads

  • Download PN532 Code Library | Zip
  • Download PN532 NFC Shield | Zip
  • Download Adafruit PN532 Code Library | Zip
  • Download PN532 Datasheet | PDF
  • Download PN532 HSU | PN532 I2C | PN532 SPI
Wiring the PN532 (NFC) Near Field Communication Devices with Microcontroller
Facebooktwittergoogle_plusredditpinterestmail
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *