Low Cost Penguin RFID Reader with GSM Uplink by Jason Ryan Manley Submitted to the Department of Electrical Engineering in partial fulfillment of the requirements for the degree of Bachelor of Science in Electrical Engineering at the University of Cape Town October 2006 Advisor: Dr.
Abstract This project designs and implements an electronic system for automatically logging the movements of penguins on Robben Island using RFID and GSM technologies. The design is systematic, from ground-level upwards. We discuss the shortfalls of an existing system which is in place on the island for this purpose and propose possible solutions.
Acknowledgements The author would like to acknowledge contributions from the following individuals: Dr Andrew Wilkinson as supervisor, for always taking the time to address the author’s concerns and for providing the required equipment to design, construct and evaluate the system; Mr Andrew Markham for his guidance through this project. His remarkable insight through the design phases and assistance during the documentation phases were of great value to the author.
Declaration This document and all of its contents represent my own work unless otherwise stated. I acknowledge that all contributions made by others have been cited and referenced using the IEEE referencing convention. I have not, and will never allow this work to be copied by anyone with the intention of submitting it as their own work. Furthermore, I acknowledge that plagiarism is wrong and declare that this project represents my own work.
Contents 1 Introduction 1.1 Terms of Reference . . . . . . . . . . 1.2 Objectives and Deliverables . . . . . 1.3 Project Timeframe . . . . . . . . . . 1.4 Project Background and Justification 1.5 Project Challenges . . . . . . . . . . 1.6 Report Structure . . . . . . . . . . . 2 Analysis of Existing Solution 2.1 Animal Detection and Identification 2.2 Power Supply . . . . . . . . . . . . 2.3 Data Processing and Storage . . . . 2.4 Data Delivery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CONTENTS 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.1.2 Active versus Passive Systems . . . . . . . . . 5.1.3 Operating Frequency . . . . . . . . . . . . . . 5.1.4 Modulation and Encoding Schemes . . . . . . Selection of the RFID system . . . . . . . . . . . . . Transponder Data Format and Protocol . . . . . . . 5.3.1 64 Data Bits . . . . . . . . . . . . . . . . . . . 5.3.2 CRC Verification . . . . . . . . . . . . . . . . Hardware . . . . . . . . . . . . . . . . . . . . . . . . 5.4.
CONTENTS 6.3 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7 Uplink Design 7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Design Options . . . . . . . . . . . . . . . . . . . . . . 7.2.1 Uplink Options . . . . . . . . . . . . . . . . . . 7.2.2 Peripheral Interconnect Options . . . . . . . . . 7.3 Hardware Design . . . . . . . . . . . . . . . . . . . . . 7.3.1 GSM Module . . . . . . . . . . . . . . . . . . . 7.3.2 Processor . . . . . . . . . . . . . . . . .
CONTENTS 8.4 Battery Selection and Charging 8.4.1 Hardware . . . . . . . . 8.4.2 Software . . . . . . . . . 8.5 Measurements . . . . . . . . . . 8.5.1 Power Supply Efficiency 8.5.2 Calculated Backup Time 8.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
List of Figures 1.1 Penguins’ moulting season on Robben Island . . . . . . . . . . 1.2 Penguin nest on Robben Island . . . . . . . . . . . . . . . . . 1.3 Penguins at SANCCOB showing steel identifier tags. . . . . . 2.1 2.2 2.3 4 5 6 Existing system: Overview . . . . . . . . . . . . . . . . . . . . 9 Existing system: close-up of the gate . . . . . . . . . . . . . . 10 Existing system: Power supply and backup system . . . . . . . 11 4.1 Overview of proposed replacement system . . . . . . . . . . . 17 4.
LIST OF FIGURES 7.1 7.2 7.3 7.4 Block diagram of uplink module’s hardware interconnect I 2 C master to slave multi-byte data exchange . . . . . . I 2 C slave to master multi-byte data exchange . . . . . . I 2 C protocol used in uplink module . . . . . . . . . . . . . . . . . . . . . . . . 68 74 74 75 8.1 8.2 8.3 8.4 8.5 8.6 8.7 DC rail output of SMPS. . . . . . . . . . . . . . . . Circuit diagram of switching DC-DC converter . . . Battery SOC vs Open circuit voltage. . . . . . . . .
List of Tables 5.1 5.2 5.3 5.4 5.5 Active vs Passive Tags . . . . . . . . . . . . . . . . . . . . . . ISO 11784 64bit Transponder ID data fields. . . . . . . . . . . CRC-16: Probabilities of errors occurring and being detected. Summary of considered microprocessors’ features . . . . . . . Microprocessor peripheral allocations during capture . . . . . 25 29 30 41 46 6.1 RFID co-ordinator: record storage . . . . . . . . . . . . . . . . 61 8.1 Power requirements of the uplink module. . . . . . . . . . . .
Glossary ADC Analogue to Digital Converter. In the context of this project, one of the microprocessor’s on-board peripherals. APN Access Point Name. Required for GPRS PDP context configuration. ASCII American Standard Code for Information Interchange. Standard referring to the binary representation of alphanumerical characters and control codes for the purposes of electronic communication. ASIC Application Specific Integrated Circuit.
LIST OF TABLES FIFO First In, First Out. Term used to describe a buffering technique whereby the data which was first buffered is also the first to be replaced by fresh data. GPRS General Packet Radio Service. 2.5G GSM mobile phone technology allowing packet-based data communication. GSM Global System for Mobile Communications. International standard for mobile telecommunications. This is the standard for cell-phones in South Africa.
LIST OF TABLES used to as a temporary store for variables. It is usually volatile in nature. Reader Term used to describe a device which is able to read/write to an RFID transponder. Used interchangeably with the term “interrogator.” RFID Radio Frequency Identification. A technology allowing objects to be marked (or tagged ) with small electronic identifiers which can be detected wirelessly using radio-frequency waves. SIM card Subscriber Identity Module.
Chapter 1 Introduction This project discusses the design and construction of a device for logging the times and movements of the Robben Island penguin colony. It is completed in partial fulfilment of a Bachelor of Science degree in Electrical Engineering at the University of Cape Town during the second half of 2006. 1.1 Terms of Reference This project is an evolution of an existing system in place on Robben Island to track the penguin population’s movements to and from the island.
1.2. OBJECTIVES AND DELIVERABLES along various paths on the island to better track their comings and goings on the island. 1.2 Objectives and Deliverables The objectives of this project are to design, construct and evaluate a replacement system capable of detecting the movements of penguins on Robben Island. The following goals are expected to be achieved: • Critically review the existing solution and identify all of its shortcomings. • Suggest a device specification which solves these problems.
1.4. PROJECT BACKGROUND AND JUSTIFICATION 1.4 Project Background and Justification Once a year (between November and December), penguins come to Robben Island1 to moult. They move in groups numbering in the hundreds around the beaches (as shown in Figure 1.1), with the entire colony numbering in the thousands. Robben Island is also a nesting home for many of these birds. Nests are established off the beach, under trees and shrubs as shown in Figure 1.2.
1.5. PROJECT CHALLENGES Figure 1.2: Penguin nest on Robben Island We believe that a solution can be found using RFID technology. Identification tags are small enough to be embedded under the birds’ skins and are light enough not to hamper movements. A system is then required which automates the monitoring process. This project aims to fulfil that need.
1.5. PROJECT CHALLENGES Figure 1.3: Penguins at SANCCOB showing steel identifier tags. These tags are non-electronic. Picture courtesy of Simon Katz. Remote Operation It is inconvenient and costly to have to visit the device for maintenance. It should thus be fully autonomous: self-sustaining and self-diagnosing. Remote administration and reconfiguration would be a significant advantage.
1.6. REPORT STRUCTURE Environmental considerations The environment where the devices will operate is harsh; physical construction requires special attention to corrosionresistant materials and weather-proof enclosures. The devices will operate in the presence of sea air, rain, sun and thunderstorms. Ambient temperatures can range from less than 10◦ C at night to over 35◦ C in the shade during the day and wind speeds can be in excess of 50km/h. 1.
Chapter 2 Analysis of Existing Solution There is already a system in place which logs the birds’ movements, however, there are problems associated with its implementation. The existing installation on Robben Island was inspected in July 2006 in order for us to obtain a better understanding of the conditions under which the device must operate. This chapter will discuss the existing system and examine its strengths and weaknesses with the goal of improving its design.
2.1. ANIMAL DETECTION AND IDENTIFICATION Figure 2.1: Existing system: Overview The second infra-red beam is interrupted as the bird leaves the gate. This second trigger resets the system ready to scan for the next bird. Based on the order of the beam triggering, the system can determine the direction that the bird was moving (landwards or seawards).
2.2. POWER SUPPLY Figure 2.2: Existing system: close-up of the gate showing the Texas Instruments Series 2000 “small” loop antenna and the two infra-red beam detectors. 2.2 Power Supply The unit is powered from the 230V AC mains generator which is located on the island. Battery backup is in the form of a commercial 230V AC Uninterruptable Power Supply (UPS) which is housed in a separate enclosure from the RFID reader due to its size.
2.3. DATA PROCESSING AND STORAGE Figure 2.3: Existing system: Power supply and backup system • The backup system consumes much more space than it needs to. • Excessive heat is generated in the non-ventilated enclosure. • Reliance on the mains AC power source has prevented the system from being moved to a more useful location where there is no power outlet. • The backup system is expensive to purchase and operate. 2.
2.4. DATA DELIVERY Markham modified this original system by replacing the desktop computer with a microprocessor which logs the data in the its on-board non-volatile “flash” memory. Unfortunately, due to limited capacity, the birds’ entire identification number is not stored, but rather only an eight bit identifier and a lookup table. The total number of birds is thus limited to 256.
Chapter 3 Device Specification Having reviewed the operation of the existing solution and identified its shortcomings, this chapter aims to produce a design specification for the replacement system. The following are desirable features for the replacement: Reliable The system should consistently detect and record the passing of animals. Autonomous User intervention should not be required on a day-to-day basis.
Low cost hardware It would be advantageous to install additional devices on the island to better track the animals’ movements. This will not be possible if the device is expensive to construct. User-friendly The end-users will not be electrical engineers and so the operation of the device should not require in-depth understanding of the technologies employed. The device should have a familiar feel with collected data presented logically.
Unobtrusive The device will be installed in a national heritage site. It should not damage the aesthetics of the environment, nor should it intrude on the penguins’ daily lives. Safe The device should be safe for the animals and human operators. License-free In order to keep costs down and simplify installations, operation of the device should not require special permits or licenses.
Chapter 4 Overview of Proposed Solution 4.1 Introduction This chapter discusses the overall design methodology and illustrates the operation of the proposed system as a whole. Although RFID systems have been used to track animals before [3], this particular application is somewhat different as it is required to be fully autonomous and low-cost. For this reason, the system is designed from the ground-up, using generic, off-the-shelf components as far as possible. The solution is highly modular.
4.2. RFID DETECTOR, IDENTIFIER AND CO-ORDINATOR sections in this report where the design detail for that component may be found. A brief overview of the modules is presented in the following subsections. Figure 4.1: Overview of proposed replacement system 4.2 RFID Detector, Identifier and Co-ordinator The existing detection technique does not produce reliable data due to the double-trigger effect outlined in Section 2.1.
4.3. UPLINK MODULE Figure 4.2: System overview: Logical connections Including the chapters where the component design is discussed. Based on the ordering of the detection, the system is able to determine the direction of movement (gate one to gate two, or gate two to gate one). For every such “double detection” (where the ID was detected at both gates), the co-ordinator creates a data record, storing the ID of the transponder and the direction of movement.
4.4. INTERCONNECTIONS be found in Section 7. 4.4 Interconnections The RFID and uplink modules will need to communicate with each other. As they will not be far from each other and data rates are low, but power consumption and system costs are concerns, a simple wired communication bus is suitable. There are two primary communication zones: 1. Between the RFID co-ordinator and the two RFID modules; and 2.
Chapter 5 RFID Reader Design The following subsections give a brief overview of RFID systems, their strengths and weaknesses and suitability for this project. Thereafter, the design of an independent RFID reader is discussed. Recall that two such units and a coordinator are required for the penguin detection and identification subsystem. The design of the co-ordinator is discussed in Chapter 6. 5.
5.1. INTRODUCTION • ROM memory, often EEPROM • Power supply (in the case of active tags); 2. Receiver • Antenna • Analogue interface circuitry • Digital controlling circuitry • Power supply; 3. User-application, data handling hardware and software. Transponders Tags are available “off-the-shelf” in many shapes and sizes to fit most applications, including application-specific, specialist tags from electronic companies such as Texas Instruments for automotive use and for animal tagging.
5.1. INTRODUCTION have short read ranges of only a few centimetres [5]. Fixed installations often have higher power outputs and larger antennae with increased field sizes for improved reliability and range. More exotic solutions include multiple antennae for reading specific areas or dedicated, independent transmit/receive antennae. Antennae Different antennae provide different read-field shapes. These can be tailored to suit the application.
5.1. INTRODUCTION Figure 5.1: Popular Texas Instruments Series 2000 Antennas Full duplex systems do not require the tags to be charged before transmitting their ID signature. As long as an interrogation signal is received, the tags will transmit their ID code. Full duplex tags can thus be thought of as reflectors they reflect a received signal while modulating it with their own data stream. This is known as backscattering.
5.1. INTRODUCTION enter the reading field. Passive devices typically offer limited user-programmable data storage capacity of less than 128 bytes, and often none at all. This is the case for several reasons, but most importantly because of power restrictions. Passive tags do not have on-board power supplies and most of the power collected is used for transmission rather than memory reading or writing. Active RFID Active tags have an on-board power source, usually in the form of a battery.
5.1. INTRODUCTION Tag power source Memory capacity Cost Range RF field power Efficiency Read speed Multiple tags Lifespan Tag size Passive External RF field Less than 128B Low Short (up to 3m) High Low Slow Poor, slow, unreliable Long Active Self-contained(battery) Over 128kB High Long (up to 100m) Low High Fast Fast, reliable Limited by power supply Limited by antenna Limited by antenna size and power source Table 5.1: Active vs Passive Tags and flesh.
5.2. SELECTION OF THE RFID SYSTEM 5.2 Selection of the RFID system When selecting the RFID system for the island, it is important to consider the cost of replacing the existing system. The choice to use an active or passive system ultimately requires the integrator to decide what the lifespans of the tags are expected to be: how many read/write cycles and over what period.
5.3. TRANSPONDER DATA FORMAT AND PROTOCOL bands are detrimental to the penguins. The newwer electronic system already in place is ISO 11784/85 compliant and the replacement system needs to be backward-compatible with existing tags. Since these tags are sealed passive units, they are expected to outlast the lifetimes of the birds. The devices on offer in TI’s Series 2000 for animal tagging includes 24mm and 32mm glass capsules. These tags are available in Read-Write or ReadOnly models. Figure 5.
5.3. TRANSPONDER DATA FORMAT AND PROTOCOL If the transponder’s capacitor has been sufficiently charged, it immediately begins transmitting after detecting the termination of the charge signal. This signal is in the form of non-encoded (raw) binary frequency shift keyed (BFSK) sequence of 128bits. Figure 5.3 illustrates the data frame format. Figure 5.3: 64bit Read-Only transponder data format, from [1] The start byte is used to identify the type of transponder.
5.3. TRANSPONDER DATA FORMAT AND PROTOCOL will be able to determine that at least one penguin was within range. The antennas and gates thus need to be carefully designed to ensure that only one penguin is within range at a time. 5.3.1 64 Data Bits The 64 identification bits are subdivided into five fields to identify the type of tagged item. These data fields are also defined in ISO11784/85 as shown in Table 5.
5.4. HARDWARE Error Type Single bit errors Double bit errors Odd-numbered errors Burst errors (<16bits) Burst errors of exactly 17bits All other burst errors Errors Detected 100% 100% 100% 100% 99.9969% 99.9984% Table 5.3: CRC-16: Probabilities of errors occurring and being detected. Data from [12]. 5.4 Hardware Various designs were considered for the RFID readers, with details provided in the sections below. All designs were constructed on “bread-board” type prototyping platforms for evaluation.
5.4. HARDWARE accommodate the RFID readers (all other system components require 5V or less). The potential differences across the antenna terminals are expected to reach into the hundreds of volts due to the high Q tuned antenna design. This a safety concern and requires careful circuit planning and component selection. When considering the detector for the RFID reader, it is important to remember that the bit length of the received signal is only 16 cycles long.
5.4. HARDWARE Figure 5.4: Overview of proposed microprocessor-based RFID reader heat would be dissipated in the power output devices as they linearly convert the 12V supply into a sine wave (a class A or B amplifier). Furthermore, generation of a pure tone is difficult and requires additional components. Since the reader already requires a microprocessor for decoding the received signal, we decided to generate the charging pulse using one of the processor’s on-board timer peripherals.
5.4. HARDWARE in turn drive the MOSFET. Figure 5.5 shows a circuit diagram illustrating the operation of the antenna driving circuitry: Figure 5.5: RFID antenna driver circuitry for single ended output Performance of this circuit can be improved by replacing the output stage with a push-pull design as shown in Figure 5.6.
5.4. HARDWARE Figure 5.6: RFID antenna driver circuitry using push-pull output stage resonant circuit, tuned to 130kHz. Thereafter, the signal is again amplified into saturation to provide a 5V logic level square-wave representation of the received signal. Based on the width of the pulses, the frequency of the signal can be determined (see Section 5.5 for details of this calculation).
5.4. HARDWARE stage is AC coupled to the previous one to prevent DC bias offsets from being amplified. Low value resistors are used to prevent noise from being captured and amplified and to limit the possibility of the circuit breaking into oscillation. The op-amps are thus not operated at high gains. The initial design places the first two op-amps in series to provide a combined gain of 100 times (10 times each).
5.4. HARDWARE Figure 5.
5.4. HARDWARE stick antennae placed in a vertical orientation. Figure 5.9 illustrates the read fields generated by the two antenna designs in both horizontal and vertical orientations, with the transponders assumed to be vertical. It represents a top-down view of a typical penguin path. The coloured zones represent the read fields assuming that the transponders are of the 32mm glass variety (ie with ferrite stick antennae) and pass the receiver in a vertical orientation. Figure 5.
5.4. HARDWARE Figure 5.9: Detection of penguins with various antennae. Horizontal and vertical orientations are considered.
5.4. HARDWARE Since the Series 2000 tags do not allow for the reading of multiple tags simultaneously, both reads will fail and no penguin will be detected. Case three illustrates a gate antenna in a vertical orientation. The read is successful provided that the tags are at a similar height to one of the horizontal members of the antenna (ie the top or bottom edge). A dead zone exists in the centre of the antenna. The final case illustrates a gate antenna placed horizontally.
5.4. HARDWARE result in a high received voltage at the transponder. As outlined in Section 5.6, the number of turns on the antenna had very little influence on the receiver’s performance: if a receiving antenna with a few turns is used, the receiver chain’s gain is simply increased to compensate and produce similar results. What is of consequence is the transmitter’s inductance: it should remain low enough to pass a significant current at 132.4kHz during the charging phase from a 12V supply.
5.4. HARDWARE square-wave edges. An on-board RS232 interface will be used to transmit the decoded data to the RFID co-ordinator. Included in all designs is an In-Circuit Debugging (ICD) interface for in-field debugging and reprogramming.
5.4. HARDWARE samples5 . Thus, a faster device, or one with more memory was required. Mr Andrew Markham recommended Microchip’s PIC 18F series and although we had no experience with these devices, they had been successfully used in upgrading the existing system on the island. Second design based on PIC 18F452 The PIC 18F452 has an on-board divide by four counter as part of its Capture, Compare, PWM (CCP) peripheral. With 1.
5.4. HARDWARE channel cannot be allowed to reset the timer upon receipt of an edge as it would interfere with the results of the second channel), each read will need to be 16bits long rather than 8bits in order to accommodate a 20ms capture with sufficient resolution for reliable bit differentiation. Thus, in total four times the RAM is required to add an additional channel. The PIC 18F452 only has 1.5kB of RAM, which is insufficient.
5.5. SOFTWARE Please see appendix A.1 for a complete circuit diagram and PCB layout of a push-pull output, single receiver channel interrogator (with no tuned receiver filter) and appendix A.1 for a single-ended output, dual-channel receiver interrogator. 5.5 Software The development environment used for the PIC 18F series is provided by the manufacturer, Microchip’s MPLAB v7.4 with the C18 C-compiler.
5.5. SOFTWARE generation of these signals (since they can be muxed together to produce outof-phase waveforms), they were reserved for receive channels. Furthermore, it is trivial to implement the transmit waveform generation in software. In order to achieve the required charging period (50ms or even 100ms), one of the microprocessor’s timer peripherals were used. Timer0 was chosen as it is independent from any other device operation (such as the capture peripheral which uses Timer3 - see Section 5.5.2).
5.5. SOFTWARE Peripheral CCP1 Timer0 Timer3 Function Generate interrupt on every fourth edge Implement timeout (20ms) Elapsed time between CCP interrupts (coupled to CCP module) Table 5.5: Microprocessor peripheral allocations during capture an interrupt on every fourth rising edge. When this occurs, the CCP ISR stores the value in Timer3’s counter in an array for later processing. Timer3 is then reset in order to time the period to the next fourth edge.
5.5. SOFTWARE Figure 5.
5.5. SOFTWARE 5.5.3 Decode Stage Figure 5.10 shows a simplified flowchart of the decoding stage. Decoding begins by looking for a start byte. The Read-Only tags employed in this system have a start byte of 0x7E, or binary 01111110. All bits prior to the start byte are 0. If it is known that all tags are of this RO variety, it is a simple case to look for the first occurrence of a “1” bit in the incoming stream.
5.5. SOFTWARE Figure 5.11: CRC verification flowchart 3. No tag detected within read range All responses are sent across RS232 in plain ASCII followed by a carriage return character. In the first case, the response is of the form: OK: XX XX XX XX XX XX XX XX CRC: YY YY where XX represents the tag ID in hexadecimal from MSB to LSB and YY represents the BCC also in hexadecimal form, MSB first. In the second case, data was received, but it could not be verified.
5.6. DESIGN EVALUATION No tag found. This response is also possible if the antenna becomes open loop or an internal circuit fault exists. 5.6 5.6.1 Design Evaluation Transmitter Recall that 134.2kHz is not directly obtainable from the 8MHz crystal employed. Thus, a form of direct digital synthesis (DDS) is used. By generating a 133.33kHz signal for two cycles followed by a 135.59kHz signal on every third cycle, an average frequency of 134.09kHz is achieved. Figure 5.
5.6. DESIGN EVALUATION Figure 5.12: FFT of the 134.2kHz transmitted waveform. Centre frequency of the image is 127kHz with a span of 50kHz. Notice the strong peak at 134.2kHz 129kHz. This limits the maximum “Q” to approximately 117 . Figure 5.13 shows the received waveform from a tag with a well-tuned antenna. Notice, however, that one of the received frequencies is still favoured. Temperature changes greatly affected the tuned centre frequency.
5.6. DESIGN EVALUATION Figure 5.13: Received waveform from an RFID transponder the claims made in the article. Maximum read range was approximately 100mm when using a single antenna as a transmitter and a receiver. Large Single Square 400µH Loop The performance of this antenna ( 280mm x 240mm) was similar to the small round loop mentioned above, with one exception: although the maximum read range remained at approximately 100mm, the area over which the system worked was greatly improved.
5.6. DESIGN EVALUATION clear that in order to achieve additional range, the receiver chain must be optimised. 5.6.3 Reader Range and Optimisation With the single-ended output stage, the range is limited by the charging phase. At further distances, the tag does not become sufficiently charged to fully transmit all 64 data bits and 16 BCC bits.
5.7. CONCLUSION AND RECOMMENDATIONS 5.6.4 Power Consumption The push-pull RFID reader consumes 420mA (at 12.5V) when transmitting and the logic consumes 50mA (at 5V) when transmitting, receiving or idling. Thus, transmitting requires approximately 5.5 Watts and the device consumes a quiescent power of 0.25 Watts. Tuning of the antenna is crucial to efficient power usage. The device consumes excessive amounts of power if the antenna or transformer are incorrectly tuned. Decoding can require up to 250ms.
5.8. IMPROVEMENTS AND FURTHER WORK The reader should be well shielded and the area of operation should not contain switching devices in these frequency bands. • Transponder and antenna relative orientations are critical. All transponders should be installed in a uniform direction. When installing the readers, it is important to consider the chosen transponder orientation and mount the antenna accordingly. Further details can be found in Sections 5.4.4 and 5.6.2.
5.8. IMPROVEMENTS AND FURTHER WORK to be connected, either in a different orientation or in another location. This has the potential to decrease system costs (by using only one processor where two were previously required), improve reliability (by orienting the two receivers differently in the same location, additional transponder orientations are accommodated) and improve efficiency (a single charge pulse can be used for both receivers at a reader station whereas otherwise, two would be required).
Chapter 6 RFID Co-ordinator The co-ordinator device acts as an intermediary between the RFID readers and the uplink module. It must thus be able to communicate on two different buses. The following sections discuss the hardware and software design of this component. 6.1 Hardware The hardware consists of a single microprocessor with interconnects to the adjacent devices (RFID readers and uplink module).
6.2. SOFTWARE does not need to be fast and an RS232 standardised communication speed of 9600bps with eight data bits, no parity and one stop bit is used. The link from the co-ordinator to the uplink module is in the form of an I 2 C bus as outlined in Section 7.2.2. The reasons for this decision were largely motivated by device flexibility and simplicity. Please see that section for further motivation.
6.2. SOFTWARE 2. RFID reader 3. Received data processor 4. Upload data preparation 6.2.1 Timers The Timer FSM can be in one of three states: either “stopped”, “running” or “timed out”. The on-board peripheral Timer0 features an eight bit prescaler (maximum of 256) and operates from the bus clock (in this case the 8MHz crystal ÷ 4 giving a 2MHz clock). Thus, a maximum period of a little over eight seconds is achievable when using the timer in 16 bit mode.
6.2. SOFTWARE Figure 6.1: Global timer flowchart In one of the two trigger states, a general purpose IO pin is pulled high to trigger the connected RFID reader. The system timer is then started (based around Timer0) and the reader FSM’s state changed to “Awaiting”. It is then up to the received data processor to capture the response from the reader and change the FSM to the next state.
6.2. SOFTWARE the buffer and compared to entries in an array of records with the data components as outlined in table 6.1. Size (bits) Name 8 Status 16 64 Elapsed time Data Contents Record State: Clear; Record timed out; Requested RFID 0 or 1; Tag moved in direction 0-1, or 1-0 Stores time elapsed since initial trigger Stores the 8 ID bytes of the tag Table 6.
6.3. EVALUATION indefinitely for this animal at the second gate, a time-out is implemented. If the animal does not trigger both gates within approximately 1 minute, the record is flushed and an error counter incremented for status reporting purposes. It is thus possible to determine how many penguins have not been successfully tracked. 6.2.
Chapter 7 Uplink Design 7.1 Introduction Having reviewed the system specification in Section 3, and considered the implementation of the proposed solution in Section 4, this chapter will discuss the design of the uplink module. The uplink module’s purpose is to collect the data from the tags and provide a means of uploading the data to the system operator.
7.2. DESIGN OPTIONS GSM and GPRS network coverage. Combined with TCP/IP, such a system offers the ability to upload the data to any device with internet connectivity. This attractive attribute makes it an ideal solution for the data link.
7.2. DESIGN OPTIONS at 50c per SMS, this would result in a monthly cost of R150 per month per station1 . Also, since this data would be in raw hex format, the SMSs would need to be interpreted by a receiver device to extract the data for processing. The cheapest GPRS data rate on a non-contract package is currently offered by Virgin Mobile at 50c per MB. Assuming the same conditions as the scenario outlined above, monthly data cost per node is less than R1.002 .
7.2. DESIGN OPTIONS Low power Communication should consume as little energy as possible to conserve battery life in backup conditions. Flexible It should be possible to add additional peripherals to the logger without requiring any hardware or software modifications. Simple protocol A simple protocol will ensure that it will be convenient to add additional peripherals. This will also aid debugging and ultimately make the system more reliable. Reliable Data transfer should not corrupt the transported data.
7.3. HARDWARE DESIGN standard for the bus would exist. A custom design was thus not an ideal solution. A CAN or RS485 system would require additional line driving circuitry or specialised microprocessors with on-board support. We would like to save costs and simplify the design wherever possible, so this is again not ideal. SPI is a simple full duplex protocol requiring three bus lines. No additional hardware is required as most microprocessors include an SPI-compatible peripheral.
7.3. HARDWARE DESIGN Figure 7.1: Block diagram of uplink module’s hardware interconnect to have local support for the unit as well as local stock (due to the limited development period which the final year project offers). Although our first choice would have been the Wavecom GR64 (due to it using standard 0.2” IDC board-to-board connector), the only module which was available immediately which used standard surface-mount connectors was the Telit GM862QUADPython.
7.3. HARDWARE DESIGN perform audio functions (such as microphone and hands-free connections) and links to peripherals such as cameras or additional SIM card holders. Of interest to us is the command interface, which is in the form of 2.8Vlevel RS232 signals. Thus, level shifters will be required on both serial lines to communicate with standard 5V logic. Although commercial ICs are available to perform this function, it can also be simply achieved by a pair of discrete transistors for each line.
7.3. HARDWARE DESIGN considering these attributes, it was considered it the ideal solution. The antenna is attached to the sides of the enclosure with double-sided tape. 7.3.2 Processor Selection Criteria When considering the system processor, the following features should be considered: Power Consumption In order to maximise battery life under mains power failure conditions, the chosen processor should support power saving modes and generally have a low power consumption.
7.3. HARDWARE DESIGN Real Time Clock There should be some means of timekeeping – be this in the form of a local real time clock or a dedicated IC to which the microprocessor interfaces. Processor Selection After completing the RFID subsystem, the author had experience with Microchip’s PIC 18F series of 8 bit microprocessors.
7.3. HARDWARE DESIGN Simple The operator should be presented with a clear, simple interface with the minimum number of buttons and displays. Easily understood Status indication should be intuitive, for example: a descriptive error message is more useful than a flashing general error light. Power efficient In order to maximise battery life, it is important that the status display not consume excessive power. Viewable in sunlight The device will be operating outdoors.
7.3. HARDWARE DESIGN 7.3.5 Peripheral Communication Bus The choice to use I 2 C as an interface bus to the uplink module greatly simplifies the hardware design. This bus is wired in a simple “AND” configuration with each peripheral implementing an open collector interface on each of the two lines – one for data (SDA) and another for clock (SCL). Each of the lines are held high by a pull-up resistor. Any device may thus pull either line low at any time.
7.3. HARDWARE DESIGN Figure 7.2: I 2 C master to slave multi-byte data exchange Diagram based on illustration from [19] An exchange from slave to master is similar, as illustrated in Figure 7.3. The I 2 C specification does not permit a slave to initiate a transfer 3 , and thus the master must request data from the slave device.
7.4. SOFTWARE DESIGN the master (the uplink module) to a slave (any attached peripheral), followed by nine data bytes from the slave to the master. It is assumed that the MSB will be a status indication and the remaining eight bytes are data. For the purposes of the RFID peripheral, the status byte represents the direction and speed of the bird and the remaining eight bytes will be used for the 64 bit ID. This exchange makes use of I 2 C’s repeated start facility and Figure 7.
7.4. SOFTWARE DESIGN The processor executes the following FSMs, where each FSM is stepped once per main loop cycle4 : 1. Status display update 2. Poll peripherals 3. Battery charging & system health monitoring(see Section 8.4.2) 4. I 2 C communication 5. Timer 6. Report generation 7. GSM, SMS & Email communication 8. Command & settings processing Prioritised interrupts are also used.
7.4. SOFTWARE DESIGN configuration, including GSM SIM card PIN number, the address of the SMTP server, GPRS configuration and details of attached peripherals. Refer to Appendix C for a complete list of stored data, their types, sizes and locations. These settings are restored upon initialisation and checked for consistency before the configuration is accepted. See Section 7.5 on reliability for further details. 7.4.
7.4. SOFTWARE DESIGN Although a library is provided with Microchip’s C18 compiler for controlling such LCD displays, we opted to write our own functions in order to include additional functionality. Input is in the form of a single push button. Pressing this button invokes the low priority ISR which registers the button press and begins the upload procedure. The GSM module is initialised as part of this process and SMS settings collected.
7.4. SOFTWARE DESIGN interrupt, thereby providing exactly one second delay between decrements. Once the timer value has decremented down to zero, it is time to poll that peripheral. This timer array is a 16 bit number and the maximum polling period is thus 65535 seconds (approximately 18 hours). The status array is checked to ensure that a poll is not currently already under way.
7.4. SOFTWARE DESIGN functions. As outlined in the hardware design section (Section 7.3.5), an exchange consists of one byte transmitted to the slave followed by nine bytes received. The I 2 C communication process has 24 possible states and is blocking.5 Once initiated (by changing into the “send start” state), the FSM runs to completion, be that because of a successful exchange or because of a time-out due to an error. This is the only blocking FSM in the uplink module.
7.4. SOFTWARE DESIGN the RTC’s interrupts (“timer s”). It uses an eight bit counter and thus has a maximum period of 256 seconds. Also provided is the ability to create blocking delays in the order of milliseconds, in the range of 0 - 65.5 seconds (“delay ms”). This uses hardware Timer0. All three timers operate independently and can be used in conjunction with one another. Timer ms is purely hardware based.
7.4. SOFTWARE DESIGN of approximately 50 possible states. Initialisation Ordinarily, the GSM state is “powered down”. Any software component may invoke the GSM unit by changing this state to “powering up”. At this point, the GSM FSM pulls the hardware power line high and continually sends the module a software reset command (“ATZ”) while waiting for a response. If no response is received within four seconds, then the power down sequence is begun.
7.4. SOFTWARE DESIGN Email In order to initiate an email send, the module must have successfully attached to the GPRS APN and obtained an IP address. Originally, it was proposed that the module’s on-board email client would be used for sending emails. This client works by buffering the entire email locally and then attempts the connection to the server to upload the mail. Unfortunately, the GM862 has limited buffering capacity and is not able to buffer more than a few hundred characters locally.
7.4. SOFTWARE DESIGN will await further instruction from the host application. SMS If the application requests an SMS check, the GSM FSM extracts a list of received SMSs from the module and stores the contents of the first SMS in a global array for processing by the host application. All received SMSs are then deleted from the module’s memory. Thus, if multiple SMSs are sent between checks, only the first one is read and processed. All subsequent SMSs are ignored. 7.4.
7.5. RELIABILITY 7.4.9 Command Processing and Device Configuration The command interface is in the form of a terminal window across RS232, or via a combination of SMS and email. The operator can configure the system by issuing commands such as set time 16:29:49 23/10/06, or, set email receiver joe smith@yourserver.com. Appendix C.2 lists all available commands.
7.5. RELIABILITY 7.5.1 Software Watchdog timer A watchdog timer resets the device should a software error occur, or the program get stuck in a loop. This operates as follows: the watchdog peripheral runs an independent timer which (under normal operating conditions) is periodically reset by software. If the timer were to overflow (for whatever reason) it automatically performs a hardware reset of the microprocessor.
7.5. RELIABILITY The presence and status of the power supply is also checked. If the battery is low and there is no mains power supply, the peripherals are not be started until the battery has sufficiently recharged to supply the required power (for example, the high current requirements of the GSM and RFID modules).
7.6. CONCLUSIONS AND POSSIBLE IMPROVEMENTS 7.6 Conclusions and Possible Improvements The uplink module performs as expected, meeting all device specifications and fulfilling all requirements. • Due to the modular software approach, it is possible to add or modify the system without a redesign. • Possible improvements include the ability to configure the device locally (without a computer or mobile phone) through an interactive menu system.
Chapter 8 Power Supply 8.1 Introduction Battery backup is required because of the poor reliability of the main power supply on the island. Furthermore, if the device is to be powered from a solar panel or wind generator, then the battery is required to sustain the device when these are unable to supply power (i.e. at night or in calm conditions). The battery backup is in the form of a 12V Sealed Lead Acid (SLA) battery.
8.3. REGULATOR SELECTION Device Voltage GSM Module 3.8V Microprocessor 5.0V LEDs 5.0V LCD display 5.0V LM35 Temp sensor 5.0V TOTAL POWER Ave Current 0.2% × 850mA 12mA b 1mA c 3mA max 130µA a Ave Power 1.7mW 60mW 5mW 15mW d 0.65mW 85mW Table 8.1: Power requirements of the uplink module. All values measured unless otherwise stated. a GSM module is usually idle. Assuming power-up time of two and a half minutes per day. b PIC 18F4620 5.0V operation at 8MHz HS oscillator enabled.
8.3. REGULATOR SELECTION Device RFID Co-ordinator Microprocessors & misc Logic Output antenna drivers TOTAL POWER Voltage 5.0V 5.0V 12.8V c Ave Current 50mA a 2×50mA b 2 × 20% × 420mA d Ave Power 250mW 500mW 2.2W 3W Table 8.2: Power requirements of the RFID subsystem. All values measured on prototype push-pull device. a Single PIC18F452 operating at 8MHz with HS oscillator enabled with two highefficiency LEDs.
8.3. REGULATOR SELECTION 8.3.2 ST Microelectronics’s L4976 ST Microelectronics’s L4976 devices operate at frequencies up to 300kHz and are capable of delivering currents in excess of 1A [21]. Also included are protection mechanisms for thermal overload, current limiting and protection against feedback disconnection. A further advantage is that they are offered in standard DIP8 packages, which aids prototyping in that they can be housed on standard breadboards.
8.3. REGULATOR SELECTION Figure 8.1: DC rail output of SMPS. • Adjustment in the size of the inductor - decrease from 260µH to 80µH to suit the new higher operating frequency. • Feedback resistor network was adjusted to provide the correct output voltages of 3.8V and 5.0V. Figure 8.2 is the schematic of the final DC-DC converter to power the logic circuits. Note that two such circuits are required: one 3.8V unit for the GSM module as outlined in Section 7.3.1 and a second for the 5V logic.
8.4. BATTERY SELECTION AND CHARGING Figure 8.2: Circuit diagram of switching DC-DC converter for the GSM module (3.8V). 8.4 8.4.1 Battery Selection and Charging Hardware Many secondary power sources were considered for the backup battery. The decision to use a sealed lead acid (SLA) battery is based on economic factors. As mentioned in Section 5.4, the RFID modules require a high voltage.
8.4. BATTERY SELECTION AND CHARGING determined based on the open circuit (or very light load) potential difference. This relationship is not linear, however and the measurements are temperature dependant. Higher temperatures give higher potentials for the same state of charge (SOC). Lower temperatures result in lower voltage readings and a decreased storage capacity [23]. At 0◦ C, only 85% of the battery’s rated capacity is available [24]. Figure 8.
8.4. BATTERY SELECTION AND CHARGING The charging of SLA batteries is well-understood and relatively simple: the battery should be charged with a constant voltage of 13.8V with current limiting of approximately 40% of the rated capacity in Amp. hours (Ah)[23]. Ideally, this threshold should be temperature compensated — lower temperatures require higher charge voltages. For example, Panasonic recommends that at 0◦ C, the battery is charged at 14.1V, but at 40◦ C, only 13.4V.
8.4. BATTERY SELECTION AND CHARGING considered is paralleling two or more such batteries to further boost backup time. Refer to Section 8.5 for power consumption figures and estimated battery lifetime. Figure 8.5 shows the circuit diagram of the battery charger. It consists of a full-bridge AC rectifier which is switched by a Darlington transistor, Q4, to charge the battery. This switching is performed by the same microprocessor that controls the GSM module.
8.4. BATTERY SELECTION AND CHARGING connected to PortA.RA4 on the GSM Logger’s Microprocessor. This is an open collector output with FET output. It is thus able to turn T9 off by pulling the base low when the battery is fully charged. Thus, should the battery be completely depleted, it would immediately begin charging until it is sufficiently charged for the microprocessor to power-up and regain charging control.
8.4. BATTERY SELECTION AND CHARGING Figure 8.6: finite state machine of charging algorithm.
8.5. MEASUREMENTS 8.5 8.5.1 Measurements Power Supply Efficiency The total efficiency of the converters is measured to be approximately 85% when the GSM module is powered. There is a further loss in the form of the 0.6V drop across the Darlington which switches the 12V battery supply to the 3.8V switching regulator. Recall that this is necessary to provide a soft-switching ability to the 3.8V line (which is only required when the GSM unit is to be powered).
8.6. CONCLUSION Figure 8.7: Discharge periods vs. discharge rates at various temperatures for a Panasonic LC-R127R2P 12V 7.2Ah SLA battery. Diagram from [24]. 8.6 Conclusion The power supply is highly efficient under normal operating conditions and is able to power the uplink module and RFID readers while still having reserve capacity to power additional peripherals should these wish to be added at a later date. The battery standby time is in the order of 24 hours with a single 7.
Chapter 9 Enclosure Selection and Mounting Methods This chapter will discuss the recommended methods for mounting the RFID antennae and housing the system components. 9.1 Initial Considerations • The device will operate outdoors, fully exposed to the elements. It is expected to operate in these conditions for extended periods of time, without maintenance. • Wind will affect the vertically positioned antennae if they are not sturdily mounted.
9.2. RECOMMENDATIONS 9.2 Recommendations Based on the aforementioned considerations, and the device specification as outlined in Section 3, the following recommendations are made in respect of device enclosures and antennae mounting methods: • The circuit-boards and batteries should be mounted in watertight, ABS plastic enclosures. Cables should enter the enclosure through holes cut just large enough for this purpose, and these should be sealed with a waterproofing sealant such as silicone.
9.2. RECOMMENDATIONS • The antennae windings can be sealed in epoxy to prevent corrosion of the copper wire. Careful attention must be paid to the connector between the antennae and the RF signal cables to ensure that they are watertight.
Chapter 10 South African Regulations The Telecommunications Act of 1996 stipulates “regulations in respect of use or possession of certain radio apparatus without a radio frequency spectrum licence, certificate, authority or permit.” These regulations were proposed by the Independent Communications Authority of South Africa (ICASA) in 1996, and to best of our knowledge, have not changed significantly since then. The act defines the circumstances in which a radio licence shall not be required.
10.1. GSM MODULE 10.1 GSM Module The GSM module used in this project is purchased fully assembled, with all radio-frequency stages and the controlling firmware hidden from the system integrator. The modules are FCC, GE, GCF, PCTRB and IC approved and fully conform to the GSM specification, being “fully Type Approved and do not require any additional test, as far as the GSM RF and Protocol part of 99/5/EC is concerned” [26].
Chapter 11 Conclusion and System Evaluation Over five thousand lines of code were written for the four microprocessors employed in the system. The prototype operates as expected: it is possible to track the movements of a tag between RFID readers. Results are buffered before being delivered via email. The system is stand-alone, not requiring any existing infrastructure bar GSM network coverage. The modular design enables simple upgrading of any component without requiring a system redesign.
The system has an expected lifespan of three years, limited by the leadacid battery. All other components are solid-state and, bar corrosion or mechanical degradation, will be obsolete before they fail. Replacement of the standby battery will thus enable operation well beyond the design lifetime, should this become necessary. The cost for low-volume production is expected to be in the order of ZAR2500 per system, which is less than one tenth the cost of the existing solution.
Appendix A Appendix: RFID Receiver A.1 PCB Layout of Push-pull Output Reader with Single-channel Receiver Figure A.1 shows a reduced circuit diagram for a push-pull output reader with one receiver channel. A full-size schematic can be found on the attached CD. Figure A.2 shows the PCB layout. The design of this reader is discussed in Section 5.4. A.2 PCB Layout of Single-ended Output Reader with Dual-channel Receiver Figure A.
A.2. PCB LAYOUT OF SINGLE-ENDED OUTPUT READER WITH DUAL-CHANNEL RECEIVER Figure A.
A.2. PCB LAYOUT OF SINGLE-ENDED OUTPUT READER WITH DUAL-CHANNEL RECEIVER Figure A.
A.2. PCB LAYOUT OF SINGLE-ENDED OUTPUT READER WITH DUAL-CHANNEL RECEIVER Figure A.
A.2. PCB LAYOUT OF SINGLE-ENDED OUTPUT READER WITH DUAL-CHANNEL RECEIVER Figure A.
Appendix B Appendix: RFID Co-ordinator B.1 Circuit Diagram Figure B.1 shows the complete circuit diagram for the RFID co-ordinator as discussed in Section 6. B.2 PCB Layout Figures B.2 and B.3 show the PCB layout of the RFID co-ordinator.
B.2. PCB LAYOUT Figure B.
B.2. PCB LAYOUT Figure B.2: RFID co-ordinator PCB top solder side Figure B.
Appendix C Appendix: Uplink Module Design C.1 EEPROM Data Storage The data backed-up in the uplink module’s onboard EEPROM is listed in table C.1. The table lists the name of the variable, its type, size and location.
C.2. LIST OF UPLINK COMMANDS C.2 List of Uplink Commands All commands are issued in the form COMMAND “space” ARGUMENT 1 “space” ARGUMENT 2 ... “CR”. Commands requiring numeric arguments must be zero padded. For example, to request record number eight, the command: get record 08 must be issued, rather than get record 8. Table C.2 shows the complete list of accepted commands and the arguments that they require. C.3 PCB Design Figure C.1 shows the top solder side and Figure C.
C.3.
C.3. PCB DESIGN Figure C.
C.3. PCB DESIGN Figure C.
C.3. PCB DESIGN Figure C.
C.3. PCB DESIGN Figure C.
Appendix D Appendix: Power Supply The devices shown in table D.1 were all considered for use in the system’s power supply, however, due to a lack of local availability, high cost or unsuitable operating frequency, they were dismissed in favour of the L4976 from ST Microelectronics.
Device MAX5072/3 MAX5082/3 MAX5088/9 L296 L5988 L4976 L4978 ST1S03 MC34063A/E L4973 L5970A/D L5972D L5973A/D L6902D L5972D L4971 LT1765ES8 LT1374 LT3412A LT1936 Manufacturer Maxim Maxim Maxim ST Micro. ST Micro. ST Micro. ST Micro. ST Micro. ST Micro. ST Micro. ST Micro. ST Micro. ST Micro. ST Micro. ST Micro. ST Micro. Linear Tech. Linear Tech. Linear Tech. Linear Tech. Max Freq 2.2MHz 250kHz 2.2MHz 200kHz 400kHz 300kHz 300kHz 1.5MHz 100kHz 300kHz 500kHz 250kHz 500kHz 250kHz 250kHz 300kHz 1.
Appendix E Appendix: Software The following software was used to complete the project design: • Microchip’s MPLAB v7.4 with C18 compiler • Eagle CAD v4.11 • Pentalogix’s Viewmate 9.4.73 The following software was used in the generation of this document: • LATEX 2ε and pdfLATEX • TeXnicCenter 1 Beta 7.01 • Microsoft Office Visio 2003 • Jasc Paint Shop Pro 7 • The Mathworks MATLAB 7.0.
References [1] Texas Instruments, Series 2000 RFM Sequence Control Reference Manual, first ed., October 1999. [2] U. o. C. T. Avian Demography Unit, “Earthwatch Project - South African Penguins,” 2006. [3] M. Songini, “RFID Stops Elks Wasting Away,” www.techworld.com, February 2006. [4] GAO RFID, “RFID Tags - Low Frequency Product List.” [5] GAO RFID, “RFID Low Frequency Readers Product List.” [6] Autoid.
REFERENCES [11] Various Authors, “Cyclic redundancy check,” Wikipedia, 2006. [12] A. S. Tanenbaum, Computer Networks. Prentice-Hall, 1981. [13] M. Ossmann, “TIRIS RFID Reader,” Elektor Electronics, October 2005. [14] National Semiconductor, LM567 Tone Decoder Datasheet, February 2003. [15] Texas Instruments, Series 2000 Antennas, March 2002. [16] E. S. Academy, “I2C (Inter-Integrated Circuit) Bus Technical Overview and Frequently Asked Questions (FAQ).” [17] Telit Communications S.p.