DESIGN OF A LOW-POWER AUTOMATIC WIRELESS MULTI-LOGGER NETWORKING DEVICE by Kelly S. Lewis A report submitted in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE in Electrical Engineering Approved: Dr. Brandon Eames Major Professor Dr. Paul Wheeler Committee Member Dr.
ii Copyright c Kelly S.
iii Abstract Design of a Low-Power Automatic Wireless Multi-Logger Networking Device by Kelly S. Lewis, Master of Science Utah State University, 2007 Major Professor: Dr. Brandon Eames Department: Electrical and Computer Engineering Virtually every industry and discipline (e.g., mining, pharmaceutical, construction, agriculture, reclamation, etc.) is finding applications for wireless data acquisition for monitoring and managing processes and resources.
iv Taking the technical out of new technology.
v Acknowledgments Many thanks to all the following individuals and institutions for their interest and support: Acclima Incorporated- For their partial funding of this project and close interaction and invaluable training. The practical experience gained from their Research and Development department cannot be measured in hours. Aquarius Brands- For their partial funding of this project and the connecting means for marketing and delivering this product to testing sites and costumers. Dr.
vi Contents Page Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii 1 Introduction . . . . . . . . . . . . . . . 1.1 Background . . . . . . . . . . 1.2 Problem Definition . . . . . . 1.
vii 3.4 3.3.1 Hardware Interface Layer . 3.3.2 Memory Management Layer 3.3.3 Networking Layer . . . . . . 3.3.4 Operating System Layer . . 3.3.5 Application Layer . . . . . Enclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
viii List of Figures Figure Page 1.1 Weather station located at TWDEF, Cache, UT. . . . . . . . . . . . . . . . 3 2.1 Two common approches to extract soil moisture from ET (figure proccured from Bernard et al. [1]). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2 Figure of the Campbell Scientific’s CR200 series datalogger. . . . . . . . . . 12 2.3 Picture of Sutron’s 8210 datalogger. . . . . . . . . . . . . . . . . . . . . . . 14 2.4 Figure showing Automata’s Mini-SS logger.
1 Chapter 1 Introduction This chapter contains a brief introduction to the rationale and design behind the development of the Acclima DataManager. Supporting background in wireless data acquisition, along with a discussion of current issues existing in agriculture and environmental monitoring is also presented. The Acclima DataManager aims to resolve these issues presented and provide a low-power cost-effective platform to further intelligent resource management and control. 1.
2 for supporting crop water and nutrient management, but also to obtain a descriptive, spatial measure of the function and efficiency of these management systems. Researchers and environmental analysts are searching for ways to increase spatial resolution of subsurface soil properties to assist in characterizing and modeling below-ground processes in the large (e.g., watersheds and basins). 1.
3 Fig. 1.1: Weather station located at TWDEF, Cache, UT.
4 The above mentioned approaches are in practice all around the world. For ground-based systems, using wireless data links is becoming the norm for remote data collection sites. Cost and installation time concerns drive the deviation from wired-based communications. The complexity added by introducing wireless into standing systems, coupled with the need for potentially adding thousands of network nodes, is quickly pushing current technologies and methodologies to their limit.
5 • Radio Access - wireless system that is reliable up at least a half a mile and supports a one-step network setup and data routing • Sufficiently Rugged - resistant to environment, rough handling, and vandalism • Automatic Centralized Data Collection - All data in a network of devices must be collected and stored at one central location • Versatile Sensor Interface - Support wide array of readily available sensors interfaces like analog voltage or current measurements, digital pulse-width and pulsefrequen
6 4. Allows non-engineers to easily access advanced logger features through a simple, yet powerful LCD driven user interface and PC software. This report describes in detail the design of an ultra low-power ZigBee-enabled datalogging device targeted for agricultural and environmental monitoring. Beyond general funding, Acclima also initially provided the market study, development tools, and code libraries that assisted with the development of the LCD and MCU flash drivers.
7 formations in these areas are well documented. Using this information, researchers and hydrologists have generated models of water flow and sediment transport to forecast the amount of water available from the land’s reserves and the effect of heavy rain during flooding seasons. Now a system of networked loggers that can be directly accessed to ascertain the saturation levels of the soil increasing the reliability of said predictions.
8 Chapter 2 Subject Review This chapter discusses in detail the background issues presented in section 1.2. It will do this by presenting documented examples of current methods used in environmental sensing projects. Common models used to estimate environmental properties will then be presented followed by a discussion illustrating the need for more collaborative analysis efforts.
9 Fig. 2.1: Two common approches to extract soil moisture from ET (figure proccured from Bernard et al. [1]). still reflects 6% error [4]. The model inaccuracies coupled with the lag and interval delays introduce too much error for some to grow crops or to report solid scientific numbers using these methods. However, Verhoest et al. [4] claims that more ground data is needed to continue refining their subsurface property estimation models. 2.
10 farm, located in Logan, Utah, has a system that falls under this category that uses pointto-multipoint radios to tie six weather stations together [12]. T.W Daniel’s Research Forest site, situated in the mountains above Bear Lake, Utah, interconnects sixteen dataloggers using RS485 [13]. On a large scale, systems are connected using TCP/IP, satellite telemetry, or long distance data radios. The Internet provides the ability to connect sites from many different places around the world.
11 These new radios are filling the void left by other protocols in medium scale, lowpower networking. Devices using ZigBee need little work to setup a self-healing, scalable network [20]. This leaves the host device interfacing with these radios needing only to be programmed with data management and database routines, leaving the network topology to the protocol. The maximum network size is limited by the protocol to be less than 64,000 nodes [19]. 2.
12 Fig. 2.2: Figure of the Campbell Scientific’s CR200 series datalogger. tion facilities in Utah, Washington DC, and Canada. They are also the closely partnered with other well known companies in the fields of environmental data systems and computing (e.g., Decagon, Apogee Instruments, and Juniper Systems). Their interests are broad and they provide over 200 different products.
13 and has been proven by years of field work. Addressing the requirement list discussed in section 1.3, this logger does support multiple power modes that enables it to conserve battery life. Its power modes are as follows: .2mA inactive, 3mA active with no radio, and 20mA to 75mA active with radio. These are satisfactory power specifications. The logger also satisfies the integrated radio specification and database requirements as well. However, the logger fails the ease of use stipulation.
14 Fig. 2.3: Picture of Sutron’s 8210 datalogger. this device. One is by using the front panel. A simple 1 X 40 character display and six buttons are available to navigate the device’s basic configurations. There is the GUI Xpert software that is an easy and convenient method to adjust configurations and download data. There is also the option to use the Tiny Basic programming language for more specialized programs that are beyond the standard configurations.
15 but the integrated display is only used to display status and generic operations. To access the system’s complex feature set, a programming language and computer must be used. The logger can be battery powered for an extended duration, qualifying it in terms of the low-power requirement. The 8210 does have radio options, but to use them one must have the technical expertise to know what kind of wireless connection he/she wants and how to tell the logger how to do it.
16 Fig. 2.4: Figure showing Automata’s Mini-SS logger. This system compares favorably to the desired specifications. It is simple to use and configure. However, the radio and database requirements fail because the logger has no inherent support for an automatic multi-node network of loggers or controllers. Although one can easily setup local measurements, the effort and expertise required to setup a wireless network with data storage/routing management would be a job for a technician, not a producer.
17 Fig. 2.5: The Em50R from Decagon Devices. 2.5.4 Decagon Devices Incorporated Decagon Devices Inc. [32], based in Pullman, Washington, has developed over 30 different devices, sensors, and controllers/loggers alike. This company specializes in providing quality products at a competitive cost. Decagon has products available for the following fields: food and pharmaceutical science, geotechnical and civil engineering, environmental research, and commercial irrigation.
18 The Em50R operates on five AA batteries for a duration of five to six months. Its sensor interface is limited to SE 12-bit analog. A stereo head-phone jack with excitation, signal, and ground is the standard hardware interface for sensors. This requires that the Em50R use Decagon’s sensors only. The cost of the system is anywhere from $400 to $600 making it a very reasonable solution cost-wise. The Em50R does appear to be an excellent solution for multi-site monitoring.
19 Chapter 3 Product Definition This chapter includes details on how the product requirements were further refined from section 1.3 and how the design of a new DataManager was approached and decomposed into various sub-components. 3.1 Design Requirement Survey Discussions between the author, Acclima, and other stakeholders resulted in a more complete list of requirements for a new logger platform, enumerated below: 1.
20 a separate enclosure. The second is to curb the damage done by rough handling or vandalism. 6. The device must support all of the following interface options: one SDI-12 communication port, three analog input ports, and two digital I/O ports. The analog port must support 0-20mA current measurement and an auto-ranging voltage measurement capable of measuring zero to ten volts with 12-bit accuracy. 7. The device must support an RS232C serial interface so as to connect to a PC or long distance radio.
21 Fig. 3.1: Depiction of the general hardware design. and to verify correct device operation. This requirement coupled with the memory card requirement allows an operator to forgo using a computer to download data and adjust device settings. The other way is through the PC software. This software should be able to interface to a logger or a network of loggers and be designed to database the data collected by all nodes in a given system.
22 here. All modules depicted in fig. 3.1 directly tie to the controller and were specifically selected to satisfy the requirements listed in section 3.1. Specifics on the elaboration of the requirement on a module-to-module basis will be shown in sections 3.2.1 - 3.2.1. 3.2.1 Power Supply Module The purpose of the Power Supply Module is to interface with external power and reliably provide power to the rest of the platform’s subsystems. It must satisfy requirement 1, 2, 3, and 8.
23 2. High- and low-frequency crystal support with dynamic clock rate selection. The processor’s clock rate is one of the biggest contributors to power draw. The ability to turn off crystals and/or cores or even to slow down their speed is crucial in a low-power design. 3. At least 48K of flash memory. The designers calculate that this application’s code will fit in this memory size. Flash was selected because of its wide availability and its ability to be reprogrammed in system.
24 12VDC power, ground, and a 5V-TTL bidirectional data port must be supported. The SDI-12 module must support nine sensors while using the standard set of device addresses (universal 0 and 1-9). The device must support one port and have individual configurations for all nine sensors. These configurations must support multiple power settings and start up delay parameters. 3.2.4 Analog Measurement Module The analog module is the second installment that aims to satisfy the general interface requirement.
25 500mA at 6VDC and 200mA at 15VDC. P-channel open-drain outputs must be used on all switches. 3.2.7 Serial Communications Module The general requirements state that the device must be configurable by PC or by long distance data radios. The Serial Communications Module must therefore support this function. The common RS-232C specification [34] is widely used today. To support this protocol, a translator IC must be included to generate RS-232 voltage levels.
26 3.2.10 Removable Flash Memory Module This module is present to satisfy the requirement that a common flash memory card interface be supported in this project. Possible memory cards available for consideration are: CF, MS, SD/MMC, and xD. The type of memory card used must support an autodetect feature when cards are inserted in the memory slot, capacities of 128MB to 2GB, and interface using SPI. The selected card type should be easily accessible by the public and cost less than $30.00 dollars.
27 Fig. 3.2: Depiction of the general firmware design. 3.3.1 Hardware Interface Layer The Hardware Interface Layer consists of modules that form the basic building blocks of the entire firmware set. This layer should answer how a specific operation called by high level tasks resolve into hardware action. All platform specific detail must be contained herein to promote portability.
28 register(s) appropriately. Device Drivers The device drivers represent most of the device specific code in the firmware. Support for all hardware features are found here. The only requirement for this module is that the feature functions correctly with as little resource use as possible. Below is the list of drivers that must be elaborated on: 1. Serial Communications- Driver must contain handlers for transmitting and receiving using one of the MCU’s UARTs.
29 7. LCD Screen- This driver must support functions like activate and deactivate display, initialize screen, write characters, move curser, and clear screen. 8. Push Buttons- This driver handles the de-bouncing and behavior of the buttons. The final output of this driver is that a particular button was pressed. This result is found by integrating a timer and external interrupts. Finally, the driver must support multi-rate button responses. 9.
30 1. Factory Configuration- This file contains the information about factory settings, calibrations, and product creation. It is located in the internal flash of the MCU and is 256 bytes long. 2. Device Configuration- This file contains the information about the current settings for the device. Active sensors, passwords, owner information are also contained in this file. It is located in internal RAM and takes up 512 bytes. This file also has a shadow file located in Internal Flash.
31 supporting firmware must be in place to handle these file accesses. The generation of such a module is beyond the scope and resources of this project. Therefore, file system code must be obtained that will perform the appropriate memory operations. The code must be conservative both in size and RAM usage. 3.3.3 Networking Layer The Networking Layer is responsible for information routing between multiple devices in a system.
32 created for this design. The new OS would have the following requirements: 1. The scheduler must be table-based. Table-based schedulers use a fixed amount of memory known at compile time. They are also deterministic, helping to guarantee the timeliness of any given response. 2. The scheduler must select tasks cooperatively. While this does minimize OS complexity, this requirement can reduce the overall response time of a externally triggered task.
33 Atomic Handlers The interrupts of an MCU must be used to handle communication transfers, to queue up tasks called on by the devices environment, and to service an internal device need. All of these operations must be fast (< 1ms) and must not be interruptible. The events that fall under this designation are: • ZigBee Communications- Any form of communication between the ZigBee Radio and this device must use this handler. This routine must work with this interface on the byte and packet level.
34 Scheduled Operations (Tasks) This section illuminates the tasks required to satisfy the general requirements for this device. The priority ratings and their corresponding task assignments are: low (31-63), medium (15-30), and high (0-14). Tasks that must be designated high priority are: • ZigBee Network Initialization- To save battery power, the ZigBee radio will not be powered all the time. This task must be called every time the radio needs to establish its network.
35 • Sensor Measurement- Since this device is functioning as a data logger, it requires a range of sensor measurement tasks. All measurement tasks must be scheduled independently; therefore a task is required by every sensor. • Configuration Backup- System configurations must be periodically saved in a “shadow file” to increase system fault recovery. If a fault is detected, the backup will replace the corrupted configurations.
36 Fig. 3.3: Artistic depiction of the Acclima DataManager’s enclosure and front panel.
37 Chapter 4 Implementation This chapter discusses the implementation path taken during the course of this research and project development. The requirements and elaborations expressed in Chapter 3 were used to guide the selection of available hardware components. The selected components were then assembled and specific operations verified. Once the verification process is complete, the resulting device’s performance and functionality was tested. These test results are shown in Chapter 5. 4.
38 Fig. 4.1: Diagram of the power subsystem. with inputs ranging from 6.0-15.0V. The switchers have the ability to be deactivated using control lines. The battery supervisor circuit sends a digital signal when the power after the RVP circuit drops below a minimum threshold. In sleep mode, the entire power supply consumes 13.2µA. Reverse Voltage Protection Circuit This circuit traditionally is a diode placed in series between the positive input and the voltage regulation devices.
39 Fig. 4.2: A schematic representation the reverse polarity protection circuit. was extended an estimated three weeks to two months. The ability to switch the circuit’s behavior from an open circuit to a diode also allows both ports to be powered at the same time. When the power on the auxiliary port is 4.5V or above, the battery pack will cutout and the auxiliary port will supply all power needs. If power on the auxiliary falls below 4.2V, the battery pack will be switched back in with no power glitches.
40 Variable Output Switcher This device by far took the most energy in this module. The complexity in this decision stems from the need to produce 6, 9, 12, and 15V when the input voltage could drift above or below the output voltage. This device must therefore step up and step down voltages. The three types of switchers that can regulate above, at, or below the input voltages are buck-boost, fly-back, and SEPIC1 regulators.
41 4.1.2 Controller The selection of an MCU requires much study and analysis of the design needs. Two items of note when selecting an MCU is that there is an inherent tradeoff in power and performance, and there is a general cost increase as the MCU grows in pins, peripherals, or data-path size (8-, 16-, 32-, or 64-bit). There are as many as 30 manufactures and thousands of different MCUs to choose from. Therefore, it is critical to filter out MCUs with unnecessary features.
42 was chosen because the designers already had experience using it and no extra expenses would be necessary to acquire the tool suite necessary to develop with this processor. The selection of the MSP430F14X [41] does have two drawbacks. First, the code size is limited to 60K bytes. The data manager application is moderately complex, but the engineering team estimated that this application will not exceed 60K bytes. Second, the largest chip size available is 64 pins.
43 the converter appropriately. This feature realizes the required auto-ranging capabilities of this port. If the port is configured incorrectly or the signal is outside the measurable range of the device for any particular setting, the port also has shunt diodes to remove the excess charge before it reaches the MCU. 4.1.5 Digital Measurements The digital ports were implemented using a CCP and timer pair inside the MCU, and a line driver. The line driver is the SN74LVC1T45 [42] used in the SDI-12 module.
44 Fig. 4.3: Picture of the Maxstream XBee-Pro radio module. module used 30mA active, 55mA RX, and 215mA TX. The crucial requirement that the radio’s network function (i.e., coordinator, router, or endpont) be dynamically allocated led designers to select the Maxstream XBee-Pro [44] (see fig. 4.3). Its power consumption makes is a non-ideal solution. However, Maxstream has certified the DataManager and its development and given intellectual rights to allow this device to reconfigure their radio.
45 as to the stability of the Spansion part. So both chips were included in layout to provide redundancy. 4.1.9 Removable Memory Secure Digital [47] (SD) and Compact Flash [48] (CF) are two of the most popular and widely available forms of removable flash memory. The other considerations for removable flash memory were rejected because any implementation detail requires fees to be paid to the individual flash memory institution. CF cards use a total of 60 pins to interface to a host.
46 Fig. 4.4: Custom LCD glass art generated for this project. could not be upgraded. Character displays come in many sizes and the contents of the display are incredibly flexible. Four lines by twenty characters is the size of display that is of interest. It is big enough to be informative and small enough to be comparable in price to custom glass. It does, however, require 5VDC and 2.5mA to operate. Although the character display uses more power, the flexibility of the display was desired.
47 Chapter 5 Testing This chapter focuses on the system testing that took place May 2007 through October 2007. This period comprises the alpha and beta testing portion of the project. Testing took place in Logan Utah, Meridian Idaho, and various locations in California and Washington. 5.1 Alpha Testing The purpose of the alpha testing phase was to verify and measure the hardware’s ability to performe within the specified requirements.
48 Fig. 5.1: A depiction of the test platform (circuit board shown). power ports for sensors. The switched ports support 6VDC at 500mA through 15VDC at 200mA output. 5.1.3 Cost The production cost per unit is around $150. This places the DataManager list price around $650. This is below the required limit of $800. 5.1.4 Time The device contains a real-time clock (RTC) with battery-backup for unbroken timekeeping for longer than five years with no batteries. The system draws 3.4µA in backup mode.
49 port adhering to version 1.3, three 12-bit analog input ports with an auto-ranging voltage input capable of measuring 0-10V and 0-20mA current loop measurements, and two digital measurement and I/O ports. All sensors are capable of being configured separately and can measure with one minute resolution. 5.1.6 Communication Interfaces The device supports an RS232 serial interface and an embedded ZigBee Mesh radio interface.
50 Fig. 5.2: Beta test hardware (covered by face plate). 5.1.9 Ruggedness Each device comes in a weather proof enclosure and has a built in lock. All connection ports are ESD protected. The device’s enclosure is not capable of handling submersion. 5.2 Beta Testing The purpose of the beta testing phase was to test the devices various feature sets together in varied stages of completeness. The beta testing was broken down into three distinct phases.
51 5.2.1 Phase One This is the first phase that others outside of Acclima were brought in to judge performance and to help identify bugs. At this stage, the device need only support one SDI-12 sensor, the framework for the data logging scheduler, and basic WASUP communications. Operations testing for SDI-12 devices included querying, change of address, adding, identifying, measuring, and removing one sensor. All this testing was done using the device configurations and scheduler.
52 Two major problems arose during this phase. The first bug showed itself during the first few days of testing. After operating for a full day or when an SD card was inserted into the device, the system would crash. An easy fix for this is to trip the battery reset and the system would start up again. But the system would then become sluggish and non-responsive at times. After many attempts, the PC software retrieved the log file and configuration file from the device.
53 establish their mesh hierarchy and the devices are all synchronized in relation to time and the network heartbeat. Concluding the synchronization process is the data transfer that automatically directs data to a universal collection node. A PC connected to a device can then request to use the network and us this advanced connection to access other devices in the network.
54 Chapter 6 Conclusions This chapter concludes the thesis documentation for the DataManager project. A summary of the project’s purpose and course will be reiterated. The end results produced from this research and design effort will then be set forth. Finally, this document will close with a discussion of future work in this research emphasis. 6.
55 Fig. 6.1: Final DataManager product with enclosure actively measuring precipitation and soil water content at a USU test site. devices support SDI-12, analog, and digital sensors. The devices also support using SD cards for memory storage. The batteries for this system will last a year without external power. Solar panels or other forms of external power are also supported. The ZigBee radios embedded in this product are easy to enable and use.
56 use this MCU. The new device may not have a screen or as many sensor interface ports. It is logical to Acclima Inc. to continue this thread of development in parrellel with the full DataManager product. This will extend the device family to two products from this expenditure. This secondary device will function as a true distributed sensor network with the DataManagers as collection nodes.
57 References [1] R. Bernard, M. Vauclin, and D. Vidal-Madjar, “Possible use of active microwave remote sensing data for prediction of regional evaporation by numerical simulation of soil water movement in the unsaturated zone,” Water Resource Research, vol. 6, pp. 1603–1610, 1981. [2] A. Morse, W. J. Kramber, R. G. Allen, and M. Tasumi, “Use of the METRIC evapotranspiration model to compute water use by irrigated agriculture in idaho,” in Geoscience and Remote Sensing Symposium, Proceedings.
58 [13] K. S. Lewis and S. B. Jones, “Private communication,” Oct. 2004. [14] C. S. Incorperated, “NL100 datasheet,” [http://www.campbellsci.com/nl100], 2007. [15] T. N. Eisenman, “NOAA reaches a critical milestone in u.s. tsunami warning system expansion,” [http://www.noaanews.noaa.gov/stories2006/s2620.htm], 2006. [16] I. A. Glover, “Meteor burst communications. and meteor burst propagation,” Electronics & Communication Engineering Journal, vol. 3, no. 4, pp. 185–192, 1991.
59 [29] C. S. Incorperated, “CR200 series datasheet,” [http://www.campbellsci.com/cr200], 2007. [30] Sutron Systems, “8210 dataloggers,” [http://www.sutron.com/products/8210.htm], 2007. [31] Automata Incorporated, “Field controllers/dataloggers,” [http://automata-inc.com /product.htm], 2007. [32] Decagon Devices Incorporated, “EM50 or EM50r data collection system,” [http:// www.decagon.com /manuals/ManualEm50.pdf], 2007.
60 [46] Spansion, “S25FL008A datasheet,” [http://www.spansion.com/products/S25FL008A.html], 2007. [47] S. D. Association, “SD card specification,” [http://www.sdcard.org/about/memorycard/], 2007. [48] Compact Flash Association, “CF+ & compactflash specification revision 4.1,” [http:// www.compactflash.org/], Mar. 2, 2007. [49] Tianma USA, “Specification for LCD module: TM204a series,” [http://www. tianma.com/web/uploads/spec/466tm204ACC6.pdf], 2004.