background image

-4-

v7.0

Introduction

1. Introduction

This guide explains the RFID/NFC module features and functions. This product was designed for Waspmote v12 and continues 

with no changes for Waspmote v15. There are no great variations in this library for our new product lines Waspmote v15, released 

on October 2016. 

Anyway, if you are using previous versions of our products, please use the corresponding guides, available on our 

Development 

website.

 

You can get more information about the generation change on the document “

New generation of Libelium product lines

”. 

1.1. The standard

RFID (Radio Frequency Identification) is a technology that uses electromagnetic fields to identify objects in a contactless way; it 

is also called proximity identification. There are 2 elements in RFID communications: the RFID module (or reader/writer device) 

and an RFID card (or tag). The RFID module acts as the master and the card acts as the slave; this means the module queries the 

card and sends instructions to it. In a normal RFID communication, the RFID module is fixed and the user takes his card near it 

when he needs to start the interaction.

Figure : Waspmote with RFID/NFC module on socket 0 (below antenna) and ZigBee radio on socket 1

An RFID card can be understood as a remote storage unit where we can read and write information without contact. Most of the 

RFID tags are passive, which implies that the RFID module must create an electromagnetic field in order to power the tag. The 

RFID card’s antenna (in fact it is an inductive coupler) gets the power from this field. Also, an RFID card has a very basic micro-

controller which manages the communications and memory access. 

Many RFID standards have been released by the industry. Most of them have as operating frequency 13.56 MHz or 125 kHz. In 

the present document we will be explaining the RFID/NFC module, which works at 13.56 MHz.

In particular, Libelium has created an ISO/IEC 14443-A and NFC compliant module for Waspmote. The ISO/IEC 14443-A protocol 

is widely accepted as the 

de facto

 RFID at 13.56 MHz standard. Billions of ISO/IEC14443-A cards have been sold over the world. 

NFC (Near Field Communication) is an extension of RFID which focuses on communications between smartphones and other 

advanced devices. 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: 
1.  the RFID/NFC module reads the RFID card’s unique identification (UID)
2.  the RFID/NFC module reads the RFID card’s internal memory (16 bytes each time)
3.  the RFID/NFC module writes in the RFID card’s internal memory (16 bytes each time)

Summary of Contents for Libelium

Page 1: ...RFID NFC 13 56MHz Networking Guide...

Page 2: ...he module off 16 8 4 Initiating the module 16 8 5 Authenticating a sector 17 8 6 Reading a block 17 8 7 Reading a block with authentication 18 8 8 Writing in a block 18 8 9 Writing in a block with aut...

Page 3: ...3 v7 0 10 Certifications 24 11 Code examples and extended information 25 12 API changelog 28 Index...

Page 4: ...tood as a remote storage unit where we can read and write information without contact Most of the RFID tags are passive which implies that the RFID module must create an electromagnetic field in order...

Page 5: ...e 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 Figu...

Page 6: ...ol these operations Waspmote is connected to the RFID NFC module through its UART interface The ISO IEC 14443 A Mifare standard offers a 3 pass authentication method to enable secure encrypted communi...

Page 7: ...igfox LoRaWAN Bluetooth Pro Bluetooth Low Energy and RFID NFC Besides the following Industrial Protocols modules are available RS 485 Modbus RS 232 Serial Modbus and CAN Bus Some of the possible combi...

Page 8: ...Sensor Boards Agriculture v30 and Agriculture PRO v30 Incompatible with Watermark and solar radiation sensors Events v30 Incompatible with interruption shift register Gases v30 DIGITAL6 is incompatibl...

Page 9: ...and 6 The first 6 bytes 0 5 are the key A and the last 5 bytes 10 15 are the key B As we will see before reading or writing in any block we must first authenticate us to that sector by providing one...

Page 10: ...mains within the field until the whole process is completed Figure Typical RFID NFC operation Some kind of indicator is strongly advised to let the user know that data exchange was successful Waspmote...

Page 11: ...usands of millions that you find another card like yours Q Can I order or select a specific UID for my card A No the cards UIDs are set in a random way Q I do not know remember the key for a certain b...

Page 12: ...n other sectors One example sector 2 personal general info key only known by all the institutions of the city council sector 3 city s transport info key only known by the bus company sector 4 city s l...

Page 13: ...ange bigger amounts of data 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 softwar...

Page 14: ...nction Brief description bool configureSAM void set internal parameters of the PN532 sendTX uint8_t dataTX uint8_t length uint8_t outLength Send data stored in dataTX getACK void Wait for ACK response...

Page 15: ...ne card s block readWithAuth UID key data ad authenticates one card s sector and reads one block write ad data writes one card s block writeWithAuth UID key data ad authenticates one card s sector and...

Page 16: ...EC 14443 A card in the field does the anti collision loop and selects the card to operate This function is enough for those applications which just require to get the UID of cards since most of the IS...

Page 17: ...TQ inits systems and look for cards state RFID13 authenticate UID 2 key authenticates block number 2 all sector 0 actually of the selected card State of the executed function is stored http www libeli...

Page 18: ...unique identification of a card uint8_t key 6 stores the key or password memset key 0xFF 6 the key by default edit if needed state RFID13 init UID aux inits systems and look for cards state RFID13 aut...

Page 19: ...ards state RFID13 authenticate UID 2 key authenticates the block memset aux 0x00 16 stores 0 s in aux 16 bytes writeAndCheckWithAuth UID key aux 2 authenticates block 2 then writes the content of aux...

Page 20: ...6 stores the new key A uint8_t keyB_new 6 stores the new key B uint8_t config_new 4 0xFF 0x07 0x80 0x00 same cfg memset keyA_old 0xFF 6 the key by default edit if needed memset keyA_new 0x88 6 the ne...

Page 21: ...if the read UID is the same than the original card tr will be true http www libelium com development waspmote examples RFID1356 06 single cards counter 8 17 Searching a UID among a group of UIDs This...

Page 22: ...text aux converts from string to a uint8_t pointer http www libelium com development waspmote examples RFID1356 03 bus ticketing 8 19 Converting from a uint8_t pointer to an integer This function conv...

Page 23: ...d 25 ms write 25 ms So a full read or write in a block process init authenticate read or init authenticate write could take around 75 ms However a standard UID read init can take just 25 ms There is a...

Page 24: ...ifications See below the specific list of regulations passed More info at www libelium com products plug sense Besides Meshlium our multiprotocol router for the IoT is also certified with the certific...

Page 25: ...ut WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of...

Page 26: ...ock number 1 and check afterwards state RFID13 writeAndCheck aux 1 if state 0 for int i 0 i sizeof text i clear this variable text i 0 firstDone true check the 16 bytes in block 1 state RFID13 read 1...

Page 27: ...ess happened check the 16 bytes in block 1 state RFID13 read 1 aux if state 0 if the read command was successful we show the data 16 bytes USB print r n Credit after the trip for int i 0 i 16 i if aux...

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

Reviews: