• No results found

Storing and reading sensor data from battery assisted passive RFID

N/A
N/A
Protected

Academic year: 2021

Share "Storing and reading sensor data from battery assisted passive RFID"

Copied!
40
0
0

Loading.... (view fulltext now)

Full text

(1)

UTH-INGUTB-EX-E-2011/09-SE

Examensarbete 15 hp

November 2011

Storing and reading sensor data

from battery assisted passive

RFID

(2)
(3)

Teknisk- naturvetenskaplig fakultet UTH-enheten Besöksadress: Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0 Postadress: Box 536 751 21 Uppsala Telefon: 018 – 471 30 03 Telefax: 018 – 471 30 00 Hemsida: http://www.teknat.uu.se/student

Abstract

Storing and reading sensor data from battery assisted

passive RFID

Filip Zherdev

Radio Frequency Identification (RFID) technology is an electronic labeling technique. These electronic labels are called tags and read wirelessly. In this thesis a battery and a microprocessor are connected to the tag. The work consisted of programming the microprocessor to transfers sensor data into the tags memory. The tags are placed on trains and data is collected from sensors at the train's axle. That way sensor data can be transmitted from a train to readers stationed along the railroad tracks. The aim of the project is to predict service intervals. There is currently no possibility to see wear in real time and stop a train before it breaks. At present, there is a form of heat detectors located along the railroad tracks to measure temperatures of wheels and axles of passing trains. These are expensive and have the disadvantage of being able to detect errors that have already occurred, they can not detect errors that do not radiate heat.

The thesis aims to provide a solution for this. By programming a microprocessor to transmit sensor data to the tags memory it is possible for an RFID reader to read the sensor data from the tag. Ensuring that data and identity can be read from the tag at speeds up to 250 km/h, you can get the status of a trains wagon before it breaks.

(4)
(5)

Sammanfattning

(Abstract in Swedish)

Radio Frequency Identification (RFID) teknologi är en teknik för att märka objekt elektroniskt. Dessa elektroniska etiketter kallas för taggar och utläses trådlöst. I detta examensarbete kopplas ett batteri och en mikroprocessor till taggen. Arbetet gick ut på att programmera microprocessorn för att överföra sensordata till taggens minne. Taggar placeras på tåg och data samlas in från sensorer vid tågets hjulaxel. På så sätt kan man sända sensordata från ett tåg till läsare utposterade längst järnvägsrälsen.

Syftet med hela projektet är att kunna förutspå serviceintervall. I dag saknas

möjligheten att i realtid se förslitningar och stoppa tåg innan dom havererar. I nuläget finns det en form av värmedetektorer utplacerade som mäter temperaturer på hjul och axlar hos förbipasserande tåg. Dessa är dyra och har nackdelen av att endast kunna detektera fel som redan uppstått, dom kan heller inte mäta fel som inte utger värme. Examensarbetet siktar på att lösa detta. Genom att programmera en mikroprocessor för att vidarebefordra sensordata till taggens minne kan en RFID läsare, läsa ut sensordata från taggen. Säkerställa att data och ID går att utläsa från tagen i hastigheter upp till 250 km/h, på så sätt kan man få ut status om en tågvagn innan den havererar.

Nyckelord

(6)

Preface

To round off a Bachelor of Science degree in electrical engineering, this thesis was carried out in the summer of 2011. The client was Uppsala University and the company Upwis AB, the project's end customer is the Swedish transport administration

(Trafikverket). The sponsor of the project is called WISENET who is a network

consisting of researchers and businesses. WISENET is financed to a third by Vinnova, a third by Uppsala University & SICS and the rest by participating businesses. The mission of WISENET is to enable wireless sensor networks that meet current and future requirements on functionality, size, cost, endurance, reliability, energy handling,

sensitivity and security [12].

The University's role was to assist with subject examiners, supervisors, premises and equipment. Upwis AB has been providing hardware and guidance.

Subject Inspector Anders Rydberg, Uppsala University, Department of Engineering Sciences.

Supervisor's Mathias Grudén and Magnus Jobs, Uppsala University, Department of Engineering Sciences.

Erik Jansson, Upwis AB.

The thesis has been a part of a larger project consisting of four theses. Where each work has been required to achieve an effective and common end result. Nils Edvinsson has been responsible for Power Scavenging. Thomas Edling for the construction of the RFID antenna. Malkom Hinnemo for the construction of the 2.45 GHz antenna. My role was to stand for the software part.

Many thanks to all involved for a rewarding summer! Filip Zherdev

(7)

Table of Contents

Overview...1

1.1 Background...1

1.2 Problem description...2

1.2.1 Specification...2

1.2.2 Boundaries and limitations...2

Theory...3

2.1 RFID - Radio Frequency Identification...3

2.1.1 ISO 18000-6C and EPC Gen2...4

2.2 Gen2 protocol...4

2.2.1 PIE encoding, Reader => Tag...4

2.2.2 Preamble & Framesync, Reader => Tag...5

2.2.3 Miller and FM0 encoding Tag => Reader...5

2.2.4 Commands and state machine...6

2.2.4.1 Select ...6

2.2.4.2 Inventory...6

2.2.4.3 Access...7

2.2.5 Sessions & inventory flags...8

2.2.6 Selected flag...9

2.2.7 Cyclic redundancy check (CRC)...9

2.2.8 Tag memory...9

2.2.8.1 Reserved ...10

2.2.8.2 EPC...10

