16
Wireless Telemetry for Song Sparrows Jayson Bowen EE 542 Professor James K. Peckol December 8, 2006

Wireless Telemetry for Song Sparrows

  • Upload
    others

  • View
    15

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Wireless Telemetry for Song Sparrows

Wireless Telemetry for Song Sparrows

Jayson Bowen

EE 542Professor James K. Peckol

December 8, 2006

Page 2: Wireless Telemetry for Song Sparrows

i

Page 3: Wireless Telemetry for Song Sparrows

Abstract

This report examines using off-the-shelf components to build an ultra-miniature wirelessdigital transceiver for song sparrow telemetry. The digital transceiver system allows forbidirectional information to flow between systems which would advance the state of theart of current traditional telemetry. In traditional telemetry application, the animal wouldwear a transmitter that sends out a radio-frequency ping at some interval and researcherswould have pick up this signal with a receiver to get the general direction of the animal.With the proposed telemetry, various information such as movement, contact with otherbirds, physical state, and other events/attributes can now be recorded and sent to a centrallocation allowing the data to be conveniently accessible by researchers. Main design issuescenter around power consumption, including ways to conserve and harvest power from theenvironment by using energy scavenging. The target specification is for a system that is 6 x15 x 5 mm in size, weighs 1 gram, and has a battery life of six or more months. The ANTprotocol from Dynastream Innovations Inc. implemented with the Nordic SemiconductornRF24AP1 2.4 GHz transceiver in conjunction with either a Microchip PIC16LF88 or TexasInstruments MSP430F2012 is considered for this project. A complete prototype has yet tobe built and tested, therefore this report focuses on the current unfinished design and theinitial tests on individual components. After investigating the ANT implementation, it wasfound that a simpler transceiver without the high-level ANT protocol would be easier tocustomize and therefore potentially consume less power.

ii

Page 4: Wireless Telemetry for Song Sparrows

Acknowledgements

This project is part of a larger research effort headed by Professor Brian Otis (ElectricalEngineering dept.) and John Burt (Psychology dept.). I would like to thank them both forgiving me the opportunity to work on this project. I would also like to thank Professor JamesPeckol for giving me the freedom to do this research and for offering this research class; Igreatly appreciated the opportunity to share ideas and experiences related to developingembedded systems with the rest of the class.

iii

Page 5: Wireless Telemetry for Song Sparrows

Contents

1 Introduction 1

2 Project Discussion 22.1 Design Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.2 Design Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 System Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.3.1 Wireless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3.2 Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3.3 Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3.4 Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.4 Software Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.5 Hardware Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Test Plan 9

4 Analysis 9

5 Issues and Problems 10

6 Summary and Conclusion 10

iv

Page 6: Wireless Telemetry for Song Sparrows

List of Figures

1 Time-line for the wireless telemetry for song sparrows research project. . . . 22 Network topography in the field. Adult song sparrow males reside in estab-

lished boundaries (A-F). Young male sparrows travel over a larger area andeavesdrop on the adults, these are called “floaters” (X, Y, and Z). Floaterscan also associate with other floaters (T-W). Transceivers are placed on theyoung male sparrows and are called “roving nodes” (R). Transceivers are alsoplaced in known locations and are called “fixed nodes” (F). (John Burt). . . 3

3 Information flow in network (John Burt). . . . . . . . . . . . . . . . . . . . 44 Simplified control flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Solar cell with battery power circuit. . . . . . . . . . . . . . . . . . . . . . . 86 High level system block diagram. . . . . . . . . . . . . . . . . . . . . . . . . 9

List of Tables

1 Current consumption of various components from datasheets. . . . . . . . . 8

v

Page 7: Wireless Telemetry for Song Sparrows

1 Introduction

This report examines using off-the-shelf components to build an ultra-miniature wirelessdigital transceiver for song sparrow telemetry. A complete prototype has yet to be builtand tested, therefore this report focuses on the current unfinished design and initial tests onindividual components.

Using wireless digital technology allows much greater freedom to control tradeoffs in de-sign. The key factors for song sparrow telemetry are ultra-low power, footprint, and weight.Roughly speaking, these factors are on the order of microamps for power, millimeters forfootprint, and less than a gram for weight.

