You are on page 1of 7

DEVELOPMENT OF NFC BASED IAP FOR WIRELESS SENSOR NODES

1Anjali Rajan, 1Dr. S. Rajkumar, 2T.S. Shrikrishnan , 2Jemimah Ebenezer, 2R. Jehadeesan
1Nehru College of Engineering and Research Centre, Pampady
2Electronics & Instrumentation Group,
Indira Gandhi Centre for Atomic Research, Kalpakkam

Abstract-In a large scale WSN deployment, external memory, RAM, ADC could be present
reprogramming the WSN nodes with new based on the application requirement.
firmware using In-System Programming (ISP) Usually batteries, both rechargeable and non-
by opening the enclosure of WSN node will be rechargeable, are the main source of power
a tedious job. Instead, reprogramming could supply for sensor nodes. Energy harvesting
be achieved by providing physical access to techniques including solar power and wireless
Joint Test Action Group (JTAG) on the power transfer (WPT) are used to charge
enclosure; but it will compromise the Ingress rechargeable batteries.
Protection (IP) rating of WSN node. Thus, Generally, microcontrollers in the sensor node
Wireless based In-Application Programming can be programmed using ISP/JTAG. Typically,
(WIAP) could be preferred. Near Field microcontrollers supporting ISP have internal
Communication (NFC) is a secure and circuitry to generate any necessary programming
promising short distance radio communication voltage from the system's normal supply voltage,
technology. This paper presents how an NFC and communicate with the programmer via a
transceiver can be utilized to program the serial protocol using clock and data pins.
microcontroller of WSN nodes. It also explains Most programmable logic devices use a
the development of boot loader program for variant of the JTAG protocol, in order to facilitate
WSN node to support WIAP. easier integration with automated testing
procedures. JTAG allows device programmer
Keywords-Wireless Sensor Network, In-System hardware to transfer data into internal non-
Programming, Wireless based In-Application volatile device memory. JTAG programmers are
Programming, Near Field Communication also used to write software and data into flash
memory.
I. INTRODUCTION Large scale or wide area deployment of
WSN include, a multitude of physical
Wireless sensor network (WSN) consists of
environments where continuous, large scale
several nodes each connected to one or more
monitoring and situation analysis are of great
sensors and are used for area monitoring, health
interest. In such situations, reprogramming these
care monitoring, environmental/earth sensing,
microcontrollers by opening the enclosure of
industrial monitoring, etc [1][2]. By introducing
sensor node will be difficult. For instance, to ease
WSN to monitor the plant parameters, it reduces
the reprogramming, if physical access of
the cable laying and maintenance expenditures.
microcontroller pins are provided outside the
Further it aids in scalability and fire proof
enclosure of sensor node, it not only violates the
installations. Sensor node generally comprises of
ingress protection rating, security breach will also
microcontroller, radio transceiver unit and signal
be a serious issue. So, Wireless based In-
conditioning circuit unit. Auxiliary units like
Application Programming (WIAP) is chosen to
reprogram the microcontroller which is the
combination of IAP and a short range wireless security during mobile payment services[6].
communication technology (here, NFC). Based on these aforementioned papers, we have
proposed an approach that uses NFC for Wireless
II. LITERATURE SURVEY based In-Application Programming of
microcontroller in WSN.
Ferro, Silva & Lopes presented a
specification for a compact, portable, data-layer III. COMPARISON OF WIRELESS
that can be used to support seamless dynamic TECHNOLOGY FOR WIAP
reprogramming of WSN, based on the notion of
periodic, non-preemptive tasks running in the There are different protocols for wireless
base OS[3]. Gohane & Khekare developed a communication including Bluetooth, wifi, zigbee,
system that can be used to wirelessly reconfigure Irda, NFC, etc. Table 1 illustrates the selection of
the software module of the industrial embedded NFC over other wireless communication
devices and machines using application protocols. NFC has shorter working distance than
programming interface (API). Using these APIs Bluetooth, which reduces the unwanted
various machine parameters can be assigned to interception. In contrast to ZigBee, NFC has
the software module[4]. Doug & Kenji proposed faster transmitting speed with same set-up time
the opensource platform of JavaMail NFC(JNFC) and power consumption. When compared to
to emulate the functionality of the Android NFC NFC, WiFi cost more power and IrDa need a
P2P API. DroidWSN model has been direct line of sight to connect two devices, and a
implemented for data exchange and even though little longer (0.5s) set-up time. Hence, NFC is
the execution time of emulator was slower, the decided as the most suitable technology for
design was simple and flexible[5]. Cai, Weng, & transferring application code for a wireless based
Liu proposed a research model to utilize NFC to IAP.
improve privacy and mobile authentication
Table 1: Comparison of communication technology

