104
DESIGN OCH IMPLEMENTERING AV EN HANDBUREN RFID-LÄSARE Edward Nordström Johan Hollander EXAMENSARBETE 2007 ELEKTROTEKNIK

Handheld RFID reader_JH_EN_08_07_20

Embed Size (px)

Citation preview

Page 1: Handheld RFID reader_JH_EN_08_07_20

DESIGN OCH IMPLEMENTERING AV EN HANDBUREN RFID-LÄSARE

Edward Nordström

Johan Hollander

EXAMENSARBETE 2007 ELEKTROTEKNIK

Page 2: Handheld RFID reader_JH_EN_08_07_20

DESIGN OCH IMPLEMENTERING AV EN HANDBUREN RFID-LÄSARE

DESIGN AND IMPLEMENTATION OF A HANDHELD RFID-READER

Edward Nordström

Johan Hollander

Detta examensarbete är utfört vid Tekniska Högskolan i Jönköping inom ämnesområdet Elektroteknik. Arbetet är ett led i teknologie magisterutbildningen med inriktning inbyggda elektronik- och datorsystem. Författarna svarar själva för framförda åsikter, slutsatser och resultat. Handledare: Alf Johansson Examinator: Youzhi Xu Omfattning: 30 högskolepoäng (D-nivå) Datum: Arkiveringsnummer:

Page 3: Handheld RFID reader_JH_EN_08_07_20

Abstract

1

Abstract

Radio frequency identification (RFID) is a versatile wireless technology used worldwide. The fields of applications are many and its popularity constantly grows due to smaller in size, better and less expensive components. RFID is used to identify, track or share information about an object using radio waves.

This master thesis describes the process of designing and implementing a handheld UHF RFID reader. The goal was to, based on a UHF RFID-chip design a fully functional, small in size and power efficient device. A microcontroller provides the user interface and is also used to control the RFID-chip and a Bluetooth device. A Bluetooth- and GPRS-compatible mobile phone will be used to forward data to a server connected to the Internet. All parts of the design are described, such as the printed circuit board design as well as the software for the micro controller and the mobile phone.

Because the extent of this thesis it is neither possible nor necessary to dig too deep into the Bluetooth- or GPRS-protocol. The focus will be on designing software and hardware for the handheld unit.

Page 4: Handheld RFID reader_JH_EN_08_07_20

Sammanfatting

2

Sammanfattning

Radio frekvens identifiering (RFID) är en mångsidig trådlös teknik som används över hela världen. Områdena där tekniken används är många och dess popularitet växer konstant tack vare mindre storlek, bättre och billigare komponenter. RFID används för att identifiera, spåra eller dela med sig information om ett objekt med radiovågor.

Det här examensarbetet beskriver processen av design och implementering av en handburen UHF RFID läsare. Målet har varit att, baserat på ett UHF-RFID chip, designa en fullt fungerande, liten och strömsnål enhet. En micro controller förser dels användaren med ett användargränssnitt och sköter dels kommunikationen med RFID chip och en blåtandsmodul. En blåtands- och GPRS- eller 3G-kompatibel mobiltelefon används for att skicka vidare data till en server kopplad till Internet. Alla delar av designen är beskrivna, så som PCB design, mjukvara för micro controllern och mobiltelefonen.

På grund av omfattningen av det här examensarbetet så har det inte varit möjligt eller nödvändigt att gräva för djupt i Blåtands- eller GPRS/3G-protokollen. Fokus är på att designa hårdvara och mjukvara för den handhållna enheten.

Page 5: Handheld RFID reader_JH_EN_08_07_20

Ackowledgements

3

Acknowledgements

We want to thank Alf Johansson at JTH for providing us with the contact to Combiport AB.

We also want to thank Werner Hilliges and Torbjörn Birging at Combiport AB for being very friendly, helpful and for assisting us with the project.

We also want to thank Rickard Nordström for helping us with the J2ME proplematics.

Page 6: Handheld RFID reader_JH_EN_08_07_20

Keywords

4

Keywords

Wireless Communication

Radio frequency (RF)

Radio frequency identification (RFID)

Passive radio frequency identification tags (tags)

Bluetooth

Java 2 Platform, Micro Edition (J2ME)

C++

Micro Controller

General Packet Radio Service (GPRS)

3G (Third generation)

Page 7: Handheld RFID reader_JH_EN_08_07_20

Contents

5

Contents

1 Introduction ......................................................................... 10

1.1 PROLOGUE........................................................................................................................... 10 1.2 BACKGROUND...................................................................................................................... 11 1.3 PROBLEM DESCRIPTION........................................................................................................ 12 1.4 PURPOSE AND GOALS........................................................................................................... 13 1.5 LIMITATIONS ........................................................................................................................ 14 1.6 DISPOSITION......................................................................................................................... 15

2 Data Communication......................................................... 16

2.1 WIRELESS COMMUNICATION................................................................................................ 16 2.1.1 Radio frequency basics (RF)........................................................................................... 16 2.1.2 Radio frequency identification (RFID) ........................................................................... 19 2.1.3 Antennas ......................................................................................................................... 27 2.1.4 Circulator ....................................................................................................................... 33 2.1.5 Bluetooth......................................................................................................................... 33 2.1.6 General Packet Radio Service (GPRS) / 3G................................................................... 36

2.2 WIRED COMMUNICATION ..................................................................................................... 37 2.2.1 UART and RS-232........................................................................................................... 37 2.2.2 Serial Peripheral Interface (SPI).................................................................................... 37

3 Design decisions ................................................................. 39

3.1 HARDWARE.......................................................................................................................... 39 3.1.1 Principal solution for MobiReader™............................................................................. 40 3.1.2 Calculation of the reading distance................................................................................ 41 3.1.3 ATmega64(L) – Micro controller ................................................................................... 46 3.1.4 IDS_R900 – RFID chip................................................................................................... 47 3.1.5 OEM-SPA310 – Bluetooth module ................................................................................. 49 3.1.6 MAX863 – Voltage Step up device.................................................................................. 50 3.1.7 Fractus chip antenna ...................................................................................................... 53 3.1.8 Circulator ....................................................................................................................... 54 3.1.9 Piezo Buzzer ................................................................................................................... 56 3.1.10 Microchip SPI Potentiometer..................................................................................... 56 3.1.11 Display ....................................................................................................................... 56 3.1.12 Diodes ........................................................................................................................ 56 3.1.13 Batteries ..................................................................................................................... 57 3.1.14 Buttons ....................................................................................................................... 57

3.2 SOFTWARE DESIGN............................................................................................................... 61 3.2.1 ATmega software ............................................................................................................ 61 3.2.2 Java software .................................................................................................................. 62

4 Implementation................................................................... 64

4.1 HARDWARE.......................................................................................................................... 64 4.1.1 Mobireader Main Board rev.1........................................................................................ 64 4.1.2 Mobireader power supply board rev.1 ........................................................................... 66 4.1.3 Mobireader Main Board rev.2........................................................................................ 67 4.1.4 Mobireader Power Supply Board rev.2 .......................................................................... 68 4.1.5 Test set up for measuring reading distance .................................................................... 68

4.2 SOFTWARE........................................................................................................................... 70 4.2.1 ATmega software ............................................................................................................ 71 4.2.2 ATmega software for measuring reading distance ......................................................... 75 4.2.3 Java Midlet software....................................................................................................... 76 4.2.4 Communication............................................................................................................... 83

Page 8: Handheld RFID reader_JH_EN_08_07_20

Contents

6

5 Results .................................................................................. 85

5.1 HARDWARE.......................................................................................................................... 85 5.1.1 Antenna........................................................................................................................... 85 5.1.2 Circulator ....................................................................................................................... 86 5.1.3 Reading distance measure results................................................................................... 86 5.1.4 Summary ......................................................................................................................... 90

5.2 SOFTWARE........................................................................................................................... 91 5.2.1 ATmega 16 code ............................................................................................................. 91 5.2.2 Mobile phone Java code ................................................................................................. 91

6 Conclusion and discussion ................................................ 92

7 References........................................................................... 93

8 Search Words ...................................................................... 94

9 Appendix............................................................................. 95

9.1 APPENDIX A: CIRCUIT DIAGRAM MOBIREADER POWER SUPPLY BOARD............................. 95 9.2 APPENDIX B: CIRCUIT DIAGRAM MOBIREADER MAIN BOARD ............................................ 97 9.3 APPENDIX C: PCB LAYOUT MOBIREADER MAIN BOARD .................................................. 101 9.4 APPENDIX D: PCB LAYOUT MOBIREADER POWER SUPPLY BOARD................................... 102

Page 9: Handheld RFID reader_JH_EN_08_07_20

List of figures

7

List of figures FIGURE 1-1– MOBIREADER BLOCK DIAGRAM 12 FIGURE 2-1– POWER SUPPLY TO A PASSIVE TAG WITH INDUCTIVE COUPLING. 21 FIGURE 2-2– CLOSE COUPLING TRANSPONDER IN AN INSERTION READER WITH MAGNETIC

COUPLING COILS. 22 FIGURE 2-3– TAG STATE DIAGRAM [8] 25 FIGURE 2-4–EQUIVALENT CIRCUIT OF A ONE HALF WAVELENGTH DIPOLE. 27 FIGURE 2-5–EQUIVALENT CIRCUIT OF A ONE WAVELENGTH DIPOLE. 27 FIGURE 2-6– 4 PORT TRANSMISSION LINE 29 FIGURE 2-7– LINEAR, CIRCULAR AND ELLIPTICAL POLARIZATION. 30 FIGURE 2-8– PATCH ANTENNA RADIATION PATTERN 32 FIGURE 2-9− 3-PORT CLOCKWISE CIRCULATOR. 33 FIGURE 2-10– THE BLUETOOTH PROTOCOL STACK 34 FIGURE 2-11– A BLUETOOTH SCATTERNET [5] 35 FIGURE 2-12– SPI – ONE MASTER, THREE DAISY-CHAINED COUPLED SLAVES. 37 FIGURE 2-13– SPI – ONE MASTER, THREE INDIVIDUAL SLAVES. 38 FIGURE 3-1– PRINCIPAL SOLUTION FOR MOBIREADER 40 FIGURE 3-2– TRANSMITTED POWER (MW) VS. DISTANCE (M) 42 FIGURE 3-3– TRANSMITTED POWER (MW) VS. DISTANCE (1-3) M 43 FIGURE 3-4– TRANSMITTED POWER FROM TAG (MW) VS DISTANCE (1–3)M 43 FIGURE 3-5– TRANSMITTED POWER (MW) VS DISTANCE (0.5 - 1.8)M 44 FIGURE 3-6–TRANSMITTED POWER VS DISTANCE (0–0,75)M 44 FIGURE 3-7–TRANSMITTED POWER VS DISTANCE (0–0,35)M 45 FIGURE 3-8– BLOCK DIAGRAM IDS-R900G 48 FIGURE 3-9– OEM-SPA310 49 FIGURE 3-10– DISCHARGE TIME VERSUS VOLTAGE IN 2700MA AA BATTERY 53 FIGURE 3-11– 7MM SQUARE CIRCULATOR SC-7TN0859M 55 FIGURE 3-12– CIRCULATOR INSERTION LOSS 55 FIGURE 3-13– CIRCULATOR ISOLATION 56 FIGURE 3-14– HIGH VOLTAGE PEAK PROTECTION AND CONTACT BOUNCE PROTECTION. 58 FIGURE 3-15– CONTACT BOUNCE 58 FIGURE 3-16– VOLTAGE(V) VERSUS TIME(S) ON INPUT TO MICRO CONTROLLER 59 FIGURE 3-17– ATMEGA 16 STATE CHART 62 FIGURE 4-1– EAGLE CAD 2 LAYER PCB 65 FIGURE 4-2– SIDE VIEW OF MAIN AND POWER SUPPLY BOARDS 66 FIGURE 4-3– EAGLE CAD 4 LAYERS PCB 67 FIGURE 4-4– THE DIFFERENT PLACEMENTS OF THE RFID TAG VERSUS THE ANTENNA. 69 FIGURE 4-5– THE MODULES USED FOR THE PROJECT. 70 FIGURE 4-6– MOBIREADER BLOCK DIAGRAM WITH THE EVOLUTION BOARDS 71 FIGURE 4-7– ATMEGA 16 FLOWCHART PAGE 1 72 FIGURE 4-8– ATMEGA 16 FLOWCHART PAGE 2 73 FIGURE 4-9– ATMEGA 16 FLOWCHART PAGE 3 74 FIGURE 4-10– MIDLET GUI SCREENS 76 FIGURE 4-11– MOBILE PHONE SOFTWARE FLOWCHART PAGE 1 78 FIGURE 4-12– MOBILE PHONE SOFTWARE FLOWCHART PAGE 2 79 FIGURE 4-13– MOBILE PHONE SOFTWARE FLOWCHART PAGE 3 80 FIGURE 4-14– MOBILE PHONE SOFTWARE FLOWCHART PAGE 4 81 FIGURE 4-15– MOBILE PHONE SOFTWARE FLOWCHART PAGE 5 82 FIGURE 4-16– COMMUNICATION EVENTS OF MOBIREADER, MOBILE PHONE AND SERVER 84 FIGURE 5-1– MEASURE RESULTS AT PLACEMENT 1 87 FIGURE 5-2- MEASURE RESULTS AT PLACEMENT 2 87 FIGURE 5-3– MEASURE RESULTS AT PLACEMENT 3 88 FIGURE 5-4– MEASURE RESULTS AT PLACEMENT 4 88 FIGURE 5-5– MEASURE RESULTS AT PLACEMENT 5 89 FIGURE 5-6– MEASURE RESULTS AT PLACEMENT 6 89

Page 10: Handheld RFID reader_JH_EN_08_07_20

List of tables

8

List of tables TABLE 2-1– ALLOCATION OF THE RF SPECTRUM. 19 TABLE 2-2– FREQUECY RANGES USED FOR RFID-SYSTEMS (AUGUST 2006) [10] 20 TABLE 2-3– COMPARISON DIFFERENT ANTENNAS 32 TABLE 3-1– NOTES ON THE PRINCIPAL SOLUTION 41 TABLE 3-2– READING DISTANCE 45 TABLE 3-3– POWER CONSUMPTION ATMEGA 64(L) 47 TABLE 3-4– POWER CONSUMPTION IDS-R900G 48 TABLE 3-5– POWER CONSUMPTION OEM-SPA310 50 TABLE 3-6– 7MM SQUARE CIRCULATOR SC-7TN0859M SPECIFICATION 55 TABLE 4-1– OBID ANTENNA SPECIFICATION 68