This report focuses primarily on the ANT implementation by Dynastream Innovations Inc.,which uses 2.4 GHz transceivers from Nordic Semiconductor ASA. It was found that thisimplementation may not be well-suited for song sparrow telemetry, and the trade-offs withthis technology consist of power consumption and the network topology. This product canpotentially consume too much current due to the ah-hoc nature of the peer-to-peer commu-nication with the wireless nodes. Other transceivers manufactured by Nordic Semiconductorare available without the high level protocols built-in, which would allow the system tobe tuned to the ah-hoc peer-to-peer topology. Some of these other transceivers were alsoexamined.

Traditional radio telemetry poses many problems that can be potentially eliminated usinga digital transceiver system. Typical analog radio telemetry consists of a transmitter thatbroadcasts a radio-frequency (RF) ping, and a receiver that listens for the ping. Transmittersare placed on the animals that are to be tracked, and then the receiver must be manuallypositioned in order to get a location on the animal. This translates into possibly teams ofpeople searching an area to track down this RF ping signal. The only information gained isthe strength of the ping signal.

A wireless digital transceiver-based telemetry system is much more flexible than the tradi-tional radio telemetry systems. The transceiver mounted on the animal can receive data aswell as transmit. This allows for flexibility in the networks between the systems (nodes) canbe established, specific information such as location, sensor data, time stamp, audio, etc.,can be transferred. A microcontroller (MCU) is used to control the system and is respon-sible for power management, processing data, and other tasks associated with a particulartelemetry design.

1

Page 8: Wireless Telemetry for Song Sparrows

2 Project Discussion

The ultra-miniature wireless digital transceiver system is being constructed for use withresearch scientist John Burt’s on-going research in bird song learning. The purpose of birdsong learning research is to understand what social factors attribute to birds ability to learnsongs. Recent experiments (Beecher et al 2006, in press; Burt et al 2006, in review) suggestthat eavesdropping may be key to how the birds choose which song to sing. His researchgroup currently tracks young male sparrows in the field with traditional radio telemetryto monitor the bird’s social behavior. The radio is roughly 10 x 15 x 5 mm and weighs1.2 grams. It contains an antenna wire that is roughly 10 cm long. The unit is fitted tostraps that are placed on the birds, which resembles a backpack. The largest problem is thatresearchers are unable to monitor the birds constantly. The infrequent samples of movementpatterns do not provide the detailed information necessary to study the behaviors. The shortbattery life (6 weeks) requires the recapture of the birds to change the battery.

The goal of this project is to address the problems with traditional radio telemetry and tocapture substantially more information than what was previously possible.

This project is part of Professor Brian Otis and John Burt’s research proposal. The roughtime-line for the project as a whole is shown in Figure 1

Figure 1: Time-line for the wireless telemetry for song sparrows research project.

2.1 Design Specification

The target specification given by John Burt is:

• Transceiver dimensions: about 6 x 15 x 5 mm

• Weight: less than 1 gram (including battery)

• Lifespan: 6 months or longer

The device will be equipped with a user-programmable microprocessor, non-volatile memoryfor storing data, and a radio transceiver. Communication with devices will be via a hand-held radio transceiver attached to a portable computer. The computer link will allow us

2

Page 9: Wireless Telemetry for Song Sparrows

to upload and download data, and program the device wirelessly. Each device will alsobe capable of linking and sharing information with other animal-mounted or fixed positiontransceivers in a mesh network configuration.

The transceivers attached to the birds are known as “roving nodes” and base stations placedin known positions are called “fixed nodes”. Fixed nodes will be placed throughout the areaof interest and roving nodes are placed on the birds. When two roving nodes come within RFrange (roughly 30 feet), they will record the time this event occurred and exchange recordeddata from memory. When a roving node is within range of a fixed node, the data recorded onthe roving node will be transferred to the fixed node and cleared from the roving node. SeeFigure 2 for a graphical representation of this setup. Researchers can then either downloadthe data from the fixed node at their leisure or transfer it via some communication channelback to a computer. Figure 3 illustrates the data flow proposed.

