Waspmote Libelium Networking Manual

Rfid/nfc 13.56mhz

Advertisement

Quick Links

RFID/NFC 13.56MHz
Networking Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Libelium and is the answer not in the manual?

Questions and answers

Summary of Contents for Waspmote Libelium

  • Page 1 RFID/NFC 13.56MHz Networking Guide...
  • Page 2: Table Of Contents

    Index Document version: v7.0 - 02/2017 © Libelium Comunicaciones Distribuidas S.L. INDEX 1. Introduction ............................4 1.1. The standard ....................................4 2. Hardware .............................. 6 3. Dual radio with the Expansion Board ....................7 3.1. Expansion Radio Board ................................7 3.2. Setting on .......................................8 3.3.
  • Page 3 Index 10. Certifications ............................ 24 11. Code examples and extended information ................... 25 12. API changelog ..........................28 v7.0...
  • Page 4: Introduction

    NFC is a set of standards based on previous RFID protocols like ISO/IEC 14443-A. There are basically 3 ways to interact with an RFID card; Libelium’s RFID/NFC module allows the developer to implement the 3 of them: the RFID/NFC module reads the RFID card’s unique identification (UID) the RFID/NFC module reads the RFID card’s internal memory (16 bytes each time)
  • Page 5 Introduction Among the RFID/NFC applications, the most common are: • access control/security • events ticketing • public transport • equipment and personnel tracking • logistics • real-time inventories • marketing information (kiosks) Figure : Some application examples v7.0...
  • Page 6: Hardware

    The antenna is 57x57x10 mm and can be plugged in 2 directions, but for the best range we suggest to place it like in the photos, standing out of the surface of Waspmote. Obviously, for projects with strict form factor specifications, the antenna can be placed over Waspmote.
  • Page 7: Dual Radio With The Expansion Board

    • etc. Remark: GPRS, GPRS+GPS, 3G and 4G modules do not need the Expansion Board to be connected to Waspmote. They can be plugged directly in the socket1. Next image shows the sockets available along with the UART assigned. On one hand, SOCKET0 allows to plug any kind of radio module through the UART0.
  • Page 8: Setting On

    Dual radio with the Expansion Board This API provides a function in order to initialize the RFID/NFC module called . This function supports a RFID13.ON(socket) new parameter which permits to select the socket. It is possible to choose between socket0 or socket1. An example of use the initialization function is the following: •...
  • Page 9: Rfid Tags

    RFID Tags 4. RFID Tags Libelium offers Mifare® Classic 1k cards tags and stickers along with the Waspmote RFID/NFC module. More than 3.5 billions of this type of cards have been sold around the world up now. An RFID card has a thin form factor (81x54x1 mm), like a driving license or identification card, and can be kept in the user’s wallet.
  • Page 10: Usage

    Figure : Typical RFID/NFC operation • Some kind of indicator is strongly advised to let the user know that data exchange was successful. Waspmote can control a LED (built-in or external) or a buzzer for this goal. •...
  • Page 11: Security With Rfid/Nfc At 13.56 Mhz

    Libelium does not implement. Q: Does Libelium recommend its RFID/NFC module for electronic money exchange? A: No. The RFID/NFC module by Libelium is not intended for payment applications but for control of usage. Q: Should I change the key to the cards? A: Yes, you should if it is possible that someone is interested in reading or changing the stored information.
  • Page 12 Security with RFID/NFC at 13.56 MHz Since each sector can have different access keys, note it is possible to store public data in certain sectors and private, protected data in other sectors. One example: • sector 2: personal, general info (key only known by all the institutions of the city council) •...
  • Page 13: Rfid 13.56 Mhz And Nfc

    Libelium’s RFID/NFC module supports both operations in a native way: RFID @ 13.56 MHz (ISO/IEC 14443-A/Mifare® protocols) and NFC (NFCIP-1), but Libelium has not implemented software functions to handle the NFC operations. The reason to that is that the most important applications of the RFID/NFC module for Wireless Sensor Networks are identifying and reading/ writing cards and tags, and not interchanging big amounts of data in very short range communications.
  • Page 14: Libelium's Library

    Libelium’s library 8. Libelium’s library It is mandatory to include the RFID library when using this module. The following line must be introduced at the beginning of the code: #include <WaspRFID13.h> Waspmote’s API RFID/NFC files: • WaspRFID13.cpp • WaspRFID13.h API functions Private functions: •...
  • Page 15: Library Constructor

    Libelium’s library 8.1. Library constructor It is the class constructor. It is only executed inside the API’s function init(). Public functions: • The following functions are public and therefore they can be executed in the functions. They provide loop() setup() the tools to perform all the features of the RFID/NFC module.
  • Page 16: Switching The Module On

    Libelium’s library 8.2. Switching the module on This function takes the RFID/NFC module out of the power-down mode by starting the wake up procedure. If you connected the RFID/NFC module into the usual XBee socket, please use SOCKET0; if you connected the RFID/NFC module into the Expansion Board, you must use SOCKET1.
  • Page 17: Authenticating A Sector

    Libelium’s library 8.5. Authenticating a sector This function authenticates a sector of the card thanks to the key or password. It is important to remark that before doing any read or write in a block, it is mandatory to authenticate us in it.
  • Page 18: Reading A Block With Authentication

    Libelium’s library 8.7. Reading a block with authentication This function authenticates a block of the card first, and then reads the 16 bytes stored in a block. This function is useful to do these 2 steps in just one. Example of use: uint8_t state;...
  • Page 19: Writing In A Block And Checking It

    Libelium’s library 8.10. Writing in a block and checking it This function writes 16 bytes in a block, and then checks the correct data was written. This block must be authenticated before writing. This function is useful to do these 2 steps in just one.
  • Page 20: Powering Down

    Libelium’s library With any configuration, the key A can never be read (the module returns 0’s instead of the key) for security reasons. As we can see, the key A of each RFID/NFC card is the master key and we must avoid losing or sharing this information.
  • Page 21: Printing Data

    Libelium’s library 8.15. Printing data This function is very useful for viewing data content in vectors when you are debugging the code. Example of use: RFID.print(readData,16); //Print data read and stored in readData vector in the serial monitor http://www.libelium.com/development/waspmote/examples/RFID1356-01-basic-example 8.16. Comparing UIDs This function compares 2 UIDs to check if they are equal.
  • Page 22: Converting From A String To A Uint8_T Pointer

    Libelium’s library 8.18. Converting from a string to a uint8_t pointer This function converts from a string to a pointer to uint8_t’s. When we want to write a word or phrase in an RFID card, this function is useful to convert from ASCII code to the format the RFID/NFC module can understand.
  • Page 23: Time Of Execution Of The Functions

    Time of execution of the functions 9. Time of execution of the functions This function converts from a pointer to uint8_t’s to an integer. When we want to read a number from an RFID card, this function is useful to convert from ASCII code to the format we can understand, an integer. •...
  • Page 24: Certifications

    10. Certifications Libelium offers 2 types of IoT sensor platforms, Waspmote OEM and Plug & Sense!: Waspmote OEM is intended to be used for research purposes or as part of a major product so it needs final certification on •...
  • Page 25: Code Examples And Extended Information

    In the Waspmote Development section you can find complete examples: http://www.libelium.com/development/waspmote/examples ------ [RFID1356_03] RFID Bus Example -------- Explanation: This sketch shows how Libelium’s RFID/NFC 13.56 can be used for ticketing solutions, in this case we use the RFID/NFC to simulate a RFID access control inside a bus.
  • Page 26 Code examples and extended information void setup() USB.ON(); USB.println(“RFID/NFC @ 13.56 MHz module started”); // switchs ON the module, type B, and asigns the socket RFID13.ON(SOCKET0); delay(1000); void loop() USB.print(“\r\n++++++++++++++++++++++++++++++++++++”); // **** init the RFID/NFC reader state = RFID13.init(UID, aux); if (aux[0] == aux[1]) // if so, there is no card on the EM field USB.print(“\r\nRequest error - no card found”);...
  • Page 27 Code examples and extended information credit = RFID13.vector2int(aux); // convert the card data to int if (credit >= tripFare) sprintf(text, “%d”, credit - tripFare); RFID13.string2vector(text, aux); for (int i=0; i<sizeof(text); i++) // clear this variable text[i] = ‘\0’; // **** write aux in block number 1, and check afterwards state = RFID13.write(1, aux);...
  • Page 28: Api Changelog

    API changelog 12. API changelog Keep track of the software changes on this link: www.libelium.com/development/waspmote/documentation/changelog/#RFID1356 -28- v7.0...

Table of Contents