Page 11: Handheld RFID reader_JH_EN_08_07_20

List of abbreviations

9

List of abbreviations

ESR – Equivalent Series Resistance

PWM – Pulse Width Modulation

ADC – Analogue to Digital Conversation

UHF – Ultra High Frequency (300MHz…3 GHz)

RF – Radio Frequency

RFID – Radio Frequency Identification

ASK – Amplitude Shift Keying

AM – Amplitude Modultation

PM – Phase Modulation

VCO – Voltage Controlled Oscillator

PLL – Phase Locked Loop

GPRS - General Packet Radio Service

PCB – Printed Circuit Board

EMI – Electromagnetic Interference

Page 12: Handheld RFID reader_JH_EN_08_07_20

Introduction

10

1 Introduction

1.1 Prologue

The possibility to communicate wirelessly has opened up for new amazing technologies. Only the beginning of the wireless era has seen the light of day. Imagine all the everyday-use products that are taken for granted; mobile phones, lap tops, head-phones, radio and television. These are all products based on wireless technology. There are numerous different techniques and ways of communicating, the mentioned products above all use different techniques. Each product has different basic conditions and based on that the developer chooses the best suitable wireless communication technique.

RFID (Radio Frequency Identification) is yet another wireless technology and has got some specific benefits. RFID is mostly used for identification purposes. A RFID tag, also called transponder is a small chip which contains an identification number and can be read wirelessly by a RFID reader. A tag doesn’t even necessarily need a power source of its own. It powers up using the transmission energy from the reader. Upon a successfully transmission of its identification number it goes back to sleep. What this means in practice is that a RFID tag can be implemented almost anywhere; on groceries, packages, inside animals and even inside humans. Battery life span is not an issue at all, only the reading distance is.

Many companies see new opportunities and advantages of investing in the RFID technology. Especially delivery firms and warehouses could draw huge benefits of RFID. All possibilities associated with RFID haven’t yet been discovered.

There are though some constraints associated with RFID. There are opinions such as a RFID tag can be used as a spy chip. The owner of the RFID tag never notice when it is read. The technology could in other words be abused because every single step an individual takes could be monitored. Despite opinions like this, if used in a proper way, RFID is a very useful aid and can save both time and money.

Page 13: Handheld RFID reader_JH_EN_08_07_20

Introduction

11

1.2 Background

Combiport AB is a company situated at Science Park in Jönköping. They have specialized knowledge in developing high tech equipment for various RFID applications. Their product line involves base stations, active tags and customized RFID solutions. What is missing in their line of products is a handheld reader for the UHF band.

A handheld UHF RFID reader could be used in many different fields. Because barcodes sooner or later will be replaced by a new technique i.e. RFID, there is a need for a new type of reader. Wherever barcodes are used, RFID technique can replace it. The perfect place for a handheld reader is in logistics, tracking packages. Nowadays all consignments being shipped are stamped with a barcode. When a truck driver delivers packages he or she reads the barcode on the package with a handheld device and then hands it over to the receiver. Now that RFID tags are as cheap as they are, a tag could replace the barcode with very low cost increment. The benefits are many. A RFID tag contains a unique identification number and can be read without aligning the package towards a reader in some special way. It is also possible to read many packages concurrently. Another feature that can be added is when a package is lost and it is desired to search for it. The tracking id of the package is known but the package is lost in a big pile of other packages. The tracking id can be typed into the handheld reader and a reverse read is initiated. When close enough to the package a voice signal notices the user. The stronger signal, the closer the reader is to the package.

Other applications where the handheld reader could be used is doing inventory at any storage company. If all products are equipped with tags it is very easy to do inventories. Imagine how much time and money could be saved if manual inventory is avoided.

The fields where the reader can improve things are almost infinite; one of the more obvious is at grocery stores. Shop express which nowadays use barcode readers could be replaced by RFID readers. The reader must be very intelligent to make this possible. This is due to that, what if a reading is initiated inside a store, everything within reading distance will be read.

The proposed RFID reader improves the reading in additional ways. It can be equipped with either a Bluetooth- or WLAN- module. The Bluetooth device makes it possible to communicate with a Bluetooth compatible mobile phone. This means that it is possible to be connected to the internet without the requirement of an additional account for the reader – a GPRS/3G mobile phone can be used. If a WLAN is close it is possible to constantly be connected to the internet. The idea with the internet connection is that when a tag is read it is possible to transmit the information to some database and register a successful reading.

Page 14: Handheld RFID reader_JH_EN_08_07_20

Introduction

12

1.3 Problem description

Based on a RFID-chip from Microchip-IDS a small handheld RFID reader is to be designed and implemented. The reader shall be able to read passive tags according to the EPC™ Radio-Frequency Identity Protocols Class-1 Generation-2 UHF RFID Protocol for Communications at 860 MHz – 960 MHz version 1.0.9 on limited distance. The reader shall also implement a search RFID function. The reader shall have the ability to communicate with a server on Internet. A Bluetooth compatible mobile phone will be used to pass the information further on to this server using GPRS. The project will involve designing both hardware and software. Below the whole system is described in a block diagram.

Figure 1-1– MobiReader block diagram

The RFID-chip (IDS-R900G) is the foundation of the design. Suitable components, such as micro controller, Bluetooth device, antenna, a user interface and peripheral components are to be chosen. The PCB must be designed in such a way that it fits into a specific casing. Hardware will be chosen with focus on low power consumption. The IDS-R900G chip handles all analogue parts when communicating with a tag. An interface to communicate with the RFID chip digitally is to be set up with a micro controller. The project involves software design for the micro controller and for the mobile phone. The software code in the mobile phone will be written in Java and the code for the micro controller will be written in C/C++. A good user interface is to be considered, perhaps using a display. The display in the mobile phone might be used for displaying messages to the user. Reading distance between the tag and the antenna must also be investigated to know the limitations of the designed UHF RFID reader.

Page 15: Handheld RFID reader_JH_EN_08_07_20

Introduction

13

1.4 Purpose and goals

The goal is to, either by connecting modules together or even better; make both the designed hardware and software work together. A working prototype must be able to read RFID-tags, send the information via Bluetooth to a mobile phone. The mobile phone will send the information using GPRS to a server on the Internet. When a read tag can travel this whole chain the goal is fulfilled.

In order to reach the final goal the following smaller goals needs to be fulfilled.

-Create a PCB layout of the RFID-reader using Eagle CAD software. The PCB will contain a newly developed RFID chip that can handle the whole analogue- and parts of the digital part. There will also be a micro controller, a Bluetooth chip, some buttons, a buzzer, LEDs and as an option a small display.

-Connect suitable evaluation boards to develop and test the program for the microcontroller in parallel to designing the PCBs.

-Program a Java module for a mobile phone to receive data on its Bluetooth radio and transmit the read data via GPRS to a software database.

-Program the micro controller and set up the Bluetooth communication with a mobile phone.

-Measure the maximum reading distance at different angles between the tag and the antenna.

-If time allows, the mobile phone shall be able to buffer read data if a GPRS connection is not available.

The final goal is when a tag is read by mobireader the tag number is to be transferred to a server on the internet.

Page 16: Handheld RFID reader_JH_EN_08_07_20

Introduction

14

1.5 Limitations

Because the extent of this thesis it is very important to limit it in such a way that not everything is considered. Components and solutions already existing will be chosen primarily.

A very important, though complicated and complex area is antennas. The most suitable antenna for the project would have been a Patch antenna. The problem with patch antennas at this specific frequency is that they become too large, in this study the size is a problem with the proposed casing. A possibility would have been to design a custom micro strip patch antenna. The problem is that all antennas need to be tuned to a specific frequency. This tuning procedure is not simple and can take months. Therefore, a standard Omni-directional chip antenna will be put in the designed PCB. Using this type of antenna would result in a non desirable radiation pattern. For the reading distance measure part of this study an already designed patch antenna is available and will be used.

The thesis will be limited even further and a search tag function will not be implemented in this project.

A display will not be implemented. Connections will be prepared to make it easy to connect a display in the future.

In addition the thesis will be limited so that only a proposal of hardware is described. The hardware will not be manufactured; instead evaluation boards will be used and connected, to prove functionality of the chosen hardware.

Page 17: Handheld RFID reader_JH_EN_08_07_20

Introduction

15

1.6 Disposition

In the first section the basic theories underlining the master thesis are described. It is important to understand these fundamental theories to be able to make good choices in the design.

In the next section called “design decisions” components and the design choices made are described. All calculations are presented here.

In the implementation section an example of a poor PCB design is described and compared with a much improved example. Also included in the implementation section is a description of the software implemented in the project.

In the next section results are presented. The calculated reading distance is compared with the simulation results.

Finally, a discussion regarding the results and what can be improved are presented.

Page 18: Handheld RFID reader_JH_EN_08_07_20

Data Communication

16

2 Data Communication In the same way communication between humans is a fundamental function it is also essential for computer systems to communicate. Data communication is nowadays fully integrated into the society and we are totally dependent up on it. There are many different techniques used to transfer data from one source to another. Which technique is used is dependent on the purpose. Security, speed, reliability and cost are all important factors when choosing the type of communication.

As technology constantly improves wireless data communication tends to take over fields where wired communication was the only alternative just a couple of years ago. The benefits of wireless technology are many. Why use a cord when it is not necessary?

2.1 Wireless communication

Wireless communication doesn’t only just replace cords but also opens up new doors and opportunities.

2.1.1 Radio frequency basics (RF)

Radio frequency refers to electromagnetic waves propagating in air within a certain spectra in frequency. Electromagnetic waves occur when an alternating current is input to an antenna. This electromagnetic field can be used for broadcasting or communication between around 3 Hz to about 300 Gigahertz [3]. The spectrum is referred to as the RF spectrum. As the frequency increase beyond the RF spectrum electromagnetic energy takes the form of infrared, visible light, ultraviolet, x rays and gamma rays.

2.1.1.1 Carrier wave

The carrier wave is the information carrier. Together with a baseband signal (the information being transferred) the two signals are modulated into one signal [3]. The frequency of the carrier wave is much higher than the information itself. The reason to use a carrier wave is that the frequency spectrum in free space is limited and therefore must be shared with millions of others.

2.1.1.2 Modulation

Modulation is when the baseband signal is mixed together with the carrier wave into one signal. This can be done in a couple of different ways. Some common analogue modulation techniques are AM, FM, PM.

Page 19: Handheld RFID reader_JH_EN_08_07_20

Data Communication

17

AM – Amplitude modulation – The amplitude of the carrier wave is varied with respect to the baseband signal. The frequency is kept constant. This is the simplest modulation technique. The drawback of this modulation is among others bad noise susceptibility. Early radio transmissions used this modulation.

FM – Frequency modulation - The Frequency of the carrier wave is varied with respect to the baseband signal. Amplitude is kept constant. This modulation technique is slightly more complex than AM but has got a many benefits. Noise susceptibility is one of them.

PM – Phase modulation – The phase of the carrier wave is varied with respect to the baseband signal. This is the most complex modulation technique. When demodulating a PM signal it requires complex techniques and is therefore not used as much as AM or FM.

There are also a couple of digital modulation techniques used. Some of the most important are described below.

OOK – On off keying – The presence or absence of a carrier for a specific duration represents a binary 1 or a 0.

FSK – Frequency shift keying – Digital information is transmitted through discrete frequency changes of the carrier wave.

ASK – Amplitude shift keying – Digital information is transmitted through variations in the amplitude of the carrier wave.

PSK – Phase shift keying – Digital information is transmitted through variations in the phase of the carrier wave.

QAM – Quadrature amplitude modulation – Digital information is transmitted by modulating the amplitude of two carrier waves. These two waves (sinusoids) are 90 degrees out of phase.

There exist numerous modulation techniques where combinations of the above are used together. Some of them are APSK, MSK, CPM, PPM, TCM, OFDM.

Finally there is a modulation technique based on something called spread spectrum. Spread spectrum spreads the information over some bandwidth using a hopping scheme where the frequency changes within some given time.

FHSS – Frequency hopping spread spectrum – Is a method of transmitting radio signals by switching a carrier between many frequency channels using a random sequence known by both the transmitter and the receiver.

The benefits of spread spectrum are.

- Highly resistant to narrowband interference.

Page 20: Handheld RFID reader_JH_EN_08_07_20

Data Communication

18

- Difficult to intercept.

- Spread spectrum can share a frequency band with other conventional transmissions with minimal interference.

- Bandwidth can be used more efficiently.

AFH –Adaptive frequency hopping spread spectrum – Bluetooth use this type of modulation. It improves FHSS by avoiding crowded frequency channels.

2.1.1.3 Bandwidth

Bandwidth is the width in frequency that the channel occupies [3]. Many types of wireless devices share the RF spectrum, such as radio, television, cordless phones, cell phones and satellite communication systems. Some wireless devices, such as remote controls and cordless mice operate at infrared or visible light frequencies.

Frequency range Bandwidth description Used for

0 to 3 kHz Extremely Low Frequency (ELF)

3 kHz to 30 kHz Very Low Frequency (VLF)

Maritime / Aeronautical mobile (9kHz - 540kHz)

30kHz to 300 kHz Low Frequency (LF) Maritime / Aeronautical mobile (9kHz - 540kHz)

300 kHz to 3000 kHz Medium Frequency (MF)

Maritime / Aeronautical mobile (9kHz - 540kHz)

AM Radio Broadcast (540 Hz to 1630 kHz)

Travellers Information Service 1610 kHz

3 MHz to 30 MHz High Frequency (HF) Shortwave Broadcast Radio 5.95 MHz to 26.1 MHz

30 MHz to 300 MHz

Very High Frequency (VHF) Low Band: TV Band 54 MHz to 88 MHz

Mid Band: FM Radio Broadcast 88 MHz to 174 MHz

High Band: TV Band 174 MHz to 216 MHz

Super Band (mobile/fixed radio and TV) 216 MHz to 600 MHz

300 MHz to 3000 MHz

Ultra-High Frequency (UHF)

Super Band (mobile/fixed radio and TV) 216 MHz to 600 MHz