Figure 2: Network topography in the field. Adult song sparrow males reside in establishedboundaries (A-F). Young male sparrows travel over a larger area and eavesdrop on the adults,these are called “floaters” (X, Y, and Z). Floaters can also associate with other floaters (T-W). Transceivers are placed on the young male sparrows and are called “roving nodes” (R).Transceivers are also placed in known locations and are called “fixed nodes” (F). (JohnBurt).

3

Page 10: Wireless Telemetry for Song Sparrows

Figure 3: Information flow in network (John Burt).

2.2 Design Procedure

For the first prototype, size and weight are not a priority, and power consumption, whilenot a priority, is considered. The first prototype is meant to be a proof of concept for thetelemetry system design. With low power in mind, however, care was used when choosingcomponents in order to attempt to consume the least amount of power as possible. TheANT protocol from Dynastream Innovations implemented by the Nordic SemiconductornRF24AP1 2.4 GHz transceiver was chosen because of the advertised low power consumptionand its targeting towards sensor network applications. The Microchip PIC16LF88 8-bit MCUwas chosen because of the low power consumption. Another MCU being considered is theTexas Instruments MSP430 series MSP430F2012 16-bit MCU. See Table 1 for a comparisonof power consumption.

2.3 System Description

2.3.1 Wireless

The ANT protocol was meant to be fairly flexible. The protocol defines a “channel” asbeing a link between a “master” and at least one “slave”. The master repeatedly transmitsan 8-byte data payload at a set interval (2 seconds to 5 milliseconds). The slave detectsthe master and receives transmission at the same interval. The slave has the option of

4

Page 11: Wireless Telemetry for Song Sparrows

sending data back to the master. For a channel to be established, a number of parameters(network id, network key, product id, channel period, channel type, etc.) must match onboth the master and slave. A slave unit can “pair” with a master if only some parametersare known by setting wild cards. A channel can support one master and multiple slaveson a shared channel. The maximum number of channels a device can have is dependenton the hardware; the nRF24AP1 can have 4 channels. Three modes of transmission areavailable; “broadcast” sends an unacknowledged message, “acknowledged” acknowledges ifdata was sent successfully, and “burst” sends large amounts data as fast as possible in rapidsuccession.

The Nordic Semiconductor nRF24AP1 2.4 GHz transceiver implements the ANT protocoland presents the user with a serial interface. The serial interface can be asynchronous orbit/byte synchronous (SPI); however, the byte synchronous SPI interface was chosen to beused because it has the lowest power consumption according to the datasheet. Because thenRF24AP1 requires itself to be master, it uses a modified SPI interface to give the MCU flowcontrol. This results in three additional signals to be accounted for, which the data sheetdoes not contain detailed timing information for these and made for a difficult integrationwith the MCU.

The communication was half-duplex and was implemented by ANT telling the MCU toenable the serial port, and then the MCU would strobe a ready signal back to ANT in orderto receive a byte. The first byte received established the direction of the data (either MCUto ANT, or ANT to MCU), thus if the MCU wanted to send ANT a message, it would haveto receive the first byte and if that byte was in the ANT to MCU direction, the MCU wouldhave to receive until the next message starts with the byte indicating MCU to ANT direction.The communication from the MCU to the ANT system using a serial connection consistsof framed messages. The messages are used to define channel parameters and send/receivemessages/events. When tested indoors, the wireless signal range on the ANT radios wasroughly 30 feet.

To establish a channel, the slave node would have to pair with the master node. Thispresented a problem because this requires that the slave open a receive channel until amaster was detected. If there are no masters around then the channel would either time-out or stay active indefinitely depending on the settings. The current consumption of theradio in receive mode without a master was measured at 400 µA with the ANT evaluationkit, which greatly exceeds the target current. This value was obtained from measuring thecurrent through the power supply at steady state (no activity), and then with the receivechannel open using a digital multi meter (DMM) set to averaging mode. In order to bringthe current down, the pairing operation would have to be executed in short bursts which maynot be enough time to connect to a master. One solution to this problem is to have everyroving node transmit their unique ID on some time period (i.g. two seconds), and then havethe receiver activate a much slower interval and short duration (i.g. every one minute for sixseconds). The system would record a time-stamp and return to sleep mode if a transmission