2.2.8.3 Tag Identity (TID)...10

2.2.8.4 User...10

2.3 Speed vs robustness ...11

2.4 Low Level Reader Protocol (LLRP)...12

2.5 Serial Peripheral Interface (SPI)...12

2.6 Radio link 802.15.4...13 2.7 Hardware...14 2.8 Software...15 2.8.1 Contiki...15 2.8.2 Development environment...15 Experimental...17 3.1 Programming...17 3.1.1 PC software...17 3.1.2 Contiki applications...17 3.2 Measurements...18 3.2.1 Readout time...18

3.2.2 Distance & Angle, RFID...20

3.3 Calculations...22

Conclusion...23

4.1 Result & discussion...23

4.2 Further studies...24

References...25

(8)
(9)

Illustration Index

Figure 1.1: Wagon overview [13]...1

Figure 1.2: System overview...2

Figure 2.1: PIE encoding [4]...4

Figure 2.2: Preamble & Framesync [4]...5

Figure 2.3: FM0 encoding [4]...5

Figure 2.4: Miller encoding...6

Figure 2.5: Commands and state machine [4]...6

Figure 2.6: Inventory and collision [4]...7

Figure 2.7: Session & flag concept [4]...8

Figure 2.8: Logical memory map [4]...9

Figure 2.9: SPI overview...13

Figure 2.10: Star & P2P networks ...14

Figure 3.1: High interference mode...18

Figure 3.2: PR-ASK waveform Query command...19

(10)

Index of Tables

Table 2.1: Inventoried flags persistence time [4]...8

Table 2.2: RF air interface parameters [5]...11

Table 2.3: Impinj recommended parameters for different environments...11

Table 3.1: RFID, read time...19

(11)

Chapter 1

Overview

Present day monitoring of railway wagons detects hot bearings, locked brakes, flat wheels and other faults using stationary detectors. These detectors are expensive and separated by long distances. This means that one can only detect acute failures, which causes unexpected traffic delays and high costs as a result. It is therefore highly desirable to continuously monitor the railway wagons and store information from sensors in order to predict failure. The thesis will evaluate and improve a system designed to transmit information about the bearings status.

1.1 Background

The information is transmitted via a radio frequency identification (RFID) tag mounted on the train to a stationary RFID reader at the side of the railroad tracks.

An RFID system consists traditionally of a tag and a reader. The reader sends a request to the tag, which returns an answer in the form of an identity. With the request, the reader supplies the tag with enough energy to wake up and send their reply, thus the tag is in some sense passive.

This thesis deals with tags of battery assisted passive (BAP)-type and ISO 18000-6C standard, commonly referred as Gen 2 [3] - [5]. The tag is like a normal RFID tag, passive in the readout of the ID, but it also has the opportunity to do other than just identify itself, then with the aid of a battery. The collection from the sensors is done through the 2.45 GHz radio and the IEEE standard 802.15.4. Figure 1.1 shows an illustration of the system mounted on a train wagon.

(12)

The system is based around a system on a chip processor, sometimes called