TV Band 470 MHz to 806 MHz

L-band 500 to 1500 MHz

Personal Communication Services (PCS) 1850 MHz to 1990 MHz

Unlicensed PCS Devices 1910 to 1930 MHz

RFID 868 MHz to 870 MHz

Page 21: Handheld RFID reader_JH_EN_08_07_20

Data Communication

19

RFID 888 MHz to 889 MHz

RFID 902 MHz to 928 Mhz

RFID 2400 MHz to 2485 Mhz

3 GHz to 30 GHz Super-High Frequency (SHF) C-band 3600 MHz to 7025 MHz

X-band 7.25 MHz to 8.4 MHz

Ku-band 10.7 GHz to 14.5 GHz

Ka-band 17.3 GHz to 31 GHz

RFID 5725 MHz to 5875 MHz

30 GHz to 300 GHz

Extremely High Frequency (EHF)

Additional Fixed Satellite 38.6 GHz to 275 GHz

300 GHz to 430 THz Infrared Radiation

430 THz to 750 THz Visible Light

1.62 PHz to 30 PHz Ultraviolet Radiation

30 PHz to 30 Ehz X-rays

30 Ehz to 3000 Ehz Gamma Rays

Table 2-1– Allocation of the RF spectrum.

2.1.2 Radio frequency identification (RFID)

The most common radio frequency identification RFID frequency bands and the standards associated with their usage, according to [4], are the following:

• 25 kHZ LF − Near field, all passive −ISO 18000-2

• 13.56 MHZ HF − Near field, mostly passive −ISO 18000-3 Mode 1, Mode 2 −ISO 14443 TypeA, TypeB −ISO 15693 −EPCglobal Class-1 HF

• 900 MHZ UHF − Far field, some active −EPCglobal Gen2 −EPCglobal Class-0, Class-1 (Not standardized) −ISO 18000-6 Type A, Type B

• 2.45 GHz UHF − Far field, some active −ISO 18000-4 Mode 1, Mode 2

Page 22: Handheld RFID reader_JH_EN_08_07_20

Data Communication

20

Table 2-2– Frequecy ranges used for RFID-systems (August 2006) [10]

2.1.2.1 LF Tags (<135KHz)

Since these tags operate in the KHz spectrum, they are the most adaptive to metal environment. Tags can be placed on metal and embedded into metal with some loss of performance. These tags are inductive coupled and inductively coupled tags are almost always operated passively, meaning that all the energy needed for the operation of the microchip has to be provided by the reader.

How an inductive coupled tag communicates with a reader is described in chapter 2.1.2.2.

Page 23: Handheld RFID reader_JH_EN_08_07_20

Data Communication

21

2.1.2.2 HF Tags (13.56 MHz )

As read from [1], HF tags are also inductive coupled. The connection between the reader and the tag can be seen as a transformer with very weak coupling. This is true when the distance between the coils does not exceed 0.16λ, so that the transponder is located in the near field of the transmitter antenna. The required inductance of the transponder coil and the number of windings decreases as the frequency increases (135 kHz: typical 100–1000 windings, 13.56MHz: typical 3–10 windings) [1]. Since the voltage induced in the transponder is still proportional to the frequency, the reduced number of windings barely affects the efficiency of power transfers at higher frequencies.

Figure 2-1– Power supply to a passive tag with inductive coupling.

In most of the operating conditions only a small part of the emitted field reaches the antenna coil of the tag. When a tag is within the alternating magnetic field of the readers’ antenna, energy is collected to the tag from the magnetic field. The resulting feedback can be represented as transformed impedance in the reader’s antenna coil. The tag switches a load on and off in it’s antenna, to have a change in the impedance of the reader’s antenna resulting in a voltage change at the reader’s antenna. The result is an amplitude modulation on the reader’s antenna.

Page 24: Handheld RFID reader_JH_EN_08_07_20

Data Communication

22

2.1.2.3 UHF Tags (900 MHz and 2.45GHz)

RFID systems where the distance between the reader and the transponder is larger than 1m are called long-range systems. These systems operate in the UHF frequencies of 860-960MHZ and at the microwave frequencies 2.5 GHz and also at 5.8GHZ. The short wavelengths of these frequencies results in smaller antennas with greater efficiency than would be possible using frequencies below 30MHz. These tags use electromagnetic backscattering coupling. As read from [1], “We know from the field of radar technology that electromagnetic waves are reflected by objects with dimensions greater than around half the wavelength of the wave. The efficiency with which an object reflects electromagnetic waves is described by its reflection cross-section. Objects that are in resonance with the wave front that hits them, as is the case for antennas at the appropriate frequency, for example, have a particularly large reflection cross-section.”

To transmit data from a tag to the reader, a load resistor is connected parallel to the antenna on the tag. If this load is altered, the reflection characteristic of the tag antenna is influenced resulting in amplitude modulation. The resistor is switched on and off in time with the data stream to create a modulated backscatter on the carrier wave.

2.1.2.4 Close coupling tags

Close coupling RFID systems are designed for a range of 0.1cm to 1m. Tags are therefore inserted into a reader or placed on the reader. Close coupling system can either be magnetically coupled or capacitive coupled.

The functional layout of magnetically coupled system corresponds with that of a transformer, the primary winding is represented by the reader and the secondary winding is represented by the tag.

Figure 2-2– Close coupling transponder in an insertion reader with magnetic coupling coils.

Page 25: Handheld RFID reader_JH_EN_08_07_20

Data Communication

23

The tags power supply is generated by a high frequency magnetic field in the core and air gap of the arrangement, caused by a high frequency current in the primary windings. In contrary to inductively coupled systems, the efficiency of power transfer is very good, and therefore the controlling chip can have higher power consumption. This includes microprocessors which require some 10mW power.

In a capacitive coupled system, the reader and the tag have capacitive plates which are parallel when the tag is inserted in a reader. Contact–less close coupling chip cards are defined in their own standard, ISO 10536.

2.1.2.5 Passive, active and semi-passive tags.

The simplest version of an RFID tag is a passive identification (ID) tag. It does not contain its own power source but instead harvests the power it needs from the readers RF emissions. It holds a Tag identifier (TID), an electronic code (EPC) identifier and has a “kill” function that permanently disables the tag. Optionally it can have password-protected access control and user memory. Because no battery is needed in passive tags they are very suitable for numerous applications. The integrated CMOS circuit is powered by the antenna and receives just enough energy to power up and transmit a response to the reader [1]. The reading distance of a passive tag can vary from 10 cm up to a couple of meters, depending on the radio frequency and the design and size of the antenna [1].

In 2006 Hitachi developed a tag which is only 0.15x0.15mm and thinner than a piece of paper (7.5 micrometers) [9]. The tag contains a 128-bit unique ID number which is hard coded into the chip. The reading range of the chip is around 30 cm. In February 2007 Hitachi unveiled an even smaller RFID device measuring 0.05×0.05 mm, and thin enough to be embedded in a sheet of paper [9]. The new chips can store as much data as the older chips, and the data contained on them can be extracted from as far away as a few hundred meters.

Unlike passive RFID tags, active RFID tags have their own internal power source, which is used to power the integrated circuits and to broadcast the response signal to the reader. Communications from active tags to readers is typically much more reliable (i.e. fewer errors) than from passive tags due to the ability for active tags to conduct a "session" with a reader. Active tags, due to their on board power supply, also may transmit at higher power levels than passive tags, allowing them to be more robust in "RF challenged" environment with humidity and spray or with dampening targets, reflective targets from metal, or at longer distances. In turn, active tags are generally bigger, caused by battery volume, and more expensive to manufacture, caused by battery price.

Page 26: Handheld RFID reader_JH_EN_08_07_20

Data Communication

24

Semi-passive tags, also called semi-active tags, are similar to active tags in that they have their own power source, but the battery only powers the microchip and does not power the broadcasting of a signal. The response is usually powered by means of backscattering the RF energy from the reader, where energy is reflected back to the reader as with passive tags. An additional application for the battery is to power data storage. Whereas in passive tags the power level to power up the circuitry must be stronger than with active or semi-active tags, also the time consumption for collecting the energy is omitted and the response comes with shorter latency time. The battery-assisted reception circuitry of semi-passive tags leads to greater sensitivity than passive tags. The enhanced sensitivity can be leveraged as increased range (by one magnitude) and/or as enhanced read reliability (by reducing bit error rate at least one magnitude). Semi-passive tags have three main advantages 1) Greater sensitivity than passive tags 2) Longer battery powered life cycle than active tags. 3) Can perform active functions (such as temperature logging) under its own power, even when no reader is present for powering the circuitry.

2.1.2.6 UHF EPC tag behavior

The tags of interest to this thesis are passive tags that comply with the EPC Class 1 generation 2 UHF protocol [8]. Such a tag has flags used for distinction among a population of tags during interrogator and multiple tag communications. These flags are called selected flag (SL), inventoried flag (its values are denoted either A or B) and four sessions (S0, S1, S2 and S3). A tag shall maintain independent inventoried flag for each session and shall only participate in one and only one session at an inventory round. The SL flag is independent of the session a tag is participating in. The tag also implements a slot counter that is affected by a parameter Q of range 0 to 15 which is used to regulate the probability that a tag replies. This slot counter is 15 bits wide and assumes a random number between 0 and 2Q – 1, and when the slot counter reaches or assumes zero the tag will reply. Found in the protocol is the tag state diagram, shown in the figure below.

Page 27: Handheld RFID reader_JH_EN_08_07_20

Data Communication

25

Figure 2-3– Tag state diagram [8]

Page 28: Handheld RFID reader_JH_EN_08_07_20

Data Communication

26

In order to read the tag ID stored in the EPC membank, various commands needs to be sent to the tag in order to move it from the ready state to acknowledged state where it replies selected data from its memory. The commands needed are Select command, Query command and ACK (acknowledge) command. The Select command specifies which of the tags that shall participate in an inventory round, by user-selected criteria, and how the flags of the tags are modified or not. The Query command comes in some different variations to modify the slot value differently. The Query command starts a new inventory round among the selected tags with the same flags as given in the Query command and results in a new random slot value with a given Q value. Query adjust command can adjust a previous given Q value up, down and no change to Q, and can change the range of the slot counters random value before a new random slot value is generated. QueryRep command will decrease the slot counter by one, so that tags can move to reply state when their slot counter reaches zero. The ACK command will make a tag backscatter its selected memory contents when it is in the reply state and move it to the acknowledged state. If a new Query command is issued with matching flags and session, a tag in the acknowledged state will invert is inventoried flag (A→B or B→A) and therefore not participate in the remainder of the inventory round.

2.1.2.7 Summary

The 900 MHz UHF band seems to be the preferred RF band for supply-chain applications, primarily for reasons of read speed and range. According to [4], passive 900 MHz UHF tags can be read at rates from 100 to 1,000 tags per second and at a range measured in meters compared to passive 13.56 MHz tags which can be read at rates from 10 to 100 tags per second and at a range measured in centimeters. The 900 MHz RFID has far greater problems with signal fading due to multipath effects (interfering reflections of the signal that cause adjacent regions to vary dramatically in reception) and signal attenuation by liquids and metals than does 13.56 MHz RFID. Comparing tags in the 900MHz UHF band to tags in the 2.45GHz microwave band, the 900MHz tags has longer range but the 2.45GHz tags has higher data rate but both of these’s signals are easily reflected or absorbed. The LF tags have short reading distances and slow data rates, but they can be read through most materials and be read round corners.

The protocol, EPC Class 1 generation 2 UHF protocol [8], describes physical and logical requirements for a passive-backscatter, Interrogator-talks-first (ITF), radio-frequency identification (RFID) system operating in the 860 MHz – 960 MHz frequency range.

This protocol specifies:

• Physical interactions (the signaling layer of the communication link) between Interrogators and Tags,

Page 29: Handheld RFID reader_JH_EN_08_07_20

Data Communication

27

• Interrogator and Tag operating procedures and commands, and

• The collision arbitration scheme used to identify a specific Tag in a multiple-Tag environment.

2.1.3 Antennas

An antenna can be any conductive structure that can carry an electrical current. All structures carrying time varying signals will radiate, maybe not efficiently or in a desirable manner but they will radiate. Antennas consist of a structure designed to radiate electromagnetic radiation efficiently with some specific characteristics. If the antenna part is not carefully designed other things may radiate as well, such as the transmission line or the power supply line. If a PCB is placed close to the antenna, components may also radiate leading to undesirable behavior. In this section the focus will be on the antenna itself.

In order to make an antenna transfer power as efficiently as possible the impedance of the antenna must be matched with the transmission line impedance [2]. The transmission line shall transfer all of the power to the antenna and radiate as little as possible itself. The mode of the transmission line shall match the mode of the antenna. A common mode is 50Ω transmission line and antenna. Depending on the application different antennas and radiation patterns are available.

2.1.3.1 Antenna Impedance

The simplest antenna is a thin, center fed, very short dipole called a Hertizian dipole. The equivalent circuit is a RLC circuit shown in Figure 2-4 and Figure 2-5 where XL represents the inductance of the conductors, XC the capacitance between the conductors and R represents the energy lost to radiation.

Figure 2-4–Equivalent circuit of a one half wavelength dipole.

Figure 2-5–Equivalent circuit of a one wavelength dipole.

Page 30: Handheld RFID reader_JH_EN_08_07_20

Data Communication

28

When the antenna (dipole) is very short the circuit is dominated by a large capacitive reactance and a small radiation resistance. As the dipole is made longer, R increases as well as XL, XC becomes smaller. When the antenna is approximately one half wavelength long XL and XC cancel each other out and the antenna is in resonance. This is the ideal operating condition. When the dipole is made even longer and reaches one wavelength the antenna is in resonance again and the equivalent circuit is shown in Figure 2-6.

2.1.3.2 Transmission lines

In most cases the length of the wires connecting components can be ignored. When a wire carries a time varying signal with corresponding wavelength comparable to or less than the length of the wire the length becomes important. The length of the wire should be treated as a transmission line if the length is greater than 1/10 of the wavelength [2]. If a transmission line is not designed properly it can lead to unpredictable behavior in the system due to phase delay and reflections.

A transmission line is the path connecting one place to another directing the transmission of energy. A transmission line can consist of coaxial cables, dielectric slabs, optical fibers, electric power lines and waveguides or the copper on a PCB. It can be any structure or material.

