Mobile Open-Source Plant-Canopy Monitoring System

Many agricultural applications, including improved crop production, precision agriculture, and phenotyping, rely on detailed field and crop information to detect and react to spatial variabilities. Mobile farm vehicles, such as tractors and sprayers, have the potential to operate as mobile sensing platforms, enabling the collection of large amounts of data while working. Open-source hardware and software components were integrated to develop a mobile plant-canopy sensing and monitoring system. The microcontroller-based system, which incorporated a Bluetooth radio, GPS receiver, infrared temperature and ultrasonic distance sensors, micro SD card storage, and voltage regulation components, was developed at a cost of US$292. The system was installed on an agricultural vehicle and tested in a soybean field. The monitoring system demonstrates an application of open-source hardware to agricultural research and provides a framework for similar or additional sensing applications.


Introduction
Many agricultural applications, including improved crop production, precision agriculture, and phenotyping, rely on detailed field and crop information to detect and react to spatial variabilities.Plant characteristics of interest often include plant canopy temperature and plant height.Canopy temperature has been studied for decades as an indicator of stress [1] [2], to evaluate drought tolerance [3], and for scheduling irrigations [4].Plant height is of interest due to its role in determining a variety of plant traits [5], and as an indicator of yield and biomass [6] [7] [8] [9].
Modern mobile farm vehicles, such as tractors and sprayers, are being designed with more electronic features and have potential for interfacing sensors, enabling the collection of large amounts of data while working [10].Advancing sensing technologies are enhancing monitoring capabilities over a range of spatial scales, from small plot to field to whole farm.Agricultural vehicles have been evaluated as mobile platforms for mounting external non-contact sensing systems for a variety of crop characteristic and crop production applications [11] [12] [13] [14] [15].
Advances in electronic technologies continue to bring about new and more powerful and accessible sensing and monitoring capabilities.There is growing interest in the research community in the open-source concept of free and collaborative sharing of ideas and technologies [16] [17], which "aims to foster technological knowledge and encourage research that is accessible, collaborative and respects user freedom" (https://www.oshwa.org/about/).A growing number of open-source projects have been undertaken to provide accessible tools and resources for developing sensing and monitoring capabilities [18], and to address specific research needs, especially in agricultural and environmental disciplines [17] [19] [20] [21] [22] [23].
The objective of this project was to develop a mobile monitoring system for collecting plant-canopy data using inexpensive open-source hardware and software components.Design requirements included the ability of the system to be mounted on an agricultural vehicle and the capability to collect and store plant height and canopy temperature measurements along with concurrent geographic coordinates as the vehicle travelled across agricultural fields.

Materials and Methods
The mobile monitoring system consists of hardware and software components.
The hardware component includes a microcontroller-based data collection and storage circuit, electronic sensors, and frame and mounting platform.The software component includes microcontroller programming to direct and control sensor measurements and data collection and storage.

Hardware Component
The monitoring system is based on a programmable microcontroller which manages all measurement and data-collection functions.The Feather M0 Bluefruit LE microcontroller development board (Adafruit Industries, New York, NY USA; https://www.adafruit.com)was selected based on its microcontroller features, built-in Bluetooth wireless capabilities, and connectivity with peripheral hardware components.The microcontroller consists of an ATSAMD21G18 ARM Cortex M0 32-bit processor which operates at 48 MHz and 3.   To reduce the number of jumper wires needed to connect components, components were arranged such that connections between components were made as much as possible using the extra-long male pins on the stacking headers.The headers were first located on the prototyping board and soldered to the board.
The extra-long male pins were then bent over to make contact with appropriate pins on mating components and soldered together.These connections, shown in green on the circuit board in Figure 2, greatly simplified the fabrication of the circuit board.Where this was not possible, jumper wires, shown in red and blue in Figure 2, were cut to length and soldered in the appropriate locations.
A listing of electronic hardware components used to fabricate the monitoring system, along with sources and approximate costs, is provided in Table 1.A completed circuit board, along with electronic components, is shown in Figure 3  Sets of sensors were mounted in four enclosures and attached to a length of aluminum angle stock with self-tapping screws.The enclosures were mounted at 38-in (96-cm) intervals to match the crop row spacing in the fields to be monitored.The monitoring system circuit board and electronic monitoring components were installed in the same type of enclosure, as shown in Figure 5, and mounted at the center of the aluminum angle.Cables were installed on the sensors in each box and connected to the appropriate headers on the system circuit board.
Construction of the monitoring system was accomplished using simple hand tools and commonly found materials.Fabrication of the circuit board and cables, modification of the protective enclosures, and attachment of the enclosures to    The program then enters the main routine, which loops and repeats continuously as long as the microcontroller is powered.The routine begins by reading the latest data stream from the GPS receiver and parsing the data stream into its individual data values, which include latitude and longitude, date and time, speed and direction heading, and number of satellites in view and quality of the GPS signal.Subroutines are then called to read the IRT sensors, read the ultrasonic sensors, store the GPS and sensor data to the micro SD card, and output the data via Bluetooth radio.Program execution then returns to the beginning of the main routine and repeats.

Software Component
The four IRT sensors are read sequentially using the I2C communications protocol.The four sensors are connected to and communicate over the same two I2C-port pins on the microcontroller.Each sensor has a unique address, which allows the microcontroller to specify which sensor is to be read.Upon being specified, the sensor's internal electronics perform a temperature measurement of objects within its field of view, and store the measurement value in internal memory registers.The microcontroller sends a request to the sensor, retrieves the values from the registers, and calculates the temperature based on the register values and the sensor manufacturer's calibration equation.The sensor also measures its own body temperature, which the microcontroller collects as a measure of the ambient air temperature.Previous testing and experience with this IRT sensor [3] have shown the sensor to return measurements with an accuracy within ±0.3˚C and repeatability among multiple sensors with a standard deviation of ±0.04˚C.
The four ultrasonic sensors are next read sequentially.Each sensor makes distance measurements using two pins, labeled Trigger and Echo, which are connected to two digital microcontroller pins.The microcontroller initiates a distance measurement by sending a signal to the Trigger pin, which instructs the sensor to emit an ultrasonic pulse.An internal timer in the microcontroller begins measuring the time that elapses until the pulse strikes an object and the return pulse is detected on the Echo pin.Distance is calculated based on the elapsed time and the speed of sound.The speed of sound, which varies with air temperature, is first calculated based on the ambient air temperature measured with the IRT sensor.The elapsed time is divided by two to determine the one-way travel time of the pulse from the sensor to the object, and this time is then multiplied by the speed of sound to determine distance.Plant height is calculated later by subtracting this distance from the height above ground of the sensor.Previous testing and experience with this ultrasonic sensor [19] have shown the sensor to return measurements with errors of less than 3 mm.
GPS and sensor data are stored to the micro SD card in space-delimited, plain text format.The data are then output via the Bluetooth radio for viewing in real time in the field at an update rate of approximately 2 seconds.The output can be viewed to ensure that the GPS receiver has a fix and is receiving reliable location data, and that all sensors are properly connected and sending reliable measurements.

Field Trial
The plant-canopy monitoring system was deployed and tested during the 2017 growing season at one of the USDA Agricultural Research Service's Crop Pro- monitoring system, consisting of four sensing units and the main electronics circuit mounted on aluminum angle stock, was installed on an agricultural spray vehicle.Two interconnected aluminum-angle braces were fixed to the front of the spray vehicle, and the monitoring system was attached to the braces.The mounted system is shown prior to field monitoring in Figure 6.
The monitoring system was operated in a field planted to soybean.The system was powered up and allowed time for the GPS receiver to obtain a location fix, with a fix occurring within two to three minutes.The Bluetooth output was viewed on a smartphone, and measurements from each sensor were examined to ensure proper functioning of the sensor.With the spray vehicle stationary on a flat surface and the monitoring system operating, the heights of each ultrasonic sensor were recorded, to be used later for subtracting distance measurements to determine plant height.
When the monitoring system is powered up and data are written to the micro SD card for the first time, a header is written to the data file describing the data format and measurement units that will be written.This ensures that the user is certain of the exact ordering of the data, and need not rely on memory or consult the microcontroller program to ascertain the identity of each data value.An excerpt from a data file written to the micro SD card, showing header information and data collected, is displayed in Figure 7.

Conclusions
Open-source hardware and software components were integrated to develop a mobile plant-canopy sensing and monitoring system.The microcontroller-based system incorporated a Bluetooth radio, GPS receiver, infrared temperature and ultrasonic distance sensors, micro SD card storage, and voltage regulation components into a battery-powered, self-contained monitoring instrument.Fabrication of the monitoring system was accomplished with approximately four hours labor, at a cost of US$292.
The system was installed on an agricultural vehicle and tested in a soybean field.The Bluetooth radio allowed real-time viewing of system operation to ensure proper collection of GPS location information and sensor measurements.
Data were stored reliably to a micro SD card for later analysis.
The monitoring system demonstrates an application of open-source hardware to agricultural research and provides a framework for similar or additional sensing applications.The monitoring system could be expanded to collect additional plant-canopy measurements by incorporating other sensors, such as multispectral or color sensors or imaging systems.Monitoring these and other plant canopy characteristics across the field throughout the growing season can provide detailed information for improved crop production, precision agriculture, and phenotyping applications.

Disclaimer
Mention of a trade name, proprietary product, or specific equipment does not constitute a guarantee or warranty by the United States Department of Agricul-

Figure 3 .
Figure 3. Completed prototype circuit board and electronic components.

Figure 4 .
Figure 4. Ultrasonic and IRT sensors installed in protective enclosure; (left) top view, (right) bottom view.

Figure 5 .
Figure 5. Assembled monitoring circuit installed in protective enclosure.

A
microcontroller program was written to manage sensor measurement, GPS location, data storage, and Bluetooth communication functions of the mobile monitoring system.The program was written using the open-source Arduino Integrated Development Environment (IDE), which was downloaded (https://www.arduino.cc)and installed on a personal computer.The IDE enables programming in a language based on C/C++, compiling and error checking of the program, and uploading of the compiled program to the microcontroller.The microcontroller program is freely available by contacting the corresponding author.The program consists of a series of subroutines that control the various functions of the circuit.When the circuit is first powered up, program execution begins with a setup routine in which the Bluetooth radio and serial, I2C, and SPI communications services are initialized.Variables and pins used by the various components are identified, and the update rate (1 Hz) and specific data streams to be output by the GPS receiver are configured.

Figure 6 .
Figure 6.Plant canopy monitoring system mounted on agricultural spray vehicle.

Figure 7 .
Figure 7. Excerpt from data file showing header information and stored data.

Figure 8 .
Figure 8. Canopy height measurements from one trip across the field.

Figure 9 .
Figure 9. Canopy temperature measurements from one trip across the field.
3 V supply.Internal memory includes 256 Kbytes of Flash memory for user-written programming and 32 Kbytes of RAM for temporary data storage during program execution.The development board features access to 20 input/output pins for card interfaces with the microcontroller via the built-in SPI (Serial Peripheral Interface) port and communications protocol.The Adalogger FeatherWing also contains a Real-Time Clock (RTC) with battery backup, enabling date and time-keeping functions and timestamping for datalogging applications, but this capability was not used in the current application.

Table 1 .
List of materials for soil-moisture monitoring system.
. To assemble the circuit, the microcontroller board is inserted into female headers in the center of the prototyping board, and the two FeatherWings are stacked together atop the microcontroller board.The voltage regulation components D. K. Fisher, Y. B. Huang DOI: 10.4236/mi.2017.610016 Modern Instrumentation