• Complain

Agus Kurniawan - Near Field Communication (NFC) for Embedded Applications

Here you can read online Agus Kurniawan - Near Field Communication (NFC) for Embedded Applications full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2015, publisher: PE Press, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Agus Kurniawan Near Field Communication (NFC) for Embedded Applications
  • Book:
    Near Field Communication (NFC) for Embedded Applications
  • Author:
  • Publisher:
    PE Press
  • Genre:
  • Year:
    2015
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Near Field Communication (NFC) for Embedded Applications: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Near Field Communication (NFC) for Embedded Applications" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

This book helps you to get started with Near Field Communication (NFC) programming. This book uses Arduino and Raspberry Pi boards for targeting embedded system. The following is highlight topics:
* Preparing development environment
* NFC programming for Arduino
* NFC programming for Raspberry Pi
* Building Attendance system Based NFC
* Building Payment system based NFC

Agus Kurniawan: author's other books


Who wrote Near Field Communication (NFC) for Embedded Applications? Find out the surname, the name of the author of the book and a list of all author's works by series.

Near Field Communication (NFC) for Embedded Applications — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Near Field Communication (NFC) for Embedded Applications" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Copyright

Near Field Communication (NFC) for Embedded Applications

Agus Kurniawan

1st Edition, 2015

Copyright 2015 Agus Kurniawan

NFC logo image is copyright and trademark from NFC Forum, http://nfc-forum.org/our-work/nfc-branding/n-mark/ .

Table of Contents
Preface

This book was written to help anyone want to get started with NFC module programming on Arduino and Raspberry Pi. It describes all the basic elements of the NFC module deploying and how to program with step-by-step approach. There are two study cases to illustrate how to work with NFC module.

Agus Kurniawan

Depok, August 2015

1. Preparing Development Environment
1.1 Near Field Communication (NFC)

Near field communication (NFC) is a set of standards for smart phones and similar devices to establish radio communication with each other by touching them together or bringing them into close proximity, usually no more than a few centimeters.

In this book, we focus on NFC development with targeting on Arduino and Raspberry Pi boards.

1.2 Getting Hardware

How to get NFC module?

There are many NFC hardware module. For testing I use two NFC modules, ITEAD PN532 NFC module and PN532 NFC RFID Module V3.

ITEAD PN532 NFC module. This module is based on PN532 chip and used for 13.56MHz near field communication. You can buy this module on this website, http://imall.iteadstudio.com/featured-product/im130625002.html .

PN532 NFC RFID Module V3 This module made in China You can get it from eBay - photo 1

PN532 NFC RFID Module V3. This module made in China. You can get it from eBay.

PN532 NFCRFID controller breakout board from Adafruit - photo 2

PN532 NFC/RFID controller breakout board from Adafruit, https://www.adafruit.com/products/364 .

You also can buy NFC module on your local electronics store 13 Development - photo 3

You also can buy NFC module on your local electronics store.

1.3 Development Tools

For development, I use several development tools corresponding to embedded platform. You can use any code editor to develop embedded app for NFC.

1.4 NFC Cards

We need some electronic components to build our testing, for instance, Resistor, LED, sensor devices and etc. I recommend you can buy electronic component kit. You find them on your local electronics shops

2. NFC Programming for Arduino

This chapter explains how to work with NFC module on Arduino board.

2.1 Getting Started

We are going to read NFC cards and keys via NFC module on Arduino board. For testing, we build demos such as reading and writing data on NFC cards.

In this chapter, we access NFC module to Arduino via SPI. You should enable SPI access on NFC module. Itead PN532 Module should be set SET0 = L and SET1 = H to activate SPI communication.

2.2 NFC Library for Arduino

In this demo, I used NFC module from ITEAD Studio, http://imall.iteadstudio.com/featured-product/im130625002.html . You can download NFC library for Arduino on http://wiki.iteadstudio.com/ITEAD_PN532_NFC_MODULE .

After you got *.zip file, you can add it into Arduino Sotware by clicking menu Sketch -> Include Library -> Add .ZIP Library.