Wires connecting antennas to some circuitry should be treated as transmission lines. The most important parameters to be considered are impedance, propagation velocity, loss and mode. All transmission lines have a characteristic impedance which is determined mainly by the geometry of the conductors and the dielectric constant of the material supporting them. If a surface mounted antenna is mounted on a PCB the dielectric is the material on the PCB and the geometry is the copper and the surrounding components. All components close to the transmission line affects the impedance. If the impedance of the antenna doesn’t match the transmission line impedance there will be reflections at the discontinuity and the power transfer will not be perfect. Transmission lines also have loss mainly from conductive loss, dielectric loss and radiation. Open wires have a tendency to radiate and this is dependent mostly upon the spacing of the conductors.

Page 31: Handheld RFID reader_JH_EN_08_07_20

Data Communication

29

Figure 2-6– 4 port Transmission line

In the case above the network is assumed to be linear, which means the complex voltage at any of the ports are proportional the complex current flowing into it when there are no reflections. When a transmission line is uniform across its whole length the behavior can be described by a single parameter called the characteristic impedance Z0. Z0 is the ratio of the complex voltage to the complex current of a given wave at any point of the line. Typical values of Z0 are 50, 75, 100 or 300 ohms [2].

Transmission lines have currents flowing in two directions. The vector sum of these currents should be zero. If the sum is not zero a so called common mode current exists. The common mode current radiates and distorts the pattern of the antenna. Common mode current is introduced in two ways, one by coupling to the energy radiating from the antenna and secondly from a mismatch of modes which occurs when a balanced antenna is connected to an unbalanced transmission line or vice versa.

When sending power via a transmission line it is desirable that as much power as possible is absorbed by ZL and as little as possible is reflected back to the source. This can be ensured by making the source and load impedances equal to Z0.

Some of the power inserted into a transmission line is lost because of resistance. This is only resistive loss. At high frequencies, another effect called dielectric loss becomes significant and adds up to the resistive losses. Dielectric loss occurs when the insulating material around the transmission line absorbs energy from the alternating electric field and converts it to heat.

Page 32: Handheld RFID reader_JH_EN_08_07_20

Data Communication

30

2.1.3.3 Polarization

Polarization is a property of a traveling wave in a direction perpendicular to the direction in which the oscillations that produce the wave are moving. If a wave is moving in the positive x-direction its up and down oscillations are in up and down directions that lie in the yz-plane. All electromagnetic waves traveling in free space have an electric field component E and a magnetic field component H which are usually perpendicular to each other. Both these components are perpendicular to the direction of propagation.

Figure 2-7– Linear, Circular and Elliptical polarization.

In the leftmost figure above, the two perpendicular components are in phase. In this case the ratio of the strengths of the two components is constant, so the vector sum of these two components is constant. When the E field is oriented vertically the wave is said to be vertically polarized. This is also called linear polarization.

In the middle figure, the two orthogonal components have exactly the same amplitude and are exactly ninety degrees out of phase. In this case the E component is zero when the H component is at maximum or minimum amplitude. In this special case the electric vector traces out a circle in the plane, so this special case is called circular polarization. The direction the field rotates in depends on which of the two phase relationships exists. These cases are called right-hand circular polarization and left-hand circular polarization, depending on which way the electric vector rotates.

Page 33: Handheld RFID reader_JH_EN_08_07_20

Data Communication

31

All other cases, that is where the two components are not in phase and either do not have the same amplitude and/or are not ninety degrees out of phase are called elliptical polarization because the electric vector traces out an ellipse in the plane (the polarization ellipse).

2.1.3.4 Power Gain

The power gain of a given antenna is a measurement of the directivity. An antenna with low gain radiates about the same in all directions. An antenna with high gain radiates more in a specific direction. The power gain of an antenna is defined as the ratio of the intensity radiated by the antenna in a given direction at a specific distance divided by the intensity radiated at the same distance by a hypothetical isotropic antenna. If the gain in an antenna is high it doesn’t mean the antenna adds power to the signal. The gain is a passive phenomenon; the power is only redistributed to radiate more in a certain direction. If an antenna radiates more in one direction it must also radiate less in another. High-gain antennas have the advantage of longer range and better signal quality, but must be aimed carefully in a particular direction. Low-gain antennas have shorter range, but the orientation of the antenna is not an issue.

2.1.3.5 Radiation pattern

Depending on the application a suitable radiation pattern must be chosen. Laptops communicating wirelessly use an antenna with low gain and therefore have an Omni directional radiation pattern. An example where a radiation pattern with high gain is desired might be when using a parabolic dish, a remote control or like in this case; a handheld RFID reader which aims in the direction to read.

Radiation Patterns

Power Gain Directivity Polarization

Dipole Broadside Low Low Linear

Multi Element Dipole

Broadside Low/Medium Low Linear

Flat Panel Antenna

Broadside Medium Medium/

High

Linear/Circular

Parabolic Dish Antenna

Broadside High High Linear/Circular

Page 34: Handheld RFID reader_JH_EN_08_07_20

Data Communication

32

Yagi Antenna Endfire Medium/High Medium/

High

Linear

Slotted Antenna

Broadside Low/Medium Low/

Medium

Linear

Microstrip Antenna

Endfire Medium Medium Linear

Table 2-3– Comparison different antennas

Below the radiation pattern of a patch antenna is shown. This is the desired radiation pattern for the purpose of directivity.

Figure 2-8– Patch antenna radiation pattern

Page 35: Handheld RFID reader_JH_EN_08_07_20

Data Communication

33

2.1.4 Circulator

When communicating with passive tags, an antenna is used to both send and receive data due to the fact that tags modulate backscatter on the carrier wave from the antenna. The modulated backscatter is sensed on the antenna and is usually very weak. In order to be able to use the same antenna for transmitting and receiving a ferrite control device called a circulator must be used. A circulator is a device with very low insertion loss in one direction and very high insertion loss in the reverse direction. Low loss is normally less than 0.5dB and high loss more than 20dB [2]. A circulator can consist of multiple ports; a three port circulator with power flow from port 1 to port 2 and from port 2 to port 3 can be seen below.

Figure 2-9− 3-port clockwise Circulator.

2.1.5 Bluetooth

Bluetooth is a very useful wireless standard between components who wish to communicate over short distance with each other. The Bluetooth specification specifies the radio system and the complete protocol stack to ensure that different devices will be compatible with each other.

Page 36: Handheld RFID reader_JH_EN_08_07_20

Data Communication

34

Figure 2-10– The Bluetooth protocol stack

The Bluetooth protocol stack is made up of many layers. The HCI layer is usually the layer that separates the hardware from the software and can be partially implemented in hardware/firmware and software. The layers below HCI layer are usually implemented in hardware and the layers above HCI are usually implemented in software. The Bluetooth radio is the lowest layer of Bluetooth communication.

The Industrial, Scientific and Medical (ISM) band at 2.4 GHz is used for radio communication in Bluetooth technology and in Wi-Fi technology like IEEE 802.11. The Bluetooth radio utilizes a technique, Frequency Hopping Spread Spectrum (FHSS), to switch between 79 sub channels of the radio band. FHSS is used to reduce interference caused from other devices using the same frequency band. The Bluetooth radio switches band every 625 microseconds, making 1600 frequency hops every second. In the Bluetooth 1.2 specification AFH (Adaptive Frequency Hopping) is introduced, AFH is useful if a device communicates through both Bluetooth and Wi-Fi simultaneously (e.g. a laptop computer with both Bluetooth and WLAN). The adaptive frequency hopping algorithm can then avoid using Bluetooth channels overlapping the Wi-Fi channel in use, hence avoiding interference between a laptops own radio communications.

2.1.5.1 Bluetooth communication

There are some roles every device using Bluetooth can assume when connecting to other Bluetooth devices. A client, an initiator of connections, may search for other devices and for services provided by those devices and connect to one service of interest. A server, an acceptor of connections, usually provides a service and accepts a client who tries to connect to this service.

Page 37: Handheld RFID reader_JH_EN_08_07_20

Data Communication

35

Another role that devices must choose is to be either master or slave between connected devices. The master slave role is decided between devices when they establish a connection. A master can setup connection to other devices, perform searches and accept connections from other devices, while a slave cannot connect to another device, cannot perform searches and cannot accept connections from other devices. Connected devices can switch master slave role at any time. In a piconet of up to 8 devices, one unit will act as a master for synchronization purposes and the others as slaves for the duration of the piconet connection. One slave or master in a piconet may also be a slave in another piconet and thus be a communication link between two piconets to combine them to a scatternet consisting of many piconets.

Figure 2-11– A Bluetooth scatternet [5]

There are 13 "profiles" described in version 1.1 of the specification. These profiles are general behaviors through which Bluetooth units communicate with other units.

• Generic Access Profile (GAP)

• Service Discovery Application Profile (SDAP)

• Cordless Telephony Profile

• Intercom Profile

• Serial Port Profile

• Headset Profile

Page 38: Handheld RFID reader_JH_EN_08_07_20

Data Communication

36

• Dial-up Networking Profile

• Fax Profile

• LAN Access Profile

• Generic Object Exchange Profile (GOEP)

• Object Push Profile

• File Transfer Profile

• Synchronisation Profile

2.1.5.2 Bluetooth security

A trusted relationship called paring can be established between pairs of devices by learning a passkey. The passkey is learned by user input, and must be identical in a pair of devices. A device communicating with a trusted device can cryptographically authenticate the identity of the other device, and may also encrypt the data the devices exchange. Pairing is preserved since the Bluetooth address is permanent. Devices generally require pairing or prompt the user before they allow a remote device to use any or most of their services.

2.1.6 General Packet Radio Service (GPRS) / 3G

GPRS is a mobile data service available for mobile phones using Global System for Mobile Communications (GSM). It is used for services such as Wireless Application Protocol (WAP) access, Short Message Service (SMS), and Multimedia Messaging Service (MMS) and for Internet communication services such as e-mail or World Wide Web (WWW) access.

Page 39: Handheld RFID reader_JH_EN_08_07_20

Data Communication

37

2.2 Wired Communication

2.2.1 UART and RS-232

A UART (Universal Asynchronous Receiver Transmitter) is a piece of hardware that translates data between parallel and serial forms. UARTs are commonly used in conjunction with other communication standards such as EIA RS-232. Microcontrollers usually implement UARTs and 9 or 25 pin serial ports on computers use UARTs. The UART usually does not directly generate or receive the external signals used between different items of equipment. Typically, separate interface devices are used to convert the logic level signals of the UART to and from the external signaling levels. External signals may be of many different forms. Voltage is by far the most common kind of signaling used. Examples of standards for voltage signaling are RS-232, RS-422 and RS-485 from the EIA. Some signaling schemes do not use electrical wires. Examples of such are optical fiber, infrared, and Bluetooth in its Serial Port Profile.

2.2.2 Serial Peripheral Interface (SPI)

A protocol to communicate internally between the different devices on the PCB is needed. Using SPI will reduce the communication port pins needed drastically compared to using a parallel port. There are different operating modes of SPI depending on what is most suitable for the configuration. Individual slaves will be used. For every new device an additional pin must be added.

Figure 2-12– SPI – One master, three daisy-chained coupled slaves.

Page 40: Handheld RFID reader_JH_EN_08_07_20

Data Communication

38

Figure 2-13– SPI – One master, three individual slaves.

Page 41: Handheld RFID reader_JH_EN_08_07_20

Design decisions

39

3 Design decisions

3.1 Hardware

The hardware is based on a newly developed RFID-chip from IDS-microchip. The RFID-chip is controlled by a microcontroller called ATmega 64(L) from Atmel. Both these chips contain sophisticated power saving functions. The communication can either be parallel or serial. SPI-bus is a serial protocol that will be used. The IDS-chip handles the analogue part when communicating with a tag. There is a built in power amplifier (100mW) for the RF transmission which will be used.

Because two 1.2V AA lithium batteries will be used there is need for higher voltage to supply the microcontroller and the IDS-chip. A dual step up device provides the reader with two individual voltages (3,3V and 5,3V).

The microcontroller communicates with a Bluetooth or WLAN module using AT commands. The Bluetooth device forwards the data to a Bluetooth compatible mobile phone. The mobile phone must be connected to a server on Internet using some kind of protocol, preferably GPRS. A read tag will be transmitted to this server which can be a database containing tag-information.

High switching speeds and large peak currents makes the PCB layout an important part of the design. Poor design can cause excessive EMI and ground-bounce which can cause instability or regulation error by corrupting the voltage and current-feedback signals. Components are placed as close together as possible. Traces are made as short and as wide as possible

Page 42: Handheld RFID reader_JH_EN_08_07_20

Design decisions

40

3.1.1 Principal solution for MobiReader™

Figure 3-1– Principal solution for Mobireader

The MobiReader consists of two parts:

1. Peripheral board – Power Supply based on MAX863 dual step up device, LEDs, Buzzer, Buttons, Tilt Sensor.

2. CPU board – ATmega 64(L) processor, Bluetooth module, UHF RFID reader IDS 900.

All included in a handheld casing. Note Regarding Potential products Questions/ Remarks

1 Internal amplifier, 100 mW

2 Circulator – clockwise – low return losses needed. Miniature surface mount

circulator. Will return losses be any problem

3 Chip Antenna For example: Fractus FR05-S1-R-0-105

Patch antenna

ATmega 64(L) Microcontroller

UHF RFID reader IDS 900

865 – 868 MHz

Interface Bluetooth / WLAN

2)

Power supply 2 x 1.2 V AA

Lithium

4 x Buttons 5 x LEDs Display (Optional) Tilt Sensor Different signals

Interface Mobile Phone

GPRS

3)

1)

Dual step up device MAX 863 5.3V, 3.3V

Page 43: Handheld RFID reader_JH_EN_08_07_20

Design decisions

41

Table 3-1– Notes on the principal solution

3.1.2 Calculation of the reading distance

An important question to consider is the reading distance. Using the internal amplifier will provide a limited reading distance. The calculation of the reading distance is presented in this chapter. It is important to mention that the calculations are based on perfect conditions. The transmission line on the PCB must be perfectly matched with the antenna. Reflections due to obstacles are not considered, neither is the alignment of antennas. The calculations just give a hint on how far the reading distance is.