5

Page 12: Wireless Telemetry for Song Sparrows

was detected while the receiver was active. This means that the information flow no longertransfers roving node to roving node to eventually the fixed nodes. Instead, every rovingnode would have to transfer its data to the fixed node individually. With enough fixed nodesin the area, this should be an acceptable trad-off. A second option is to make the rovingnodes transmit only, and rely on the fixed nodes to collect data. Positional information canstill be obtained using the location information of the fixed nodes.

Nordic Semiconductor manufactures a number of other 2.4 GHz wireless transceivers, in-cluding one with on-chip MCU. These radios are also being considered because they do nothave the burden of the high level protocol which allows for more a specialized design. Theseradios would allow complete control over the timing and eliminate the pairing step. Thetrade-off is a higher complexity in implementing a custom protocol.

Another idea for future investigation is “wake on wireless”. The author proposes that it maybe possible to use an extremely low-power simplified radio receiver to detect (not receive) atransmission from a node to send a wake-up signal to the MCU. This will be investigated ata later time.

2.3.2 Control

A simplified control flow diagram is shown in Figure 4. The “Send Node ID” runs on theANT radio and is initiated by the MCU at startup. The MCU will always be in sleep modeand will only wake up either when the receiver (RX) timer expires, or when activity on theserial communications line is detected from the ANT radio. When the receiver time expires,the MCU will wake up and enable the receiver. The MCU will then either time-out and goback to sleep, or get a response from a transmission to the radio. If the response came froma roving node, it will record the time the event occurred, and if it came from a fixed node itwill upload all of the recorded data to the fixed node and then clear its memory.

To save storage space, when a roving node is detected, that event is recorded, and eachrepeated detection is ignored within some set time window. If that window expires then thetime between first detection and last detection are recorded.

2.3.3 Storage

To achieve the lowest power possible and have non-volatile storage, Ferroelectric RAM(FeRAM or FRAM) was chosen. FRAM does not require power to retain data and usessubstantially lower voltage compared to flash memory to write data. Ramtron InternationalCorporation manufactures the FM24CL64, which is a 64 Kbit serial (SPI) FRAM that re-quires 2.7 V and consumes 400 µA.

6

Page 13: Wireless Telemetry for Song Sparrows

Figure 4: Simplified control flow.

2.3.4 Power

The specified weight limit puts heavy constraints on the power sources available. There arevirtually no rechargeable (secondary) batteries in the 1 gram weight category, and thereforelimits the scope to non-rechargeable (primary) lithium chemistry. While silver-oxide batteriesare within the weight tolerance, they are very sensitive to large current spikes. The radiotransceivers being considered are capable of large current spikes that would be too hard onthe silver-oxide chemistry.

Both the PIC16LF88 and MSP430F2012 series MCU’s have multiple low power modes.Generally, they consist of a full on mode in which everything is on, one or more intermediatemodes that have only a subset of oscillators and on-chip peripherals on, and a sleep modein which everything is shut down. The MCU’s can be waken in various ways, includingexternal interrupts, and timer interrupts (clocked externally or watch dog timer). Table 1lists current consumption of the two processors and radios.

As an example, a quick power budget can be calculated using the lithium coin cell batteryCR1220. It has a capacity of roughly 40 mAh, voltage of 3 V, and weight of 0.78 g. Theaverage current draw for a lifespan of 6 weeks would then be 39.7 µA, and for 180 days be9.3 µA. Considering the MCU can draw 70-200 µA while active and 0.1 µA while in sleepmode, this means the time spent in active mode must be short. Added to that, the radioscan peak to 22 mA! This puts a very high stress on the system.

To lengthen the life span of the system and offload some of the burden on the battery,various energy harvesting/scavenging techniques are being considered. These range fromsimple photovoltaic cells (solar cell), vibrational motion, to heat gradient conversion. A