microprocessor (from now on referenced as the CPU), that runs a small Linux operating system called Contiki [8]. Sensor data is collected by the CPU and written to the tag's memory. To access the tag's memory from the CPU the tag need batteries who also prolong the reading distance between the reader and tag. To communicate between Integrated circuits (IC's) the serial peripheral interface (SPI) protocol is used, and to control the reader a PC is communicating through the low level reader protocol (LLRP) over Ethernet and TCP/IP. An overview of the system can be seen in figure 1.2 below, the node in the figure consists of a CPU, 2.45 GHz radio and sensors.

1.2 P

roblem

d

escription

A BAP-tag is mounted on the side of a wagon. Adjacent to the rails, RFID readers are deployed. When a train passes by a reader, it is desirable to be able to read out the identity (electronic product code (EPC)) of the wagon and information in the form of sensor data that the tag collects. As an additional constraint the reader must have time to read the data before the train has passed.

1.2.1 Specification

Specification of the work to be done:

1. Experimental evaluation of one or two types of RFID hardware for reading and writing data (both via the RF interface and via SPI). 2. Performance tests of the RF interface for readout time

(in collaboration with other thesis dealing with antenna design). 3. Practical experiments in a real environment to verify

function (also in cooperation with other thesis).

4. If time is available implementation of 2.45 GHz radio.

1.2.2 Boundaries and limitations

The focus is on getting the RFID communications software functioning as desired. The transmission (via 2.45 GHz radio) and processing of data from external sensors is beyond the scope of this thesis but an attempt was made to get the basic functionality. Antenna theory are not considered, nor the environment in which they work.

Hardware is provided by Upwis AB and other graduate students.

(13)

Chapter 2

Theory

This chapter deals with the theory of RFID and the standard used. The emphasis is on the protocol and the way reader and tag interacts. A description of how different parameters affect the readout speed and the robustness of the RFID system is also addressed. The other protocols, hardware, software and tools used for this thesis are also briefly described.

2.1 RFID - Radio Frequency Identification

RFID is a digital bar code that is read with the help of radio waves and consists of a reader and a tag. The tag usually consists of an antenna, capacitor, and a small circuit that includes a state machine and an EPC witch is unique. When the antenna is exposed to radio waves it charges the capacitor up. Using the energy stored in the capacitor the circuit can be fed with power so that it wakes up and sends its response (usually its EPC id), these are called passive tags. In addition to passive tags, there are also active and BAP tags. Active tags have a battery that ensures that the they can transmit without first having to been awakened by a reader, the transmission range is usually longer [1]. BAP, which is used functions as a hybrid between passive and active tags, i.e. it looks to be passive for the reader but in fact it has a battery that allows for longer read range and a more advanced circuitry that can perform more work than simply respond with its ID. There are several different standards with different frequency ranges. In this thesis, the ISO 18000-6C is used because the Swedish transport administration (Trafikverket) has already tested passive tags to identify their wagons and thus have readers deployed in certain test sections.

The key characteristics of ultra high frequency (UHF) tags are fast data transfer (read up to 100-200 tags per second) [2], the ability to run in BAP mode and long range up to 8 m. The UHF frequency bands are between 865 MHz - 955 MHz. For Europe the band is 865.5 MHz – 867.6 MHz [5]. Unlike tags at at lower frequency’s and reading

distance, UHF tags use a method called backscattering. It means that the tag does not send its reply in a traditional manner described above. To the antenna a zener diode or a transistor is connected in parallel, thus you can turn off or on the antenna. The antenna acts as a radar object with different phase and amplitude depending on whether it is "off" or "on". These reflections are interpreted as ones and zeros by the reader. Advantages of backscatter is longer reading distance and less energy consumption by the tag.

(14)

2.1.1 ISO 18000-6C and EPC Gen2

There may be some confusion when talking about standards for RFID in particular the part dealing with UHF which is used in this thesis. ISO 18000-6 standard is a regulatory framework for radio traffic between the reader and tag. EPC global is the name of the organization that deals with standardization of bar codes and their Gen 2 [4] standard deals with the EPC number and protocol for UHF RFID. In July 2006, the EPC Gen 2 protocol was approved and adopted by the international standards organization (ISO) as the ISO 18000-6C standard. It is therefore common that it is referred to either one when you really talk about ISO 18000-6C. In this work, reference is to Gen2 as it is the EPC Gen2 data sheet that have been used to find information about how data communication functions [4].

2.2 Gen2 protocol

This section is referenced from the EPC data sheet, some parts are in own words or rewritten to make it easier to grasp.

The reader communicates by sending out a carrier wave which is Double Sideband Amplitude Shift Keying (DSB-ASK), Single Sideband Amplitude Shift Keying (SSB-ASK) or Phase Reversal - Amplitude Shift Keying (PR-(SSB-ASK) modulated (see Appendix I for figures) . Commands are Pulse Interval Encoded (PIE) encoded, it is the carrier wave that provides the tag with energy. The tag responds by backscatter an ASK and or PSK modulated signal with either FM0 or Miller encoding [4]. Communication is half duplex which means that communication goes one way at the time, thus the tag does not demodulate a signal from the reader while it responds.

2.2.1 PIE encoding, Reader => Tag

Tari is the time to send a zero, it is variable and determines the data transfer rate, Tari

must not be changed during data link. Tari should be between 6.25us and 25us ± 1%. A

one is 1.5-2 Tari long, PW (the low time in figure 2.1) between 0.265-0.525 Tari long and

is equal for both ones and zeros. The bit rate is 40-640kbps.

(15)

2.2.2 Preamble & Framesync, Reader => Tag

Each communication round starts with a preamble which is a synchronization signal for future commands. The purpose of preamble is to determine the transfer rate and

synchronize tag with the reader. Preamble always precede a Query command that starts an inventory round. Framesync is a shortened preamble that precedes the other

sequences. See figure 2.2 below.

2.2.3 Miller and FM0 encoding Tag => Reader

In FM0 Bi-Phase Space Encoding is used, it means that each character is inverted between clock cycles. A logical one is always high or low during T (T = time for one symbol). A logical zero switches from high to low after T/2 or vice verse, see figure 2.3. This means that the transmitter and reader need a state machine that keeps track of the last received/transmitted bit to interpret the incoming/outgoing. The last bit in a

sequence is always a one as stop bit. As with PIE encoding, preamble is used. There are two types, and which one to use is determined by the reader when it sends its Query command. It is also the reader that determines what encoding the tag will respond with.

Figure 2.2: Preamble & Framesync [4]

(16)

Miller encoding is similar to FM0 but here a logical one goes high/low when T/2 and a logical zero goes high/low after T. The data is called baseband and multiplied by a subcarrier clock. For Gen 2 Miller subcarrier encoding with M = 2, 4 & 8 is used. The variable M indicates how many subcarrier clock pulses there should be in a bit of data, see figure 2.4. As with FM0 there are two types of preambles that the tag will respond with and a one as a stop bit. As with FM0 a state machine is also necessary to keep track of incoming & outgoing symbol. Again it is the reader who decides which preamble to use.

2.2.4 Commands and state machine

The reader has three command types: select, inventory and access. The tag has 7 states for handling the commands from reader, see figure 2.5.

Below is a description of the commands and states.

2.2.4.1 Select

Manages tag populations by determining which tags to be inventoried and how. Each tag is assigned a session and the reader can send multiple select to divide the tags into different groups.

2.2.4.2 Inventory

Here the reader sort out the individual tags to read out their EPC number and decide if it wants to go over to the Access commands. Each inventory starts with a Query command, appended with the command is a Q-value (0 - 15) that the tag will use to generate a slot counter number (a random number) in the interval (0 - 2Q-1). The Q value

can be set so that the inventory time is minimized if the size of the tag population is known.

Figure 2.4: Miller encoding

(17)

If a tag generates a slot number 0, it responds by sending a 16-bit random number to the reader while it changing state from Ready to Arbitrate and awaits new commands.

When the reader has received the 16-bit number it responds with an ACK command enclosed with the same 16-bit number. When the tag receives the command and number it replies with its EPC, while moving to the state Acknowledged. Now the reader have the opportunity to return the tag to the Ready or Arbitrate state and keep inventorying the other tags, or it could continue with the Access commands. By sending out a QueryAdjust command, tag goes to Ready and changes its status flag to inventoried . QueryAdjust & QueryRep, commands the other tags to count down their slot number, so the reader can graze the entire population. If two tags counts down to zero

simultaneously and the reader fails to read out their 16-bit number, reader will wait until the tags go into a timeout and returns to Ready with a new slot number. While the reader communicates with a particular tag, the rest of the population is located in Arbitrate idling. The figure 2.6 below shows a typical inventory and a collision.

2.2.4.3 Access

After the read out of the EPC number and the tag in Acknowledged, the reader can continue communicating with the same tag by sending out a Req_RN (Request Random Number) command, the tag responds with a new 16-bit random number called a

Handle. Tag is now moving into the Open state. The Handle now becomes a fixed value that’s attached in following communication with the Access commands such as Read, Write, or Kill. If the tag's memory is password protected, the password must be attached so that the tag can enter Secured state, if the password is zero (not programmed) the tag automatically goes to Secured. When in Secured it can receive any commands. Now the reader can read and write to the different parts of the tag's memory. In this state, it is also possible to kill the tag by Kill command, it means that the tag is permanently disabled from responding to requests.

For detailed state diagram see Appendix II, and for a detailed description of the

(18)

2.2.5 Sessions & inventory flags

Tags have 4 sessions (denoted S0, S1, S2, and S3). Tags shall participate in only one session during an inventory round. Two or more readers can use sessions to

independently inventory a common tag population. Tags shall maintain an independent inventoried flag for each session. Each of the four inventoried flags has two values, denoted A and B. At the beginning of each and every inventory round the reader

chooses to inventory either A or B tags in one of the four sessions. The inventoried flags are the only resource a tag provides separately and independently to a given session, all other tag resources are shared among sessions. After singulating a tag the reader may issue a command that causes the tag to invert its inventoried flag for that session (i.e. A→B or B→A). The reader may also put the tag into a different session. The sessions concept is illustrated in figure 2.7

All tags shall power up with its inventoried flags set to A if persistence time has expired, except for S0 who always power up with its inventoried flag to A. A tag’s inventoried flags shall have the persistence times shown in Table 2.1.

Figure 2.7: Session & flag concept [4]

(19)

2.2.6 Selected flag

Tags have a select flag (SL), which a reader may assert or deassert when using the Select command. This flag may be used if reader have some application specific preferences when sorting out tags. The Query command have a parameter to choose if reader wants to inventory tags with their SL flag asserted or deasserted or to ignore the flag and inventory tags regardless of their SL value. SL is not associated with any session. SL is common to all sessions and may be used in any session. SL persistence time is specified in Table 2.1 above.

2.2.7 Cyclic redundancy check (CRC)

A cyclic-redundancy check ( CRC) is a common way to detect faults in communication between electronic devices. The tag uses CRC to ensure the validity of certain reader to tag commands, and the reader uses CRC to ensure the validity of certain backscattered tag to reader replies. This protocol uses two CRC types: a CRC-16, and a CRC-5. To generate a CRC-16 a tag or reader shall first generate the CRC-16 precursor and then take the ones complement of the generated precursor to form the CRC-16. A tag or reader shall verify the integrity of a received message that uses a CRC-16 & CRC-5. At power up, a tag calculates and saves a 16-bit StoredCRC into memory. During

inventory, a tag may backscatter either this StoredCRC (after an ACK command see figure 2.6), or a 16-bit PacketCRC that the Tag calculates dynamically. Tags shall append a CRC to those replies that use a CRC, see APPENDIX III for command-specific replies.

2.2.8 Tag memory

Tag memory shall be logically separated into four distinct banks, each of which may comprise zero or more memory words, see figure 2.8 below.

(20)

These logical addresses are designed so that any reader can read specific words from any tag, regardless of tag brand. The physical addresses may however be vendor specific and user should see data sheet before trying to connect to tag by e.g. SPI or I2C. Commands that access memory have a MemBank parameter that selects the bank, and an address parameter to select a particular memory location within that bank. When tags backscatter memory contents, this backscattered content shall be in complete words. See description of the memory banks below:

2.2.8.1 Reserved

Reserved memory shall contain the kill and and/or access passwords, if passwords are implemented on the Tag. If a Tag does not implement the kill and/or access password(s ), the Tag shall logically operate as though it has zero-valued password(s) that are permanently read/write locked, and the corresponding physical memory locations in Reserved memory need not exist.

2.2.8.2 EPC

EPC Memory shall contain a StoredCRC, a StoredPC, a code (such as an EPC) that identifies the object to which the Tag is or will be attached, and if the Tag implements Extended Protocol Control (XPC) then either one or two XPC word(s).

2.2.8.3 Tag Identity (TID)

TID memory shall contain an 8-bit ISO/IEC 15963 allocation class identifier. TID memory shall contain sufficient identifying information for a reader to uniquely identify the custom commands and/or optional features that a tag supports.

2.2.8.4 User

User memory is optional. The logical addressing of all memory banks shall begin at zero (00h). The physical memory map is vendor-specific.

(21)

2.3 Speed vs robustness

The RF air interface is build around 8 modular communication parameters, see table 2.2. These parameters trade off speed for robustness, dependent on RF environment 6912 combinations are possible, witch is extremely flexible. The parameters are set by the reader and can be static or dynamic.

To make it easier to choose parameters, Impinj (reader manufacturer) shows a table of three recommended settings depending on user preferences. See table 2.3 for

recommended settings.

Max throughput: Relatively benign systems, retail stores

High Interference: Presence of other RF sources such as cell phones or arching

motors, manufacturing or industrial environments.

Dense Reader: Most hostile environment presence of other RFID readers, such

as warehouses and distribution centers.

Table 2.3: Impinj recommended parameters for different environments

Forward Link Reverse Link

Modulation Data Rate (Tari)

PIE ratio

Pulse Width

Modulation Encoding Divider Ratio

Data Rate (LF) Max

Throughput

PR-ASK 7.14us 1.5:1 Long <0.525Tari

ASK FM0 64/3 640

High Interference

PR-ASK 12.5us 1.67:1 Short >0.265Tari

PSK FM0 8 160

Dense Reader

PR-ASK 25us 2.0:1 Long <0.525Tari

ASK Miller-4 64/3 256

(22)

2.4 Low Level Reader Protocol (LLRP)

LLRP was ratified as a standard by the EPC global organization. It is a specification for the network interface between reader and its controlling software or hardware (in this thesis its the PC). The PC sends a list of rules to the reader in the form of an XML message, the rules are called specs. i.e. ROSpecs pass the rules for the reader operation (start/stop etc), AISpecs pass the rules for the inventory operations, AccessSpecs pass the rules for access operations. These specs allow the PC to preconfigure the reader, thus the communication is not time sensitive and the reader manages air protocol timing. The reader sends reports to the PC as its work progresses. The reports are also in XML format, and they have the ability to be timestamped. If real time interactions are desired, it is possible to setup the specs and hardware for that purpose.

2.5 Serial Peripheral Interface (SPI)

SPI doesn’t have a formal standard and can vary between different manufacturers. This is a general description based on references from individual IC manufacturers, see list of hardware 2.7 page 14.

SPI bus is a synchronous serial data link that operates in full duplex. Devices

communicates in Master/Slave mode, several slaves are allowed and selected by their chip select lines. SPI bus uses four lines to communicate.

SCLK: Serial Clock, output from master.

MOSI: Master Out Slave In line, output from master. MISO: Master In Slave Out line, output from slave.

CS: Chip Select, output from master, master needs a separate CS line for every slave if a multiplexer is not used.

To begin communication the master starts the clock at a speed supported by the slave. Then it pulls the CS line high or low depending on how the slave is build to get asserted. During each clock cycle master sends out a bit on the MOSI line and

simultaneously read MISO, slave reads MOSI bit and simultaneously sends out its own bit on MISO. This way a full duplex communication occurs. Master and slave have a shift register each who are connected in a ring, if most significant bit is shifted out then least significant bit is shifted in. Once the clock hits the last bit of the shift register the devices read or write new data to them, the transmission can also end if there are no more data to be transmitted. Besides the shift registers the IC:s have buffers to store temporary data and hardware interrupts that alarms other units so that they can processes data in time. Figure 2.9 on the next page show an overview of a master and two slaves.

(23)

2.6 Radio link 802.15.4

IEEE Std 802.15.4-2006 defines the protocol for data communication devices in a wireless personal area network (WPAN) [7]. WPANs are used to convey information over relatively short distances. Unlike wireless local area networks (WLANs),

connections effected via WPANs involve little or no infrastructure. This feature allows small, power efficient, inexpensive solutions to be implemented for a wide range of devices. WPAN key words are low data rate, low power, low complexity and short range RF transmissions.

A physical layer (PHY) is used, above it a medium access control (MAC) layer. To keep the complexity and cost down it is up to the user if he is interested in adding a further top layer, examples of such layers is ZigBee , 6LoWPAN.

PHY is responsible for the RF interface, data transmission services as well as interface an to the MAC layer. The RF interface operate at three different frequency bands: 868.0-868.6 MHz: Europe, allows one communication channel (2003, 2006) 902-928 MHz: North America, up to ten channels (2003), extended to thirty

(2006)

2400-2483.5 MHz: Worldwide use, up to sixteen channels (2003, 2006)

The MAC layer is an interface between the physical bottom layer and top layer. The MAC layer is to handle frame validation, manage preamble, control the channel selection, network beaconing, it also controls frame validation and handle node association [7].

(24)

The basic idea is that the network will run at 10 m distance and have a transfer rate of 250 kbit/s. On embedded circuits it is often desirable to have a low power consumption. As the standard is based on several different physical layers, the user can choose what suits him best. For example, user can lower the data transmission rate to achieve lower power consumption or use a less sophisticated top layer.

The network can be divided into two variants, star and peer to peer (P2P), see figure 2.10. A star is controlled by a central node that communicates with other nodes around it. In a P2P network all nodes communicate with each other and each node can forward information to a node outside its own scope. Each network version requires a full function device (FFD). There are also reduced function devices (RFD) which are built to be very simple and use very few resources, these require an FFD to communicate and may only associate with a single FFD at a time. The FFD can operate in three modes, personal area network (PAN) coordinator, a coordinator or as a device. A PAN coordinator is responsible for a whole network. Each node has a unique 64-bit

identification number. When contact have been established, nodes can go down to using a simpler format of 16-bit identifier in its PAN. As the standard does not deal with a top layer, the user can choose to use one that handles routing and multihop. Networks can be divided into clusters and have contact with each other via the PAN coordinator. In star networks the central node acts as the PAN coordinator.

2.7 Hardware

The hardware is developed by Upwis AB and consists of two circuit boards called the node and gateway. Both of them are identical part from the gateway that have an RFID circuit. The boards are based around a CPU core from ARM (Cortex M3) manufactured by ST microelectronics (STM32F103) [10]. The radio used between the gateway and nodes is the AT86RF231 from Atmel [6] and is based on the 2.45 GHz IEEE 802.15.4 standard. For RFID a BAP IC (EM4325) [11] from EM microelectronics is used. Besides these parts the boards contain power management, power scavenging modules, sensors (temp, gyro & accelerometer), programming support (JTAG) and USB

interface. Two antennas are designed in parallel with this thesis, one for RFID and one for 2.45 GHz. Building hardware to scavenge power is also a student thesis in parallel with these.

(25)

2.8 Software

This section describes the software and tools used to realize the thesis.

2.8.1 Contiki

This is the operating system (OS) [8] used by the CPU, it is based on a tiny version of Linux, quotes from their website describes it quite well:

"Contiki is an open source, highly portable, multi-tasking operating system for memory efficient networked embedded systems and wireless sensor networks.“

“Contiki is designed for microcontrollers with small amounts of memory. A typical Contiki configuration is 2 kilobytes of RAM and 40 kilobytes of ROM.” The development of contiki is lead by the Swedish institute of computer since (SICS). Upwis have made the software modifications to port this OS into the STM32F103. The kernel is event driven, on top of it programs can be dynamically loaded and unloaded in run time.

2.8.2 Development environment

The programming of software for this thesis was done using library’s containing source code, drivers and various examples supplied by SICS, Upwis AB and Impinj.

Languages used is C for Contiki and C++ for PC software. The reader uses XML code, but Impinj provides a C++ library in which it automatically parse the program

instructions into XML scripts and upholds the communication link with the reader. The Impinj library is a version of the LLRP toolkit with some additions of their own, they call it Octane LLRP [5].

The programming was done in a simple text editor and compiled using the GNU

Compiler Collection (GCC) in Linux. The physical programming of the CPU is done by using a JTAG programmer supported by open on chip debugger (OpenOCD) software. Debugging hardware wasn’t available at the time, instead debugging was made by printing messages to the PC screen. Node & gateway messages were printed in a terminal window via USB/RS232. Besides this an oscilloscope, spectroscope and and on board LED were used.

Git is the name of the version control system used [9]. Git gives each developer a copy of the entire development history. A project can be divided into different branches and merged back into the same branch. It keeps track of the different versions made, and the user can easily go back and compare changes between different versions.

(26)
(27)

Chapter 3

Experimental

This chapter deals with the programming, measurements, calculations and tests preformed.

3.1 Programming

The software programmed consisted of several small apps for the Contiki OS. For the PC, one application who was communicating with the reader.

3.1.1 PC software

The PC software is based on a simple example that is provided with the library. The example is modified so that the reader could be set according to desired preferences. Unused antennas were disconnected, testing different options for reading speed, (see 2.3 speed vs. robustness). The reader was setup to ignore the SL flag(to ignore previous settings from other possible readers or sessions) and leave the tag in session S0, flag A so that the same tag could be read continuously. Q value set to 0 for fast response. Reading & writing to user specified memory bank and address was implemented. The ability to see the received signal strength indication (RSSI) value for each reading was also implemented.

After gaining control over the tag parameters the next step was to read/store data in user memory and tag registers. Parameters in registers that were changed included the duty cycle, RF timeout and to turn off the extra functionality added by the IC manufacturer, tag was setup according to standardization. Because it is the reader behavior that

specifies the read speed and robustness, settings for these parameters in the tag memory had little or no effect. One theory about these parameters is that tag should be prepared for how it will communicate and this can speed up the process of setting up the right bit rate, modulation, RF timeouts, etc. This information can also be useful for the client connected via SPI.

3.1.2 Contiki applications

The first thing that had to be done was to establish an SPI link between the CPU and tag. When this was done data could be read and written to the tag memory. The CPU have two SPI buses, the second was setup to communicate with the 2.45 GHz radio device. When this worked two different applications was made, one for the gateway and another for the node. Data could now be sent from the node to the gateway and stored in its tag memory, implementation to see the RSSI value was added. To make it more interesting the data consisted of temperature and node ID. The temperature was read from the on board temperature sensor using I2C. The smallest amount of data that the RFID reader can read is one word (2 bytes). Therefore one byte was dedicated for temperature and the other one for node ID and status.

(28)

To save power, the circuitry have to be in stop mode the majority of its time. That means everything must be shut off except a wake up function. The CPU have a real time clock (RTC) that runs when the CPU is in stop mode. A test application was made using stop mode and RTC to wake up the CPU and let it run some processes (eg. send / transmit data), then send it back to stop mode.

3.2 Measurements

There were two types of measurements done. The first one was to see how long it takes to acquire one word of data including the time for tag power up, interrogation and the actual reading of data. When the readout time is known, the distance and angel between reader and tag have to be measured. In that way the the maximum speed for the train can be calculated.

3.2.1 Readout time

To measure RFID read time, a spectrum analyzer (setup to measure in the time domain) was used, see figure 3.1. That way one could see how long it takes to read a word from the tag, interpret the coding and see if the reader and tag behaves as they are setup to do. Different speed vs robustness settings was tested and measured.

The big square pulses show reader activity, the spikes within the pulse are ASK

(29)

Table 3.1: RFID, read time

Mode First square pulse (Seconds)

Second square pulse (Seconds)

Max Throughput 0.0223 0.0185

Dense Reader M=4 0.0287 0.0216

Dense Reader M=8 0.0288 N/A

AutoSet Dense Reader

0.0534 N/A

Table 3.1 show measured time for reading out one data word form tags user memory in four different modes. The measured times represent the two square pulses in figure 3.1 were each one of them is a complete readout of the data word. The measurement goes from the beginning of a square pulse to the beginning of the next one. The first read out is always a little bit longer then the following ones, this can be a result of reader power up and or tag power up. The first reading time is the one used in calculations. The Q value is set to 0 for faster response and the assumption that no other tags are present.

Figure 3.2 shows the first spike (command) of figure 3.1. The signals corresponds quite well with the examples of a PR-ASK waveform shown in Appendix I. It can also be seen that it is in PIE format. When interpreted the message reads:

Preamble – Query – DR = 64/3 – M=4 – Pilot tone – SelAll – S1 – Target A – 0 slots in the round – CRC5.

Appendix III shows the list of commands and their property’s.

(30)

By checking all the spikes in a square wave pulse it was possible to confirm the reader setup and try different setups. This made it possible to make an accurate measurement of the readout time with the desired settings and received data word. A typical content from one standard readout:

1. Query Searching for tags

2. Query Searching for tags

3. ACK Found one

4. Req_RN Request RN16

5. Read Read the word

6. Query_rep Send tag do different session 7. Query_Adjust Adjust Q

8. Query_Adjust Adjust Q

3.2.2 Distance & Angle, RFID

Measurement of distance from reader and the distance to left/right for angle calculation, in cooperation with other thesis working on the antenna design. The antenna used was a prototype made for hostile environments (the train). Measurements were made with the antenna on a large metal container outdoors 1 m above the ground to simulate the train. The measurements were made by reading the tag and the received signal strength indication (RSSI) value in dBm. 0 dBm is equivalent to 1 mW received power and -70 dBm is equivalent to 100 pW. When the signal is -70 dBm or below, the reader consider it as background noise and disregards it. When the RSSI values approaches -70 dBm data loss and inconsistent read outs occurs. The values in table 3.2 (next page) only represents measurements with no losses and are therefor considered as safe to use in calculations. By looking at the RSSI and distance in the table 3.2, it can bee seen that the signal rapidly decrees with distance and or angle.

(31)

Table 3.2: Distance & Angle

Distance to left (m) Distance from center (m

) Distance to right (m) RSSI (dBm) average of ~30 reads

2.00 -34.00 2.00 1.00 -40.00 2.00 1.50 -53.00 1.00 2.00 -40.00 2.00 2.00 -55.00 2.70 -46.00 2.70 1.00 -46.00 2.70 2.00 -55.00 2.70 3.00 -63.00 1.00 2.70 -51.00 2.00 2.70 -49.00 3.00 2.70 -63.00 3.00 -44.00 3.00 1.00 -48.00 3.00 2.00 -57.00 3.00 3.00 -63.00 1.00 3.00 -48.00 2.00 3.00 -44.00 3.00 3.00 -54.00 4.00 -42.00 4.00 1.00 -44.00 4.00 2.00 -50.00 4.00 3.00 -63.00 1.00 4.00 -45.00 2.00 4.00 -49.00 3.00 4.00 -59.00

(32)

3.3 Calculations

The aim for this thesis is to see if one word of user data can be read from a trains RFID tag, when it passes by at a maximum speed of 250 km/h and at a maximum distance of 2.7 m from the reader as shown in figure 3.3. The values are defined by the Swedish transport administration (Trafikverket). Distance between rail and reader are 3 m witch gives 2.7 m between tag and reader. The reader is posted 1 m above the rails and the tag 0.5 m - 1 m above the rails.

To be able to read the tag at a maximum velocity of 250/3.6 = 69.44 m/s using the measured times in table 3.1 the required distance in the x-axis (see figure 3.3 above) for AutoSet Dense Reader mode is 0.0534 s • 69.44 m/s = 3.7076 m and for Dense Reader M = 4 it is 0.0287 s • 69.44 m/s = 1.9918 m, using Dense Reader M = 8 it is 0.0288 s • 69.44 m/s = 1.9961 m and finally for Max Throughput mode it is 0.0223 s • 69.44 m/s = 1.5470 m

The train fits the description of a hostile environment, and the principle of worst case scenario is applied. The AutoSet Dense Reader mode is a special type mode that uses a patented algorithm by Impinj [5]. Since the readers used by the Swedish transport administration (Trafikverket) is from a different brands, one can assume that they use standard settings such as Max Throughput or Dense Reader. Even if they use the same or a similar mode that takes the same amount of time, a worst case distance of ~3.8m is needed. As seen in table 3.2 the distance is 3 + 3 = 6 m (in x-led figure 3.3) at 2.7m between tag and reader.

x-led

2.7m α TAG TRAIN

Figure 3.3: RFID communication illustrated

(33)

Chapter 4

Conclusion

Conclusion of the work

4.1 Result & discussion

Software wise the goals of writing and reading data from user memory were met. Drivers for communication between the 2.45 GHz radio was given from Upwis AB which made it possible to implement that part in a short amount of time.

Experimentation with the RTC took place despite the fact that it was beyond the scope of this thesis.

As shown in section 3.3 page 22, the results are satisfying and the train should be able to pass the reader at 250 km/h while delivering data from the tag. The results also show that it works up to 4 m but not at 2 m from the reader if the AutoSet Dense Reader mode is used. If standard Dense reader mode is used, 2 m works as well.

Tests on the 2.45 GHz radio antenna was done in collaboration with its thesis author, measurements were made in free air and on a stationary train outdoors. The results were rewarding and shows that it is possible to place nodes on the train if they are near the line of sight. Here one needs to implement multihop for transmitting signals between nodes that are not in direct radio contact.

The public and environmental benefits of this project goes hand in hand. If the train gets maintained in time, the rails doesn’t need to be replaced witch means that costs, time and material is saved. Wireless systems are easy to install and doesn’t use copper wiring to communicate, this also saves time, money and material.

(34)

4.2 Further studies

What happens if a train loaded with goods containing UHF RFID tags passes by? Since UHF RFID is the new bar code standard for some retail stores (eg. Wall mart in USA) and growing [1]. This is likely to happened. Therefore collision avoidance is suggested as a further study. Testing of random UHF tags (using normal antennas) scattered on a train to see if the reader can pick up any signals is also suggested.

• Live test at 250 km/h to see if data can be transmitted as calculated. • Implementing of multihop and IP addressing for the 2.45 GHz radio is

suggested.

• Using the accelerometer and gyro to collect data form the trains bearings. • Handling the data for analysis, when analyzed preform necessary calculations

on board the hardware to pass the results to the RFID reader. The calculations needs to be done in a manner that is energy efficient and this should be a study of its own.

When the data can be analyzed properly a format for service reports to the Swedish transport administrations (Trafikverkets) RFID readers should be done. Power saving methods are important since the system is intended to be a set of standalone units, power from the train itself is not available. Study's needs to be done.

(35)

References

[1] Cristina Turcu. (2010). Radio Frequency Identification Fundamentals and Applications, Design Methods and Solutions . Intech. Vukovar, Croatia. (ISBN 978-953-7619-72-5).

[2] Paret, Dominique (2009). RFID at Ultra and Super High Frequencies: Theory and Application. John Wiley & Sons Ltd. UK.

(ISBN 978-0-470-03414-9).

[3] What's the difference between ISO and EPC?

Rfid Journal (FAQ)

(2002-2011) http://www.rfidjournal.com/faq/21/94

[4] EPC Global (2008) version 1.2.9

EPC Class-1 Generation-2 UHF RFID Protocol for Communications at 860 MHz – 960 MHz

http://www.gs1.org/gsmp/kc/epcglobal/uhfc1g2/uhfc1g2_1_2_0-standard-20080511.pdf

[5] Impinj Inc. (2009), data sheets 2-RFID 101.pdf

3-RFID 102.pdf

Octane_LLRP_4_4_0.pdf

LTK_Programmers_Guide_10_10_0.pdf http://www.impinj.com/

[6] Atmel Corporation (2009), AT86RF231 data sheet

http://atmel.com/dyn/resources/prod_documents/doc8111.pdf

[7] IEEE 802.15.4-2006 standard

http://standards.ieee.org/getieee802/download/802.15.4-2006.pdf

[8] Contiki operating system (2011) http://www.contiki-os.org

[9] Git version control system (2011) http://git-scm.com/

[10] CPU STM32F103 reference manual (2011)

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERA TURE/REFERENCE_MANUAL/CD00171190.pdf

[11] RFID IC EM3425: Data sheet is Confidential, therefore a link to the manufacturer is provided. (2011)

(36)

[12] WISENET (2011)

http://www.wisenet.uu.se/

(37)

APPENDIX I

(38)

APPENDIX II

State diagram for communication between reader and tag. This is a copy of page 47, EPG Gen2 data sheet [4].

(39)

APPENDIX III

RFID reader commands,to see a more detailed description see EPC data sheet for every individual command. The table below shows Table 6.18 from page 54, EPC data sheet [4].

(40)

References

Related documents

“The organizational cell of the favela is the self-built single-family unit that has the ability to form both very small and very large communities, to be repeated ad infinitum

The present experiment used sighted listeners, in order to determine echolocation ability in persons with no special experience or training in using auditory information for

Observations from a Distance was a solo exhibition of ten new necklaces held at the Ornamentum Gallery in Hudson, New York from August 18 – September 17, 2018.. I often

According the requirements of the solar panel active protection, another viable technology is ZigBee, which can be used instead or as a complement to RFID.. Built on top

conspecific urine odour and 2-acetyl-1-pyrroline, a volatile component found in tiger marking fluid. But also to 2) compare the behavioural responses towards the conspecific

When assessing the relation between visual acuity and eye dominance, a significant difference between the number of subjects with better right visual acuity among left and

För att ett system skall kunna sägas vara användbart inom ramen för internationella insatser bör det kunna nyttjas under så stor del av en fredsoperation som möjligt, det vill

The generated Symbolic Mealy machine is generated by state variables for storing input information, locations for representing control states and action expressions for defining