The reading distance is calculated for 1000mW, 500mW and 100mW transmission power. A comparison between using a patch- and an omni-directional antenna is done when transmitting 100mW.

Calculation of dBm When the dBm value is positive, i.e. +3dBm it means 3dBm more than 1mW. When the dBm value is negative, i.e. -3dBm it means 3dBm less than 1mW. A negative dBm value can be calculated similarly to a positive dBm. The procedure is, calculate the positive dBm X, and then calculate the inverse 1/X. When calculating the input sensitivity of some chip, of course the lower dBm the better handling of small signals. -66dBm is very sensitive (0.25 µW). The input sensitivity of the tag used during the experiments has got a typical input sensitivity of -13 dBm or 50µW. Calculation of reading distance using 1W transmission power The antenna used is a patch antenna with 9dBic gain.

gaintimesGG

94.7101

log109 10

9

10 ==⇒

=

Compact antennas (such used in passive UHF tags) usually have gain less than that of a dipole — that is, less than 2 dBi — and can be regarded as isotropic in the plane perpendicular to their axis.

gaintimesGG

58.1101

log102 10

2

10 ==⇒

=

Friis free space equation gives:

Page 44: Handheld RFID reader_JH_EN_08_07_20

Design decisions

42

2

4

=R

GGP

Prt

t

r

πλ

where

Pr = Power received Pt = Power transmitted Gt =Gain transmission antenna Gr =Gain receiving antenna λ = wavelength (velocity divided by frequency) R = distance in metres

m3468.010865

1036

8

×=λ

22

R4

0.346858.194.71

4

××=

=ππ

λR

GGPP rttr

The tag dissipates 1.5mW. Looking at the calculations, the limitation in the reading distance seems to be the power dissipation in the tag. When the transmitted power goes below 1.5mW the tag does not power up. The sensitivity of the IDS-R900G never limits the reading distance. Using transmission power of 1W should give a maximum reading distance of 2.5m when operating at perfect conditions. Below the graph of transmitted power in mW can be observed. The x-axis is the distance in m.

¨

Figure 3-2– Transmitted power (mW) vs. distance (m)

Looking at Figure 3-3 it is obvious that beyond 2.5 metres the transmitted power goes below 1.5mW and the tag can therefore not power up properly.

Page 45: Handheld RFID reader_JH_EN_08_07_20

Design decisions

43

Figure 3-3– Transmitted power (mW) vs. distance (1-3) m

Figure 3-4– Transmitted power from tag (mW) vs distance (1–3)m

At 2.5m the transmitted power from the tag is 47 x 10-6mW which is enough for the input on IDS-R900G. Calculation of reading distance using a patch antenna and 501mW (27dBm) transmission power These are the conditions for the experiments performed. The calculated reading distance is 1.75 m.

Page 46: Handheld RFID reader_JH_EN_08_07_20

Design decisions

44

Figure 3-5– Transmitted power (mW) vs distance (0.5 - 1.8)m

Calculation of reading distance using a patch antenna and 100mW (20dBm) transmission power This calculation is done in order to be able to tell how far the reading distance will be in the final product. The built in amplifier (100mW) will be used in the proposed PCB design. The following calculation is based on a patch antenna like in the calculation above with 9dBic gain. The reading distance would be approximately 0.75m. At 0.75m the transmitted power from the tag is 0.0034 mW.

Figure 3-6–Transmitted power vs distance (0–0,75)m

Page 47: Handheld RFID reader_JH_EN_08_07_20

Design decisions

45

Calculation of reading distance using an omni-directional antenna and 100mW (20dBm) transmission power If we instead of using a patch antenna we could use an omni-directional antenna. The following calculation is based on an antenna with 2dBic gain. The reading distance would be approximately 0.35m. At 0.35m the transmitted power from the tag is 0,0008 mW.

Figure 3-7–Transmitted power vs distance (0–0,35)m

Summary

Calculations are performed for a couple of different operating conditions. The reading distance is first calculated using the transmission power 1000mW. 1000mW is a very common transmission power used in RFID applications.

501mW is the operating condition for the evaluation boards. This reading distance is to be compared with the experimental results.

Finally the calculations are done with 100mW power. 100mW is the desired output power in the handheld reader. A patch antenna is compared with a standard omni-directional antenna.

Transmission Power Reading distance

1000 mW (patch antenna) 2.5m

501 mW (patch antenna) 1.75m

100 mW (patch antenna) 0.75m

100 mW (omni-directional antenna) 0.35m

Table 3-2– Reading distance

Page 48: Handheld RFID reader_JH_EN_08_07_20

Design decisions

46

3.1.3 ATmega64(L) – Micro controller

The simplest Micro controller available was first considered because complex functionality was not needed. The ATmega16 seemed to be the right choice. As more and more peripheral devices were added the Micro controller had too few I/O lines and too little memory. If a display shall be able to be added in the future quite much memory is needed. The ATmega64(L) has got all the desired functionality including very sophisticated power saving functions and a low price.

Key features of ATmega64(L)

• Low power 8-bit Microcontroller • 53 Programmable I/O Lines • 3.3V operating voltage • 0 - 8MHz operating frequency • 64K Bytes of in-System Reprogrammable Flash Program memory • 2K Bytes EEPROM • 4K Bytes Internal SRAM • SPI • JTAG Interface • Two 8-bit Timer/Counters with separate prescalers • Two Expanded 16-bit Timer/Counters with separate prescalers • Two 8-bit PWM channels • 6 PWM channels with programmable resolution from 1 to 16 bits • 8-channel, 10 bit ADC • Dual programmable serial USARTs • Programmable watchdog timer with On-chip oscillator • Internal Calibrated RC Oscillator • External and Internal Interrupt Sources • Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-

down, Stand by, Extended Stand by • Software Selectable Clock Frequency

Page 49: Handheld RFID reader_JH_EN_08_07_20

Design decisions

47

Power consumption using an internal RC oscillator @ 8 MHz and 3.3V

Operating mode Operation condition Consumption

Normal Average consumption 9mA

Idle Average consumption 4.5mA

Sleep Average consumption 3µA

Table 3-3– Power consumption ATmega 64(L)

3.1.4 IDS_R900 – RFID chip

IDS_R900 is a newly developed small surface mounted RFID chip (9 x 9 mm) from IDS-Microchip. The chip takes care of the whole analogue part when communicating with a RFID-tag. A microcontroller is used to communicate with IDS_R900. Communication can be chosen to be either parallel or serial. When communicating with the chip different registers are read and written in.

There is a built in amplifier for RF. Because the reader distance is not supposed to be long range the internal amplifier can be used. The power transmitted will be 100mW or 20dBm which will provide a reading distance of approximately 1m.

Key features of IDS_R900

• Parallel 8 bit or serial 4 pin SPI interface to MCU using 12 bytes FIFO

• Voltage range for communication with MCU between 1.8V and 5.5V • Selectable clock output for MCU • Integrated supply voltage regulator (20mA) for supplying MCU and

other external circuitry • Integrated supply voltage regulator for the RF output stage,

providing rejection to supply noise. • Internal power amplifier (20dBm) for short range applications • Modulator using ASK or PR-ASK modulation • Adjustable ASK modulation index • AM and PM demodulation ensuring no “communication holes” with

automatic I/Q selection • Built in reception low-pass and high-pass filters having selectable

corner frequencies • Frequency hopping support • On-board VCO and PLL covering complete RFID frequency range

860MHz to 960MHz • Oscillator using 20MHz crystal

Page 50: Handheld RFID reader_JH_EN_08_07_20

Design decisions

48

• Power down, stand by and active mode

Figure 3-8– Block diagram IDS-R900G

Looking at the block diagram makes it obvious that the communication with the IDS-R900G is digital. All the analogue parts are built into the chip.

Power consumption IDS-R900G

Operating mode Operating Condition Consumption

Normal/reading Average consumption 260mA

Idle Average consumption 3mA

Power down Average consumption 1uA

Table 3-4– Power Consumption IDS-R900G

Page 51: Handheld RFID reader_JH_EN_08_07_20

Design decisions

49

3.1.5 OEM-SPA310 – Bluetooth module

There are numerous available Bluetooth modules on the market. A module with all parts integrated, such as antenna and circuitry on a tiny PCB was chosen. Many different types and sizes of integrated modules exist on the market. The OEM-SPA310 is small in size, has low power consumption and a low price. An evaluation kit could also easily be acchieved. Communication between MCU will be using AT-commands on a standard USART. Communication between mobile phone is Bluetooth. As an option, this module can be mounted on a holder which a WLAN module is pin compatible with.

Key features of OEM-SPA310

• -Small in size • -Low profile • -AT Command support • -Configuration over Bluetooth • -Internal antenna

Figure 3-9– OEM-SPA310

Page 52: Handheld RFID reader_JH_EN_08_07_20

Design decisions

50

Power consumption @ 3,3VDC

Operating mode Operating condition Consumption

Not connected Average consumption 7,9mA

Peak consumption 48mA

Connected Idle or Receiving Average consumption 17mA

Peak consumption 55mA

Transmitting @ 115.2kbit/s

Average consumption 22mA

Peak consumption 58mA

Inquiry Average consumption 39mA

Peak consumption 70mA

Table 3-5– Power Consumption OEM-SPA310

3.1.6 MAX863 – Voltage Step up device

MAX863 is a dual step up device providing us with any voltage up to 28 VDC from two standard AA battery cells. The voltages needed are 3,3V and 5,3V. 3,3V is a fixed standard voltage. 5,3V is a special case and two external resistors are needed to set the voltage. The efficiency is as high as 90% and the size is also very small as well as the cost. The chip is based on monolithic Bi-CMOS circuits and draws only 85µA when both controllers are on. When operating in shut down mode the design only draws 1 µA.

There is also a low-battery indicator in the chip sending out a signal when the battery level goes below a certain value.

3.1.6.1 Capacitors

What is very important in the power supply section are the capacitors. They must have very low ESR. This is due to that they have to be able to deliver high current peaks depending on the operating mode of the device. Tantalum capacitors are a good trade off when considering cost, size and ESR.

Page 53: Handheld RFID reader_JH_EN_08_07_20

Design decisions

51

The advantages of Tantalum are large capacitance to volume ratio, small size, good stability, wide operating temperature range and long reliable operating life. Tantalum capacitors are often used in miniaturized equipment where size is a big concern.

The disadvantages of choosing Tantalum capacitors are higher cost and limited voltage to about 50 volts. Because the device only operates at such low voltage levels, the voltage issue is not an issue.

3.1.6.2 Calculations

The Bluetooth module will be supplied by 5.3V. IDS-R900G will also be supplied by 5.3V. There are two main power consumers on the IDS chip. One is VEXT and the other is VEXT2. VEXT is always connected to 5.3V. VEXT2 can be connected to 3.3V or 5.3V. We must calculate the worst case, which is everything connected to 5.3V.

Maximum power consumption (5.3V) = 120mA(VEXT IDS) + 140mA(VEXT2 IDS) + 50mA(Bluetooth) + 40mA (margin) = 350mA.

The calculations below are needed to select components to connect to the MAX863 chip. All the equations come from the MAX863 datasheet.

Determine the maximum input current for the 5.3V supply section

mAV

IVI

MININ

OUTOUTMAXDCIN 966

4.28.0

3503.5

8.0 )()(, =

××=

××≅

Determine the Peak Switching Current and Inductance

First the minimum allowable AC ripple is calculated according to the following formula.

1381.04.2

4.23.5

105.17

102

,5.172

,

6

6

)((

)(

)(

)(

)(

=−××

×=

==

−×=

MIN

MAXONMINOFF

MININ

MININOUT

MAXON

MINOFFMIN

givesstandst

whereV

VV

t

t

ξ

µµ

ξ

Selection of ξ If ξmin < 1 an acceptable choice is.

Page 54: Handheld RFID reader_JH_EN_08_07_20

Design decisions

52

5691.02

11381.0

2

1min =+=

+= ξξ

Calculation of peak switching current and inductance

mAmaII MAXDCINPEAK 13505691.02

2966

2

2)(, =

−×=

−×=

ξ

The inductor value can be calculated according to.

( ) ( )

( )HavailablecomponentClosest

I

tVVL

PEAK

MINOFFMININOUT

µξ

8)

1055.75691.0101350

1024.23.5 63

6)()(

==

×=××

××−=×

×−≅ −

The peak switching current is set by RSENSE (R1 and R2).

Ω==≤ 0630.0135085)(

mA

mV

I

VR

PEAK

MINCSSENSE

To verify that the correct RSENSE is selected the prototype must be tested with the lowest supply voltage and maximum output current. If the voltage drops the components needs to be reselected. The current-sense resistor must be a small, low-inductance type, such as a surface-mount metal strip resistor. The power rating of the resistor must be higher than.

( )W

mV

R

VR

SENSE

MAXCS

RATINGPOWER 1147.0063.0

85 2)(

2

===

Below the calculation of the inductor component is done. The inductance should be low enough to allow the MAX863 to reach the peak current limit during each cycle before the 17.5µs maximum on-time. If the inductance is too low, the current will ramp up to a high level before the current-sense comparator can turn the switch off. We choose a value between LMIN and LMAX.

HI

tVL

HI

tVL

PEAK

MAXONMININMAX

PEAK

MINONMAXINMIN

µ

µ

31101350

105.174.2

67.2101350

105.14.2

3

6)()(

3

6)()(

××=×

××=×

Finally the output voltage is set by two resistors (R1 and R2)

We set R2 = 100kΩ

Page 55: Handheld RFID reader_JH_EN_08_07_20

Design decisions

53

Ω=−×=

−= kV

VRR OUT 324)1

25.1