Navigate to your zip library After that youre ready to develop a program - photo 4

Navigate to your .zip library.

After that, you're ready to develop a program for NFC.

2.3 Wiring

We connect NFC module to Arduino via SPI. You can see NFC module pins on Figure below.

The following is our wiring NFC SCK to Arduino Digital 13 SCK NFC MI to - photo 5

The following is our wiring:

  • NFC SCK to Arduino Digital 13 (SCK)
  • NFC MI to Arduino Digital 12 (MISO)
  • NFC MO to Arduino Digital 11 (MOSI)
  • NFC NSS to Arduino Digital 10 (SS)
  • NFC GND to Arduino GND
  • NFC 5V to Arduino VCC +5V

My implementation for hardware wiring, shown in Figure below.

24 Reading NFC Card In this section we build a simple app to read NFC card - photo 6

2.4 Reading NFC Card

In this section, we build a simple app to read NFC card. Then, we read detail of inside card data. You can write these codes on Arduino software.

#include #include /*Chip select pin can be connected to D10*/ #define PN532_CS 10 PN532 nfc (PN532_CS); void setup ( void ) { Serial.begin( 9600 ); Serial.println( "Hello!" ); nfc.begin(); uint32_t versiondata = nfc.getFirmwareVersion(); if ( ! versiondata) { Serial.print( "Didn't find PN53x board" ); while (); // halt } Serial.print( "Found chip PN5" ); Serial.println((versiondata >> ) & 0xFF , HEX); Serial.print( "Firmware ver. " ); Serial.print((versiondata >> ) & 0xFF , DEC); Serial.print( '.' ); Serial.println((versiondata >> ) & 0xFF , DEC); Serial.print( "Supports " ); Serial.println(versiondata & 0xFF , HEX); // configure board to read RFID tags and cards nfc.SAMConfig();} void loop ( void ) { uint32_t id; id = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A); if (id != ) { Serial.print( "Read card #" ); Serial.println(id); Serial.println(); uint8_t keys[] = { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF }; // default key of a fresh card for ( uint8_t blockn = ;blockn < ;blockn ++ ) { if (nfc.authenticateBlock(, id ,blockn,KEY_A,keys)) //authenticate block blockn { //if authentication successful uint8_t block[]; //read memory block blockn if (nfc.readMemoryBlock(,blockn,block)) { //if read operation is successful for ( uint8_t i = ;i < ;i ++ ) { //print memory block Serial.print(block[i],HEX); if (block[i] <= 0xF ) //Data arrangement / beautify { Serial.print( " " ); } else { Serial.print( " " ); } } Serial.print( "| Block " ); if (blockn <= ) //Data arrangement / beautify { Serial.print( " " ); } Serial.print(blockn,DEC); Serial.print( " | " ); if (blockn == ) { Serial.println( "Manufacturer Block" ); } else { if (((blockn + ) % ) == ) { Serial.println( "Sector Trailer" ); } else { Serial.println( "Data Block" ); } } } } } } delay();}

Save this program as ArduinoNFC.

Dont forget to change targeted board to Arduino and its port Compile - photo 7

Don't forget to change targeted board to Arduino and its port.

Compile and upload this program into Arduino board Open Serial Monitor tool - photo 8

Compile and upload this program into Arduino board Open Serial Monitor tool - photo 9

Compile and upload this program into Arduino board.

Open Serial Monitor tool from Arduino software. Now you can swap your NFC card and see the program output on Serial Monitor tool. A sample output can be seen in Figure below.

25 Writing NFC Card In this section we try to write data into NFC card For - photo 10

2.5 Writing NFC Card

In this section, we try to write data into NFC card. For instance, we write data 0..F for 16 data.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Near Field Communication (NFC) for Embedded Applications»

Look at similar books to Near Field Communication (NFC) for Embedded Applications. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Near Field Communication (NFC) for Embedded Applications»

Discussion, reviews of the book Near Field Communication (NFC) for Embedded Applications and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.