Property NFC Bluetooth 2.1 Zigbee 802.11 IrDa


(WiFi)
Network Peer to peer Adhoc,Very Adhoc, Peer to peer, Point to hub Point to point
topology small networks Star or mesh

Data rate 424Kb/s 2.1 Mb/s 250Kb/s 54Mb/s 16Mb/s

Frequency 13.56MHz 2.4-2.5GHz 868MHz(EU),900- 2.4 and 5 GHz Not Applicable


928MHz(NA),2.4G
Hz(worldwide)

Range 0.1 m 30 m 10-100 m 50-100 m 1m

Setup time <0.1 s <6 s 2.6 ms 0.5 s

Power <15 mA <30 mA Very low High Not available


Consumption
Near-field communication (NFC) is a set of ISO/IEC 14443 standard, they are addressed as
communication protocols that enable two Type A and Type B. In NFC type A, Miller
electronic devices to establish wireless encoding (delay encoding) is used with an
communication by bringing them within short amplitude modulation at 100%. Data is
distance. NFC utilizes electromagnetic radio transmitted at 106kbps when using Type A. In
fields operating at 13.56 MHz to NFC type B, Manchester encoding is used rather
intercommunicate. Devices using NFC may be than Miller encoding. Amplitude modulation is
active or passive. A passive device, such as an only at 10%. So, NFC type A tags are used.
NFC tag, contains information that other devices
can read but the reverse is not possible. On the Here, NFC Tag click™ that carries an
other hand, active devices like NFC reader and M24SR64 NFC/RFID tag IC with a dual interface
NFC transceiver operates in bidirectional way. and 8KB of high-reliability EEPROM built-in has
been chosen for sensor node.. The RF protocol is
An NFC tag usually consists of an antenna compatible with both NFC Forum Type 4 Tag
connected to a small memory chip, which is and ISO/IEC 14443 Type A.
written with the information about the item to
which it is attached. An NFC reader or B. NFC Transceiver
transceiver brought near the tagged article,
Table 2: Comparison of NFC Transceivers
powers the circuit through the electromagnetic
field and by this, the data stored in the memory ST95HF TRF7970A
chip can be read. NFC reader is an initiator which Standards 1)ISO/IEC 1)ISO15693
initiates the communication & controls the data 14443 Type A 2)ISO18000-3
exchanges to the target device[7]. NFC and B 3)ISO14443A/B
2)ISO/IEC, 4)FeliCa
transceivers support both reader and tag ISO/IEC
operations and are cheaper than NFC readers. In 18092
the setup explained in this paper, NFC transceiver 3)MIFARE®
is selected in the NFC programming device and Classic
also an NFC tag is connected to the compatible
Modes Of 1)Read/write 1)Read/write
microcontroller of wireless sensor node. Communication mode mode
2)Card 2)Card
IV. SELECTION OF NFC CHIPS emulation emulation
mode mode
There involves several key factors when selecting Input Voltage 2.7 V to 5.5 V 2.7 V to 5.5 V
an RFID technology. The priority of these factors Range
depends upon the application. They are namely SPI Interface 528 byte FIFO 127 byte FIFO
reliability, security, compliancy, Read/Write
range, Read/Write speed, Multi-tag capabilities, Power 1W 1.1W
environment, cost, etc. Dissipation