7

Page 14: Wireless Telemetry for Song Sparrows

Table 1: Current consumption of various components from datasheets.PIC16LF881 MSP430F20122 nRF24AP1 (ANT) nRF24L01

Sleep mode 0.1 µA 0.1 µA 2 µA 0.9 µA4 kHz - 1.2 µA - -32 kHz 7 µA - - -1 MHz 76 µA 220 µA - -4 MHz 280 µA - - -

TX - 16 (peak) µA 11 µARX - 22 (peak) µA 11.8 µA

Values are at +25degC1 at 2.0 V2 at 2.2 V

simple addition of a solar cell can be achieved with the circuit shown in Figure 5.

Figure 5: Solar cell with battery power circuit.

2.4 Software Implementation

The software system will consist of a small multi-tasking kernel. This kernel will run anumber of tasks in round robin fashion. This will allow easier control of program flow dueto the asynchronous nature of the radio events. The tasks will be as follows:

Initialize System Responsible for initializing the system and starting the other tasks.

Power Management Manages the power modes on the MCU (full run, stand by, sleep,etc.).

Serial Driver Synchronous serial driver communicates with ANT radio and invokes ANTmessage decoder.

8

Page 15: Wireless Telemetry for Song Sparrows

ANT System Controls the flow of information and recording to external storage.

Setup Beacon Starts the master channel to broadcast node ID.

2.5 Hardware Implementation

The hardware implementation has not been completed at this time. A high level blockdiagram is shown in Figure 6.

Figure 6: High level system block diagram.

3 Test Plan

Once the system is constructed, the protocol and message flow will be tested first. Predeter-mined data packets will be sent and received by the systems to verify wireless communication.Power consumption will also be measured to make sure the system is within the parametersto operate under battery power.

4 Analysis

As discussed earlier, the problem with the ANT implementation is the high current requiredto establish a channel. While this can be reduced by using synchronized timing on thenodes, this may not be the best solution. The ANT protocol does not allow control of moredetailed elements of the radio’s operation. The other radios, such as the nRF24L01, lookbetter suited for the project, because they typically implement only the link layer giving thedeveloper much more control.

9

Page 16: Wireless Telemetry for Song Sparrows

5 Issues and Problems

There were three main issues that hampered development on the telemetry system. Whilemost of the time was spent researching datasheets and products, the last couple weeks ofdevelopment were spent writing software.

The first issue was not related to software, but rather hardware. The ANT system usesa modified SPI interface which was under-documented. This made the timing on manysignals ambiguous. To understand how the interface worked, test software was written forthe PIC16LF88 to test ANT system. The ANT evaluation kit came with code that madethe high level messaging system function. The ANT code had to also be ported to the PIC.The code was never completed and therefore the SPI interface was not tested.

The second issue came up when compiling the code for the PIC. The compiler used wasthe PCWH IDE Compiler from CCS Inc. The reason the code could not be complied wasdiscovered too late. The compiler does not support multiple compilation units, meaning itwould not compile multiple “.c” files. To get around this issue, the “.c” can be included like“.h” files, except the ANT code relied on separate name spaces that multiple compilationunits provides. In order to solve this problem, the ANT code would have to be completelyrestructured.

Lastly, the code for the system was compile on the TI MSP430 compiler; however, theMSP430F2012 only has 128 bytes of ram, which was not enough to operate the system. Adifferent MSP430 would be able to run the system however, but this was not tested.

6 Summary and Conclusion

The majority of this project consisted of researching different products and their capabilities,as well as performing some initial experiments with the ANT evaluation kit. The work donethus far indicates that it may be possible to construct an ultra-miniature wireless digitaltransceiver system for use in small animal telemetry from off-the-self components. However,there are many issues that need to be further researched. The physical construction ofa prototype will also need to be examined. Perhaps nonstandard materials can be usedinstead of the PCB material. The effect of using “bare-die” chips on weight and thermalrequirements needs to be investigated. While these would be among the last problems to beaddress, currently the overall system needs to be completed and verified before any furtherwork is done.

10