3.5(1001

25.121

, where 1.25V is the voltage of the internal reference.

The rest of the components used are selected according to the example schematics provided by the MAX863 datasheet.

Calculation of the battery low level indication

When the voltage on LBI drops below 1.25 V LBO sinks current. Looking at the diagram below we choose that when the voltage on a battery is 1.2 V or lower we want the low battery indication to go active.

Figure 3-10– Discharge time versus voltage in 2700mA AA battery

Calculation of R5 and R6 Set R6 = 100kΩ

( ) Ω=−==Ω==

kAVVR

AkVII RR

925.12/25.14.25

5.12100/25.156

µµ

3.1.7 Fractus chip antenna

A standard Omni-directional antenna with 50ohm input impedance from Fractus is chosen for evaluation. The antenna is of surface mount type and will be mounted on the PCB.

The trace on the PCB connecting the antenna must be treated as a transmission line and the width must be calculated as below.

Calculation of transmission line impedance

1. Frequency = 865MHz 2. Trace Width (w) – X

Page 56: Handheld RFID reader_JH_EN_08_07_20

Design decisions

54

3. Trace thickness (t) – 0.035mm 4. Board Height (h) – 0.8mm 5. Permittivity FR4 (εr) – 4.34 6. Z0=µ0c0=119.9169832π Ω 7. Zmicrostrip = 50 Ω

( )

+

+

×+

+×+

++

=2

11

4

11

814

4

11

814

41ln

1222

2

0 r

eff

r

eff

r

effr

microstrip w

h

w

h

w

hZZ

επεεεπ

mmweff 54.1=⇒

+×+

+×+=

2

2

10

1111

4ln

2

11

t

wh

t

etww r

eff

π

πε

mmw 2.1=⇒

The width of the microstrip must be 1.2 mm to achieve a 50Ω transmission line.

3.1.8 Circulator

The toughest component to find happened to be the circulator. Because not so many products fitting the requirements exist on the market almost no circulator manufacturer could provide such a small component as was desired. The purpose of a circulator is to be able to operate in full duplex without the need of two individual antennas. The circulator below comes from Hitachi metals and has got all the requirements fulfilled.

Page 57: Handheld RFID reader_JH_EN_08_07_20

Design decisions

55

Figure 3-11– 7mm Square Circulator SC-7TN0859M

Frequency Insertion

Loss Isolation V.S.W.R.

Handling

Power Operating

Temp. Impedance

824~894

MHz 1.1dB

Max. 10dB

Min. 2.0

Max. 5.0W

Max. -35~+85C

50ohm

Typ.

Table 3-6– 7mm Square Circulator SC-7TN0859M specification

Figure 3-12– Circulator insertion loss

Page 58: Handheld RFID reader_JH_EN_08_07_20

Design decisions

56

Figure 3-13– Circulator isolation

An alternative to using a circulator is in low power applications to use a so called directional coupler.

3.1.9 Piezo Buzzer

A piezo buzzer with very low profile was chosen to fit the design. The power consumption is also very low, only 3mA at 5 V.

3.1.10 Microchip SPI Potentiometer

Because a SPI connection already exists it is very easy to add any additional component with this interface. A potentiometer from Microchip will be used to be able to change the volume on the buzzer.

3.1.11 Display

A SPI compatible display can easily be implemented into the design because there is a connector prepared for that purpose.

3.1.12 Diodes

All diodes are chosen to consume as little power as possible.

Power consumption

7mA x 5 = 35 mA when all diodes are lit.

Page 59: Handheld RFID reader_JH_EN_08_07_20

Design decisions

57

3.1.13 Batteries

2 x 1.2V rechargeable nickel metal hydride cylindrical cell batteries. The battery with highest capacity can hold 2700mAH.

3.1.13.1 Battery life

When the unit operates in sleep mode the consumption is very close to 0 (only a couple of µA). This is because the microcontroller shuts down all unused components.

A reading can be assumed to be initiated every 10th minute and last for 30 seconds. The reader is used day and night (60 x 60 x 24 = 86400 seconds / 24 hour’s period). 86400 / (10 x 60) = 144 times / every 24 hours The reader will be active 144 x 30 = 4320 seconds (1.2 hours) every 24 hour period.

The readers’ average consumption is 22mA + 260mA + 10mA + 35mA = 327mA. The consumption is divided between 3.3V and 5.3V 5.3V: 140mA+7mA=147mA 3.3V: 22mA + 120mA + 10mA+28mA= 180mA Power consumption P(5.3V) = 5.3 x 147mA = 779.1mW P(3.3V) = 3.3 x 180mA = 594mW Total: 779.1mW + 594mW = 1373.1mW 90% efficiency in MAX863 gives. 1373.1 / 0.9 = 1525.7mW I = 1525.7 / 2.4V = 635.7 mA 5400 / 635.7 = 8.5 hours If the reader is active 1.2 hours every day it would approximately last for one week which is very good.

3.1.14 Buttons

The circuit connecting the buttons to the micro controller requires protection against interferences from outside such as EMI. Protection against contact bounces is also considered in the circuit and in the calculations below.

Page 60: Handheld RFID reader_JH_EN_08_07_20

Design decisions

58

Figure 3-14– High voltage peak protection and contact bounce protection.

This circuit is designed to protect the micro controller’s inputs against high voltage peaks and contact bounces. If the voltage increases to more than 3.3 volts, diode D100 will start conducting. If the voltage for some reason becomes negative diode D101 will start conducting. This is one of the functionality of this circuit. The other functionality of the circuit is a low pass filter designed to filter out contact bounces from the buttons. No buttons are perfect, pushing or releasing a button leads to contact bounces. Using this circuit a button must be pushed and held for a while in order for the signal to reach the micro controller. The de-bounce functionality can also be designed in software but it is a more elegant method to design it in the hardware. Looking at Figure 3-15 the contact bounce problematic can be observed. When pushing a button the output doesn’t reach a stable value instantly. The same problem occurs when releasing the button.

Figure 3-15– Contact Bounce

The low pass filter was calculated using the following formula.

Page 61: Handheld RFID reader_JH_EN_08_07_20

Design decisions

59

msconstantTimeτ

F(C100)eCapacitancC

k(R100)ResistanceR

frequencyCutofff

whereRC

f

c

c

10

10

1

2

1

2

1

====

Ω===

==

µ

ππτ

Because charging a capacitor takes time we can calculate the time it takes before the micro controller notices a high input. The calculation follows below.

capacitorovervoltagetv

resistorovervoltagetv

supplyvoltageDCV

wherediC

RtitvtvV

c

r

0

t

cr

==

=

+=+= ∫

)(

)(

)(1

)()()(0

0 ττ

Assuming that the capacitor is initially uncharged and the initial current is.

−−=

=

RC

tVtv

givesRVI

exp1)(

/

0

00

To reach 0.6 x 3.3 = 1.98 V which is read as high it takes approximately a little less than 10ms looking at the Matlab simulated graph below. After 50ms the steady state (3.3V) is reached.

Figure 3-16– Voltage(V) versus time(s) on input to micro controller

Page 62: Handheld RFID reader_JH_EN_08_07_20

Design decisions

60

Matlab commands to plot the graph above. t=0:0.0001:0.05; v=3.3*(1-exp(-t/(10*10^-3))); plot (t,v) grid on

Page 63: Handheld RFID reader_JH_EN_08_07_20

Design decisions

61

3.2 Software design

The software is divided into two parts, software to the ATmega processor and Java software for the mobile phone. The chosen processor for the PCB is an ATmega 64, but for the development of the software an evaluation board from ATMEL will be used together with an ATmega 16. Since these ATmega processors differ on internal hardware modules and memory size, porting the final code will not be problematic if care is taken in the development i.e. place hardware dependent code in few software functions and subroutines for easy oversight.

3.2.1 ATmega software

This software will control the microcontroller, the IDS-900 chip and the Bluetooth module. The desired functionality of the software is similar to an EFSM (Extended Finite State Machine) meaning that input to the microcontroller or internal happenings decide what will happen next from the current state. The different states, represented by functions, are to initialize the system, read tags, sleep, and to send data via the Bluetooth module. The different inputs and happenings are powered up or restarted processor, pressed buttons, nothing has happened for a time and tag IDs to transmit over Bluetooth.

Page 64: Handheld RFID reader_JH_EN_08_07_20

Design decisions

62

Figure 3-17– ATmega 16 state chart

The above figure describes the desired state functionality of the ATmega processor. In terms of hierarchy or abstraction, only the lowest level of the code will be internal hardware dependent of the ATmega processor and will need to be changed if the code is to be ported. With respect to extensibility of the software code, more states can be added to the program. The software will be semi automated and requires some input stimuli by a user to perform the more important tasks of reading a tag or search for a tag. All other tasks will be automatic. The code will be platform specific and will require the specified hardware in order function properly. With respect to the testing and “debugging” of the software, the state handling functions will be developed first and tested. Once the state handling is functioning properly, the different state functions will be developed and tested separately. This will also greatly simplify the testing and debugging of the project as a whole.

3.2.2 Java software

“Java is a programming language originally developed by Sun Microsystems and released in 1995 as a core component of Sun's Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and

Page 65: Handheld RFID reader_JH_EN_08_07_20

Design decisions

63

fewer low-level facilities. Java applications are typically compiled to byte code which can run on any Java virtual machine (JVM) regardless of computer architecture.” [6] The different versions of Java are Java EE, Java ME and Java SE. Java EE is for enterprise applications and the greatly stripped down version Java ME is for mobile applications. Java SE is the designation for the standard edition. Since J2ME has a simple object model and few low level facilities, the design of the mobile phone software will include objects for generating connections with Bluetooth and GPRS. Also the design will contain a few run able threads to handle the main program and the communications. During the development phase of the software the objects and threads will be written and tested as separate programs before porting the respective code to objects and threads combined to a final version. Since the program will be semi automated and require some input stimuli for proper functioning, the main thread will contain displayable screens and button listening and handle the other objects and threads according to input stimuli. A decision was made to base the Bluetooth handling of the Java program on André N. Klingsheim’s Master science thesis “J2ME Bluetooth programming” [7]. That M.S thesis describes which Java objects are needed for a simple Midlet and how use a mobile phone’s Bluetooth device, in particular how to set up a server service or to set up a client’s service search. The GPRS handling will be based on “Beginning J2ME platform: from novice to professional” [11], which describes how to set up and communicate using GPRS in Java program.

Page 66: Handheld RFID reader_JH_EN_08_07_20

Implementation

64

4 Implementation

4.1 Hardware

All the hardware was designed using a tool called EAGLE (Easily Applicable Graphical Layout Editor) cad. EAGLE cad is a powerful free tool for PCB design. Many components are available in the built in library. It is also possible to find many of the special components in downloadable libraries on the Internet. Though, many of the special components had to be created from scratch.

The design is divided into two separate boards. The first board is the board called “Mobireader - Main Board”. This board carries the RFID-chip, the micro controller, the Bluetooth module and the antenna. The second board, called “Mobireader – Peripheral Board” is the board carrying all the peripheral devices, such as diodes, buzzer, tilt sensor and buttons. The most important function of this board is the power supply.

All the signal lines are drawn with a minimum width of 0.2mm. The supply lines are drawn as thick as possible. RF lines are drawn 1.45mm to match the antenna impedance (50ohm).

Capacitors are placed as close as possible to the consuming component.

The most important protection against interferences from outside is a solid ground plane. Ground planes are placed everywhere where free space on the boards exist. This will minimize various disturbances from sources that can disturb both from outside and from inside the device.

4.1.1 Mobireader Main Board rev.1

The PCB is a two-layer board with very small outer dimensions. The PCB measures approximately 66x50 mm. There is not much free space on the board. Because there are two transmitting/receiving antennas they are placed as far away from each other as possible. The frequency of the Bluetooth is 2.4GHz and the RFID is 865MHz. As more and more components were added the space grew smaller and smaller.

Page 67: Handheld RFID reader_JH_EN_08_07_20

Implementation

65

Figure 4-1– Eagle Cad 2 Layer PCB

The design is intended to be small, cost- and power efficient. The goal was to mount all the components on one side of the board and also draw as many of the connection lines on the top layer. The bottom layer was intended to act as ground layer and therefore as few connections as possible are placed there. The benefits of the first board are cost, simplicity and size. Though the function, especially in the RF section is questionable for several reasons.

Because the first main board was designed using a two layer PCB it had poor ground. When designing a transmission line a ground plane must be placed right next to it. According to IDS-microchip their chip will not work at all using a 2-layer board. They recommend a four layer PCB using one of the middle layers as a ground plane. When designing circuits with RF signals the PCB must have extremely good ground. Some of the RF components require perfect RF ground. Perfect RF ground can be achieved using multiple vias connected to ground. Using multiple vias the RF signal can easily travel to the ground plane. The more vias added the smaller impedance. Of course, the more vias added the higher cost.

Page 68: Handheld RFID reader_JH_EN_08_07_20

Implementation

66

There are more problems with the first revision of the board. Capacitors must be placed as close as possible to the component consuming power. This can be solved by mounting the components on the bottom side of the PCB. Mounting components on two sides increases the complexity of the design and therefore also the cost increase. Therefore, components will not be mounted on the bottom side, even though the functionality probably would be better.

Another questionable design issue is putting the antenna close to the mixer input. This path becomes a direct path in parallel with the circulator leakage path which probably will corrupt the signal. Shielding between the paths would solve this problem.

When the coaxial connector is not used there is still a transmission line carrying the RF signal. This stub will radiate and act as an antenna as well as the antenna itself. The radiation pattern will be slightly corrupted in a way impossible to tell without testing.

When MCU lines cross CD1, CD2, ADG, VCO, CP COMPA, COMNB it will corrupt both TX and RX performance.

4.1.2 Mobireader power supply board rev.1

The power supply board design is much straighter forward than the Main board design. There are no RF signals; therefore the implications associated with RF are not an issue. No wires considered as transmission lines exist. This is a 2 layer board.

Figure 4-2– Side view of main and power supply boards

Page 69: Handheld RFID reader_JH_EN_08_07_20

Implementation

67

The design is very compact. There is only 1 mm free space between the Bluetooth device and the capacitors. There are no components blocking the Bluetooth antenna. There might be disturbances between the main board and the power supply board considering the RF signals. The whole unit must be tested and evaluated in order to know what the implications are.

4.1.3 Mobireader Main Board rev.2

The next prototype measures 78x61mm and will fit in a slightly larger handheld plastic casing. A decision was made to increase the size of the board due to all the problems described in rev.1. The most important change was to instead of using a 2-layer board use a 4-layer board. The both middle layers are ground layers. Below the settings can be observed.

Figure 4-3– Eagle Cad 4 layers PCB

There was a need to rearrange most of the components in order to be able to fulfill all the requirements in the problem listing from rev.1. Now the TX and RX paths are much cleaner. Perfect ground and RF were prioritized because these two factors are most important for proper operation. The IDS chip must be grounded on the bottom side. Therefore a big via hole will be drilled under the chip which makes it possible to solder manually afterwards. In this design there is also more space for the antenna. The antenna should work as described in the data sheet, nothing will interfere.

Page 70: Handheld RFID reader_JH_EN_08_07_20

Implementation

68

4.1.4 Mobireader Power Supply Board rev.2

There were no known problems with rev.1 of the Power Supply Board. In order to make this board fit together with the main board it was also necessary to slightly increase the size of the PCB.

4.1.5 Test set up for measuring reading distance

Using a controlling ATmega 16 processor, the IDS-900 chip and a patch antenna, the test will be performed in an office room on an empty wooden desk. The room is not the perfect room regarding reflections from walls and other objects and multipath effects. Regarding the not-perfect radio testing, the interest of this measure is to find the general responsiveness from the RFID tag at different angles and distance to the antenna. Since UHF RFID tags antennas need to reflect the electromagnetic waves from the reader antenna to communicate, the test set up was to measure 6 different perpendicular angles between the tag and the antenna. These angles represent the tag being placed with two of three angles fixed and then changing the last angle between maximum and minimum reflection area to the reader antenna. It is assumed that a tag placed with minimum antenna reflection to the electromagnetic waves the reading distance will be relative short. The patch antenna used for this set up is called ID ISC.ANT.U250/250-EU from OBID. This patch antenna has the characteristics desired for implementation in the Mobireader.

ID ISC.ANT.U250/250-EU Specification

Dimensions (WxHxD) 260x260x56 mm

Operating frequency 865 – 870 MHZ

Gain 9,0 dBic @ 866 MHZ

3 dB beam width E plain 65°

3 dB beam width H plain 65°

Polarization Circular

VSWR <1,5 : 1

Table 4-1– OBID antenna specification

The measurement will be performed with the system having 27dBm (501 mW) signal being feed through a 50 Ω cable to the antenna at the frequency 867MHz. The figure below shows the placement of the tag versus the antenna.

Page 71: Handheld RFID reader_JH_EN_08_07_20

Implementation

69

Figure 4-4– The different placements of the RFID tag versus the antenna.

In the figure, the Z-axle represents height from the ground, the Y-axle represents the distance from the antenna to the tag and the X-axle represents the width. During the measurement at these different angles, the tag was placed according to a placement in the center of the antenna, the Z position and the X position was kept constant. The Y position was increased by steps of 10 cm away from the antenna until the tag could not be read at all. In each 10 cm step the system tried to read the tag a thousand times.

Page 72: Handheld RFID reader_JH_EN_08_07_20

Implementation

70

4.2 Software

The software creation and initial testing for the controlling MCU has been done in AVR studio together with an ATmega 16 processor in a STK 500 evaluation board. The RFID part of the project will be handled by an IDS-R900G development system board, and the Bluetooth module will be placed in a RS-232 module adapter to communicate with the STK500 evaluation board, which has implemented RS-232. A patch antenna is included with the IDS-R900G system board and of course a UHF RFID tag is needed. The STK 500 board and the IDS-R900G board uses parallel communication. For debugging and programming the ATmega 16 processor, an AVR Dragon will be used. The picture below shows the system made up of modules.

Figure 4-5– The modules used for the project.

1. AVR STK 500 evaluation board with an ATmega 16 processor.

2. IDS-R900G Development System board.

3. OEMSPA 310 Bluetooth module in a OEM RS232 Module Adapter

4. UHF RFID tag integrated on a paper label.

5. AVR Dragon debug tool.

1.

4.

2.

3.

5.

6.

Page 73: Handheld RFID reader_JH_EN_08_07_20

Implementation

71

6. 870 MHz Patch antenna.

2.

1.

3.

4.

6.

Figure 4-6– MobiReader block diagram with the evolution boards

The figure above shows the evaluation boards purpose in the Mobireader block diagram. The Java code for the mobile phone has been created in NetBeans IDE and emulated in Sun’s Wireless Toolkit. These programs for generating and emulating Java code are free to use and is the reason for choosing of these programs.

4.2.1 ATmega software

The general behavior of the ATmega processor will be like an EFSM. The states the processor enters will define which underlying function to call for appropriate action. Shifting of states occurs after completion of current state, to which state is decided by registered events and inputs to the processor. For the purpose of saving battery energy, the processor will enter a sleep mode if its inputs are unused for a period of 5 seconds, where the Bluetooth module and the IDS-900 chip will be turned off. The IDS chip doesn’t have any persistent storage therefore its settings are needed when awakening from a sleep mode. The behavior of the processor is explained by the flowchart below. Once powered up, the processor will initialize itself, send commands to initialize the IDS chip and Bluetooth module. In the Idle state, the processor will wait for user to press a button to perform action accordingly. If no buttons are pressed, the processor will enter Sleep state after 5 seconds. Below are the flowcharts of the processors behavior and state handling.

Page 74: Handheld RFID reader_JH_EN_08_07_20

Implementation

72

Figure 4-7– ATmega 16 Flowchart page 1

Page 75: Handheld RFID reader_JH_EN_08_07_20

Implementation

73

Figure 4-8– ATmega 16 Flowchart page 2

Page 76: Handheld RFID reader_JH_EN_08_07_20

Implementation

74

Figure 4-9– ATmega 16 Flowchart page 3

Page 77: Handheld RFID reader_JH_EN_08_07_20

Implementation

75

The read tag function was designed to communicate with a small amount of tags in its surrounding, Q was chosen to 4 at start of the function and the max slot value can therefore be 7. No prediction can be taken to how many tags will be in the readers surrounding and the problem is if Q is chosen to small and tags choose the same random slot value, they will try to reply at the same time and therefore give i.e. CRC errors in the reception of the reader. When a tag have correctly replied and been acknowledged, a QueryRep command is issued and therefore the tag will invert its inventoried flag and therefore not participate in the current inventory round. As long as tags reply one by one, tags will be removed from the current inventory round and when CRC errors occur, a QueryAdjust with no change in Q is issued giving new random slot values. The rest of the tags will eventually be singled out and read until they all have been removed from the current inventory round. CRC errors can occur by various reasons; among them are multipath effects, signal fading and multiple tags responding at the same time. From the datasheet of the IDS-900 Chip, the RX count error is when a reception is shorter than expected, and Preamble detection error is when the Preamble set up of the tag and IDS-900 chip differ. Also these two errors are handled by issuing a Query Adjust No change in Q value command, to retry and query the tags again. When a tag has been acknowledged and responds with any error, a new ACK command is issued to try again.

4.2.2 ATmega software for measuring reading distanc e

For the purpose of measuring the maximum reading distance at different angles between the RFID tag and the antenna some changes will be needed from the general ATmega software. Tag readings must be iterative instead, read one tag multiple times, and collect data such as if it responded ok, gave CRC errors during the transmission. When the IDS-900 chip communicates with a tag, it will show codes for different errors that can occur, such as CRC errors, no response errors. The occurrence of these errors codes will be stored and instead of sending the actual RFID number to the mobile phone, the error occurrence will be sent instead. Instead of sending the data to the mobile phone via the Bluetooth, a computer will be connected to the RS-232 cable and the program HyperTerminal will collect and store sent information from the processor.

Page 78: Handheld RFID reader_JH_EN_08_07_20

Implementation

76

4.2.3 Java Midlet software

The Java software implementation consist of a GUI (Graphical User Interface) with instantiated objects that controls the Bluetooth in the mobile phone and a GPRS connection to the internet. The Midlet (Java program for mobile phone) will contain a few displayable screens and have a few soft buttons. Once started, the Midlet will wait for user to press a connect button, search for the Bluetooth module which is acting as a server with a SPP (Serial Port Profile) service and try to connect to it. Once the Bluetooth is connected, the program will automatically try to connect to a web server using GPRS and provide some status information on the screen. There will be main screen displaying status information about its connections and have a menu containing some user commands. Since the SPP will be used, debugging and testing is simplified greatly by using emulated serial ports over Bluetooth. A computer with Bluetooth connected to either the Bluetooth module or the mobile phone running the Java Midlet, the software controlling the Bluetooth module and Java Midlet can be tested individually before testing them connected to each other.

Figure 4-10– Midlet GUI screens

In the figure above the different screens used and their soft buttons are presented. Only two screens where needed for a first version of the software and some soft buttons to connect or reconnect the Bluetooth and the GPRS connection. The Midlet is composed by a few classes:

• GUI (Graphical User Interface) handler

Page 79: Handheld RFID reader_JH_EN_08_07_20

Implementation

77

• Bluetooth connection creator

• GPRS connection creator

• Communication handler

The GUI handler will be the main class, instantiating and controlling the other three classes once started. The GUI handler and the communication handler will be run as thread objects in the OS (Operating System) of the mobile phone. The Bluetooth- and GPRS connection creator classes will be instantiated as objects and used by the GUI handler class. In the following figures are the flowcharts of the software behavior.

Page 80: Handheld RFID reader_JH_EN_08_07_20

Implementation

78

While (! EndNow)

End of

While (! EndNow)

Connect

BT ?

Create new

Bluetooth

connection

Connect

GPRS ?

Create new GPRS

connection

BT

connection

ready ?

GPRS

connection

ready ?

Store BT

connection in

Mobicomm

object

Store GPRS

connection in

Mobicomm

object

No

No

Update

connection

status

Yes

Yes

Yes

No

Yes

No

While (! EndNow

& BT connected &

GPRS connected)

End of

While (! EndNow

& BT connected &

GPRS connected)

Sleep 100 ms

Sleep 1000 ms

Start Mobicomm as

new thread

Update

Tags read

Update

Tags in mem

Update

Tags sent

Update

Tags

confirmed

End

Mobireader

Command action

This object handles pressed

buttons in the current

displayable screen

Connect

Command ?

Reconnect BT

Command ?

Reconnect GPRS

command ?

Exit command

?

Connect BT = true

Connect BT = true

Connect GPRS =

true

Yes

Yes

Yes

EndNow = true

Yes

End

Connect GPRS =

true

Yes

Connect BT =

false

Connect GPRS =

false

Link 1

Se page 2

BT connected =

true

GPRS connected

= true

Displayable ==

InitForm ? Yes

Exit command

?

EndNow = true

Yes

Displayable ==

StatusForm ?

No

No

No

No

No

No

No

Figure 4-11– Mobile phone software flowchart page 1

Page 81: Handheld RFID reader_JH_EN_08_07_20

Implementation

79

While (! EndNow &

BTconnected &

GPRSconnected)

End of

While (! EndNow &

BTconnected &

GPRSconnected)

BTRead()

GPRSsend()

Confirmtag()

Tagsinmem =

Tagsred -

Tagssent

Get current time

Tagsinmem =

Tagsred -

Tagssent

Read timestamp

Current time – timestamp >

10 000 ms ?

BTconnected = false

Yes

No

Sleep

100 ms

Sleep

1000 ms

While (! EndNow)

End of

While (! EndNow)

Link 2

Link 3

Link 4

Se page 3

Se page 4

Se page 5

End

Mobicomm

Link 1

Figure 4-12– Mobile phone software flowchart page 2

Page 82: Handheld RFID reader_JH_EN_08_07_20

Implementation

80

Figure 4-13– Mobile phone software flowchart page 3

Page 83: Handheld RFID reader_JH_EN_08_07_20

Implementation

81

GPRSsend()

Tags in memory > 0 &

Tags confirmed == Tags sent ?

Read Tag

element

Send tag element

via GPRS

Tags sent++

Yes

Return

No

Link 3

Figure 4-14– Mobile phone software flowchart page 4

Page 84: Handheld RFID reader_JH_EN_08_07_20

Implementation

82

Confirm tag()

bytes = available

bytes from GPRS

For (index = 0, index <

bytes, index++)

End of For loop

GPRS = Read

next byte

Tagconfirm string =

Tagconfirm string + GPRS

Temp = first tag

element

Temp == Tagconfirm

string ?

Remove first

tag element

Tags confirmed ++

Send ’:’ via

Bluetooth

Yes

Return

No

Link 4

Figure 4-15– Mobile phone software flowchart page 5

Page 85: Handheld RFID reader_JH_EN_08_07_20

Implementation

83

4.2.4 Communication

In the Bluetooth communication it was decided that the Bluetooth module should behave as a server which offers a SPP, Serial Port Profile, service. One major reason for this decision is that the mobile phone, acting as a client who needs to search it’s surrounding for the Bluetooth module service, can have a visual user interface with the user during the establishment of the Bluetooth link. The Bluetooth module does not care who will be the master of this link, and therefore allows the mobile phone to become master and thus allowing it to communicate with other Bluetooth devices during this session. This would allow a user to use his or her other peripheral Bluetooth devices, such as headsets, at the same time. Since the Bluetooth module has a UART communication with the processor, the processor has an emulated UART communication with the mobile phone once the Bluetooth link is established. Below is a figure of the communication events. The first two rows in the figure shows the events when the system is idle and sends idle signs (‘ ‘ spacebar) over the Bluetooth to keep track of that the Bluetooth nodes are connected. The lower four show the events of sending a tag ID over the Bluetooth, GPRS and how it is confirmed back to mobile phone and to Mobireader.

Page 86: Handheld RFID reader_JH_EN_08_07_20

Implementation

84

Communication

Idle phase 1

Idle phase 2

Transmit tag ID

Phase 1

Transmit tag ID

Phase 2

Cinfirm tag

Phase 1

Cinfirm tag

Phase 2

ServerMobile phone

GPRS

Mobile phone

Bluetooth

ATmega 16 software with

Bluetooth module

Transmit ’ ’

Transmit ’ ’

Reset

timestamp

Reset

timestamp

Reset

timestamp

Transmit

Tag ID

Read Tag

ID

Transmit

Tag ID

Read Tag

ID

Transmit

Tag length

Read Tag

length

Transmit ’:’Reset

timestamp

If more than 10 seconds has passed

since last recieved data, the

Bluetooth connection is considered

lost and needs to be reconnected.

Reconnection is done by pressing a

button in the java program.

If 8 seconds or more has passed

since last transmission, a * * (space)

is sent. If 10 seconds has passed

since last recieved data, the

Bluetooth connection is considered

lost and needs to be reconnected by

the mobile phone

Figure 4-16– Communication events of Mobireader, Mobile phone and server

Page 87: Handheld RFID reader_JH_EN_08_07_20

Results

85

5 Results

5.1 Hardware

Two PCB:s have been designed. The first PCB contains power supply and peripheral circuits, such as buttons, LEDs, buzzer and tilt sensor. The second PCB contains the micro controller, the IDS chip and the Bluetooth module. The main problem has been finding suitable small components. The PCBs are mounted in a casing with limited space in all directions. It is only 10 mm between the two boards.

The first design was sent to IDS-microchip for evaluation. A reply was received with a huge list of what they believed had to be improved for proper operation. The biggest issue was the use of the two-layer board with poor ground. The better ground provided the better operation could be expected from the chip according to IDS. Ground is extremely important when dealing with RF. On the new design a four-layer board with both middle layers acting as ground was used. A slightly bigger PCB was also used so that the RF transmission lines could be drawn perfectly symmetrically and isolated from disturbing components.

After connecting the hardware together module by module an error was found in the hardware. The SPI-bus didn’t work as described in the data sheet. After consulting with IDS-Microchip the conclusion was that the SPI-bus could not be used. In the later design a change to parallel communication was made instead of serial.

5.1.1 Antenna

An antenna of patch type is an ideal antenna for this project. A patch antenna is an antenna with a directed radiation pattern. After searching the web, considering literature reviews, interviewing people and contacting various antenna manufacturers, no suitable patch antenna could be found. In order to realize a Patch antenna in the small casing a lot of time for development and testing would be required just to make sure whether it could work or not. Building this type of an antenna takes as much time as doing yet another thesis. Therefore a standard chip antenna with Omni directional radiation pattern from Fractus was used. This means that it radiates equally in all directions. Because the reader shall only be able to read the tag pointed at this will probably be a problem. The problem might be able to be solved in software, i.e. decide to read the tag with the highest RSSI value.

Page 88: Handheld RFID reader_JH_EN_08_07_20

Results

86

Different companies offering material that can absorb antenna radiation has been found. Some of the companies claim that this material can help forming a radiation pattern. Experiments with the absorbing material have not been undertaken. It could though be interesting to evaluate.

5.1.2 Circulator

Another difficult component to find was a suitable circulator with the desired specification and dimensions. No circulator has been evaluated. A circulator could probably be replaced by a component called a directional coupler. There are though some complications with the directional coupler that needs to be considered. The PCB needs to be tested to really know if it works or not.

5.1.3 Reading distance measure results

Below are the results from the reading distance measure, showed in graph form. The Z – axle represents height from the ground, the Y – axle represents the distance from the antenna to the tag and the X – axle represents the width. The distance is measured along the Y – axle. According to the graphs below, when the tags antenna covers more area over the Z – X plane, (more area perpendicular to both E-field and H-field) the farthest readings are achieved. Comparing these results to the theoretically calculated reading distance of 1,75m @ 27dBm (501mW), here presents longer possible reading distance but it must also be noted that these measurements where performed in a “not perfect” room where reflections, signal attenuation and other factors affected the results. In general, the results show a relative large number of no responses from the tag, even in seemingly good conditions. It seems that a good practice of reading tags is to read them repeatedly. With a handheld reader, such as the proposed Mobireader, it seems that the user should be aware of the relative tag positions that are most probable to not be read and to rotate the reader with the hand if no tag responds.

Page 89: Handheld RFID reader_JH_EN_08_07_20

Results

87

Figure 5-1– Measure results at placement 1

Figure 5-2- Measure results at placement 2

Z

X

Placement 1

Placement 2

Z

X

Placement 1

0

100

200

300

400

500

600

700

800

900

1000

0 50 100 150 200

Distance (cm)

Num

ber

of Tags Ok

CRC error

No Response

Placement 2

0

100

200

300

400

500

600

700

800

900

1000

0 50 100 150 200 250

Distance (cm)

Num

ber

of Tags OK

CRC error

No Response

Page 90: Handheld RFID reader_JH_EN_08_07_20

Results

88

Figure 5-3– Measure results at placement 3

Figure 5-4– Measure results at placement 4

X

Y

Placement 3

Placement 4

X

Y

Placement 3

0

100

200

300

400

500

600

700

800

900

1000

0 10 20 30 40 50 60

Distance (cm)

Num

ber

of Tags OK

CRC error

No Response

Placement 4

0

100

200

300

400

500

600

700

800

900

1000

0 20 40 60 80 100 120 140

Distance (cm)

Num

ber

of Tags OK

CRC error

No Response

Page 91: Handheld RFID reader_JH_EN_08_07_20

Results

89

Figure 5-5– Measure results at placement 5

Figure 5-6– Measure results at placement 6

Z

Y

Placement 5

Placement 6

Z

Y

Placement 5

0

100

200

300

400

500

600

700

800

900

1000

0 10 20 30 40 50 60 70 80

Distance (cm)

Num

ber

of Tags OK

CRC error

No Response

Placement 6

0

100

200

300

400

500

600

700

800

900

1000

0 50 100 150 200 250

Distance (cm)

Num

ber

of Tags OK

CRC error

No Response

Page 92: Handheld RFID reader_JH_EN_08_07_20

Results

90

5.1.4 Summary

Two PCBs, ready for manufacturing have been designed during this project. IDS microchip which is the RFID-chip developing company has looked at the schematics and the PCB design and believes that it looks good. To be a finished product of course the hardware needs to be tested. Even though the design looks good and is good in theory there might be some unexpected errors.

When the different modules are connected everything works fine together. Because the PCB design is connected exactly the same it should also work in the same way. What could cause a problem are the RF transmission lines, otherwise everything is pretty much straight forward.

Page 93: Handheld RFID reader_JH_EN_08_07_20

Results

91

5.2 Software

Since a prototype wasn’t produced the software design wasn’t ported and tested in the designated ATmega 64(L) micro processor, it is still being used in the ATmega 16 processor together with the other modules described in chapter 4.1.

5.2.1 ATmega 16 code

In General the code functions properly and can control the design to read tags and send Tag IDs to the mobile phone. The ATmega 16 code implements three Ringbuffers, one for receiving data from the Bluetooth module, one for storing data to send to the Bluetooth module and one for storing Tag IDs. For communication with the Bluetooth module it uses a UART module and for communication with the IDS RFID chip it uses a 1 byte wide synchronous parallel communication. A hardware timer with a software timer function was implemented for relative timing with a resolution of 100 ms. The code also utilizes a built in watchdog in the processor that resets the processor if it “hangs” itself i.e. gets stuck in an endless loop. The whole code is written in C except for the Ring buffers which are implemented in C++. The software program uses approximately 92.4% of the available 16K words flash memory and 86.6% of the available 1Kbyte SRAM of the micro processor. This first version of the software code have been limited by the lack of SRAM, and the design is limited to only hold 5 Tag IDs in its memory before overwriting old Tag IDs. Every Tag reading session is a single inventory round and the Mobireader will read tags multiple times in different Tag reading sessions, because the software does not filter out multiple readings of one tag. This means that the receiving database will be transferred with the same tag id multiple times.

5.2.2 Mobile phone Java code

The Java code was finalized using two run able threads, one running the main program and one running the communication links and two instantiated objects. The instantiated objects include code for creating connections for the Bluetooth and the GPRS links. The threads and the objects have proved to function properly on their own but due to lack of time the project hasn’t been completed as a whole. The program was used on a Sony Ericsson K800i and the different parts functions properly. The communication links has proven to work and a handshaking protocol is used when communicating with the Bluetooth and the GPRS. The mobile phone stores incoming Tag IDs and forwards them to a server on internet when a GPRS connection is available. The program is semi-automatic and needs it’s user to press buttons to create GPRS and Bluetooth connections.

Page 94: Handheld RFID reader_JH_EN_08_07_20

Conclusion and discussion

92

6 Conclusion and discussion As mentioned in the results, implementing a custom Patch antenna is far too time-consuming and complicated. Antennas and RF are both very complex areas of electronics. An ordinary omni directional chip antenna was used in the PCB design instead, radiating equally in all directions. This type of antenna is not ideal in this application. If the reader is compared with an ordinary bar code reader it is desirable to have directivity in the antenna. If there is no directivity there is no clue to where or what was read if the reader is used inside a room with many tags. In software it can for example be added a program that only reads tags that have at least a certain RSSI value. Using a patch antenna in combination with this software code would make sure that the reader only read what it’s pointed at. Implementation of a patch antenna is a project that goes beyond this thesis. Standard patch antennas designed for 865MHz are far too big for the application. Using a patch antenna should provide a reading distance of 0.75m compared to an omni-directional antenna providing only 0.35m. 0.35m is sufficient for this project reader but of course 0.75m is desired.

Designing PCBs for RF is tricky; one cannot just draw the lines. To get the desired functionality one must first of all consider how to design for RF. Even though one have considered all the designing issues it is not certain that it works properly anyway. One must do rigorous tests on the device, then re-design and try again. If one is lucky the device runs perfectly on the first attempt.

Because no PCBs were manufactured, it cannot be said how well the design will work in practice. What is known is that the schematics and PCB design are approved by IDS-microchip. Much of the design around the IDS-R900G is taken directly from IDS’s own design and is therefore proven to work.

The different modules were connected together and the whole system was run. All the wireless communications has proven to work. A tag could be read, the tag id transferred further to the Bluetooth device, the id transferred to the mobile phone and then to a server on Internet.

Further improvement of the reader could be improving all the different parts. For instance, tune the reading distance or choose a better antenna. To the software it can also be added more functionality such as the “tag search mode”. The software defiantly needs to be ported to a microprocessor with larger flash memory and more SRAM, since future upgrades of the code will probably be larger and the fact that one would want more than five Tag IDs maximum in the memory. The user interface can be improved a lot for example by adding a display. Regarding the mobile phone Java code, it needs some future work to be completely functional as a whole.

Page 95: Handheld RFID reader_JH_EN_08_07_20

References

93

7 References [1] Finkenzeller Klaus, “RFID Handbook, Second Edition”

John Wiley & sons Ltd, 2003, ISBN 0-470-84402-7.

[2] Chang Kai, “Handbook of RF/microwave components and engineering” John Wiley & sons Ltd, 2003, ISBN 0-471-39046-9.

[3] Ahlin Lars, Zander Jens, “Principles of Wireless Communications” Studentlitteratur, Lund, 1998, ISBN 91-44-00762-0

[4] Committee on Radio Frequency Identification Technologies(CB). “Radio Frequency Identification Technologies: A Workshop Summary” Washington, DC, USA: National Academies Press, 2004. http://site.ebrary.com/lib/jonhh/Doc?id=10075674&ppg=20

[5] Short Description of Bluetooth (2004) http://www.swedetrack.com/usblue1.htm#6 (Acc. 2007-12-01)

[6] Java (programming language), From Wikipedia, the free encyclopedia. http://en.wikipedia.org/wiki/Java_(programming_language) (Acc. 2007-12-09)

[7] André N. Klingsheim, “J2ME Bluetooth programming” M.S thesis, University of Bergen, Norway, 2004. http://www.ub.uib.no/elpub/2004/h/413009/Masteroppgave.pdf (Acc. 2007-12-13)

[8] EPCglobal Inc, “EPC™ Radio-Frequency Identity Protocols Class-1 Generation-2 UHF RFID Protocol for Communications at 860 MHz – 960 MHz Version 1.0.9”, 2005.

[9] RFID, From Wikipedia, the free encyclopedia. http://en.wikipedia.org/wiki/Rfid (Acc.2008-03-04)

[10] RFID-Handbook “Frequencies for RFID systems” http://www.rfid-handbook.com/rfid/frequencies.html (Acc.2008-05-07)

[11] Li Sing, Knudsen Jonathan, ”Beginning J2ME platform : from novice to professional” Apress, 2005.

Page 96: Handheld RFID reader_JH_EN_08_07_20

Search Words

94

8 Search Words A

Antenna .....................................32, 68, 85, 101

B

Bluetooth 11, 12, 13, 18, 33, 34, 35, 36, 37, 39, 40, 49, 51, 61, 63, 64, 67, 70, 71, 75, 76, 77, 83, 85, 91, 92, 93, 101, 102

C

C/C++ ................................................12, 62, 91 Circulator...................................33, 54, 86, 101 Communication ...16, 18, 37, 47, 49, 77, 83, 84

G

GPRS...9, 11, 12, 13, 36, 39, 63, 76, 77, 83, 91

J

Java ......... 12, 13, 61, 62, 63, 71, 76, 91, 92, 93

M

Micro Controller Processor .. 40, 61, 62, 68, 70, 71, 75, 83, 91

P

PCB.... 9, 12, 13, 14, 15, 27, 28, 37, 39, 41, 44, 49, 53, 61, 64, 65, 66, 68, 85, 86, 90, 92, 101, 102

R

RFID .. 9, 10, 11, 12, 13, 18, 19, 22, 23, 26, 31, 39, 40, 45, 47, 64, 68, 70, 75, 90, 91, 93, 101

Page 97: Handheld RFID reader_JH_EN_08_07_20

Appendix

95

9 Appendix

9.1 Appendix A: Circuit Diagram Mobireader Power Supply Board

Page 98: Handheld RFID reader_JH_EN_08_07_20

Appendix

96

Page 99: Handheld RFID reader_JH_EN_08_07_20

Appendix

97

9.2 Appendix B: Circuit Diagram MobiReader Main Board

Page 100: Handheld RFID reader_JH_EN_08_07_20

Appendix

98

Page 101: Handheld RFID reader_JH_EN_08_07_20

Appendix

99

Page 102: Handheld RFID reader_JH_EN_08_07_20

Appendix

100

Page 103: Handheld RFID reader_JH_EN_08_07_20

Appendix

101

9.3 Appendix C: PCB layout MobiReader Main Board

1. Bluetooth module 2. IDS RFID chip 3. Transformer 4. Receive section 5. Transmit section 6. Circulator 7. Antenna 8. Crystal 20MHz 9. ATmega64(L) micro controller 10. Interconnector

Page 104: Handheld RFID reader_JH_EN_08_07_20

Appendix

102

9.4 Appendix D: PCB layout MobiReader Power Supply Board

1. Free space left open for Bluetooth antenna. 2. Power supply to main board. 3. Connector between supply board and main board. 4. IRF7301 dual transistors. 5. MAX863 dual step up device. 6. Metal strip resistors. 7. Connector for buttons. 8. Piezo buzzer. 9. SPI interface. 10. Power supply connector for display. 11. LEDs.