A. NFC Tag
Most commonly used proximity NFC
The ISO/IEC 14443 standard is a four-part transceivers are ST95HF and TRF series like
international standard for contact-less smart cards TRF7970A, TRF7960A, TRF7962A, TRF7963A,
operating at 13.56 MHz in close proximity TRF7964A, etc. Among the TRF series,
(~10cm) with a reader antenna. There are two TRF7970A is preferable since it operates at wider
main communication protocols supported by the
temperature range than others. Table 2 shows configurable parameters like unique node- ID,
comparison based on ISO standards, modes of rate of transmission, etc., numpad and LCD
communication, input voltage range, SPI display are used. The firmware read from the
interface and power dissipation reveals that micro SD card is then transmitted to the WSN
ST95HF has slightly better edge than the other microcontroller through NFC transceiver. It uses
transceivers. magnetic induction to create a radio-wave field
with the target. It helps the target to detect and
ST95HF also have dedicated internal frame access, allowing data to be transferred wirelessly
controller, transmission and reception modes, over a relatively short distance. A four wire loop
optimized power management, tag detection antenna is used for transmission. An antenna
mode and field detection mode. matching circuit is associated between the NFC
transceiver and loop antenna for impedence
matching. Here, target will be the NFC tag which
V. SYSTEM OVERVIEW OF
receives the code and flashes to the
WIRELESS IN-APPLICATION
microcontroller of wireless sensor node. Figure 2
PROGRAMMING
shows the hardware implementation of NFC
programming kit.

Fig.1 Block Diagram of System Setup

A. Hardware Development

In large scale WSN deployment, each sensor


nodes should be reprogrammed according to the
desired application. For this wireless
programming, an NFC programming kit should
be designed. NFC transceiver, micro SD card,
numpad and LCD display are interfaced to the
microcontroller of NFC programming kit as
depicted in figure 1. The base firmware to be
updated in the WSN sensor node will be read
from micro SD card. In order to select
Fig.2 NFC Programming kit
B. Software Development the phase and polarization are defined with CPOL
= 0 and CPHA = 0 which corresponds to transfer
The developed embedded program is split mode 0. The SPI character size is configurable to
into two parts. First part involves interfacing all eight or nine bits. SPI communication is MSB
the above mentioned peripherals with the first. This can be configured using Data Order
microcontroller of the NFC programming kit and (DORD) bit.
to transmit the firmware via NFC. Second part Writing a character will start the SPI
involves the bootloader programming for wireless clock generator, and the character is transferred to
sensor node to update its application firmware. the data register when it is empty. Once this is
done, a new character can be written. As each
C. Peripheral Driver Development for NFC character is shifted out from the master, a
Programming Kit character is shifted in from the slave. If the
receiver is enabled, the data is moved to the
1) RF transceiver and micro SD card receive buffer at the completion of the frame and
can be read by the slave.
ST95HF is an NFC transceiver for contactless
application. It includes frame coding and RF 2) LCD Panel
modulation, thus allowing the connected
microcontroller to send and receive NFC In NFC programming kit, 16x2 LCD panel is
commands in the supported protocols. ST95HF is used. Liquid Crystal Display (LCD) is very
a slave device, hence a host (microcontroller) is helpful in providing textual information to user.
required to control it. The ST95HF is connected LCD is a flat panel display that uses the light
to the MCU using an SPI communication [8]. modulating properties of Liquid Crystals (LCs).
In order to send commands and receive Steps involved in writing a command or data into
replies, the application software has to perform the LCD are:
three steps.
 Send the command to the ST95HF.  Place the Data/Command in the pins D0-
 Poll the ST95HF until it is ready to D7 of the LCD.
transmit the response  Make the RS(register select) pin of the
 Read the response LCD low, that is RS=0 to write command
The SPI_SS line is used to select a device on the  Make this RS high, that is RS=1 to write
common SPI bus. The SPI_SS pin is active low. data.
When the SPI_SS line is inactive, all data sent by  EN of the LCD must undergo a high to
the master device is ignored and the MISO line low logic transition with some delay in
remains in high impedance state. So, the host between them, that is EN=1 to EN=0 with
asserts the SPI_SS line low and issues a specific delay.
‘Reading’ command to read data. When all data  The R/W pin should remain in the Logic
is read, the application asserts the SPI_SS line 0.
high.
Here, both NFC transceiver and micro SD 3) Hex Keypad
card supports SPI transfer mode 0. i.e, data must
be sampled at the rising edge of the SCK signal. Hex keypad 4x4 is used for loading numerics into
This is configured by selecting clock polarity the microcontroller. It consists of 16 buttons
(CPOL) and clock phase (CPHA). In slave mode, arranged in a form of an array containing four
lines and four columns. Polling of keypad takes performed by taking NFC programming kit near
place by keeping a specific row low at a time and to the sensor node.
read the status of the column pins as input at that
instant. This chain continues for all the rows and VII. REFERENCES
by this way sequential keypress can be read by
microcontroller. Steps involved in interfacing hex [1] “Wireless Sensor Network”, Available
keypad are as follows: at:https://en.wikipedia.org/wiki/Wireless_sensor_
network.
 Drive a 0 on a row.
 Read all the columns. [2] Yang, K. (2014). Wireless sensor networks.
 If any key had been pressed, its column Principles, Design and Applications.
will be 0, else 1.
 Keep repeating in a loop for each [3] Ferro, G., Silva, R., & Lopes, L. (2015,
successive row. October). Towards Out-of-the-Box Programming
of Wireless Sensor-Actuator Networks. In
D. Boot loader for Wireless Sensor Node Computational Science and Engineering (CSE),
2015 IEEE 18th International Conference on (pp.
Non-Volatile Memory (NVM) is a 110-119). IEEE.
reprogrammable flash memory that retains
program and data storage even during power off [4] Gohane, S. P., & Khekare, G. S. (2015,
condition. The bootloader program of sensor January). Reconfiguration of industrial embedded
node utilizes NVMCTRL to write the application system in WSN. In Intelligent Systems and
firmware onto its flash memory of Control (ISCO), 2015 IEEE 9th International
microcontroller[9]. The SPI bootloader is Conference on (pp. 1-5). IEEE.
initiated by the application program once it
identifies a valid request for reprogramming is [5] Doug Serfass, Kenji Yoshigoe, “Wireless
being sent via NFC. SPI bootloader checks for Sensor Networks using android virtual devices
authentication and after the validation of the and Near Field Communication peer-to-peer
newly transmitted application program, it flashes emulation”, Southeastcon, 2012 Proceedings of
the code onto the flash memory. Thus IEEE
reprogramming/upgrading the application
program of sensor node using NFC was [6] Cai, C., Weng, J., & Liu, J. (2016, June).
implemented. Mobile Authentication System Based on National
Regulation and NFC Technology. In Data
VI. CONCLUSIONS Science in Cyberspace (DSC), IEEE International
Conference on (pp. 590-595). IEEE.
In a large scale WSN deployment,
[7]A Technical report on “NFC for embedded
reprogramming the sensor node is a cumbersome
applications”,(2014) Available at:
job. In order to ease the application program
https://www.nxp.com/documents/brochure/75017
update, NFC based IAP has been chosen. To
587.pdf
provide node specific configurable parameters, an
NFC programming kit with hex keypad and LCD
display has been developed. Application code can [8] User manual of “EVAL-ST95HF firmware
be loaded onto a micro SD and after setting node functionalities”, Available at:
specific parameters, NFC based IAP could be http://www.st.com/content/ccc/resource/technical
/document/user_manual/34/4d/7b/b3/40/7b/4b/72
/DM00123114.pdf/files/DM00123114.pdf/jcr:con
tent/translations/en.DM00123114.pdf

[9]SAM D20 SD Card Bootloader


[APPLICATION NOTE] Atmel-42455A-SAM-
D20-SD-Card-
Bootloader_ApplicationNote_062015, Available
at: http://www.atmel.com/Images/Atmel-42455-
SAMD20-SD-Card-Bootloader_Application-
Note_AT06037.pdf

You might also like