A low-cost phenological station as a support tool for viticulture

A new prototype of phenological station is presented. It is based on the Raspberry Pi zero W single board computer for collecting and sending images via WiFi, and on the Arduino MKR WAN 1300 microcontroller to measure both air temperature and relative humidity, leaf wetness, and for sending data through the LoRaWAN protocol (Long Range and Wide Area Network). The components are soldered on a customized printed circuit board (PCB), called Raspberrino. The device also consists of a realtime clock and power management board (Witty Pi 3 Mini) to schedule ON/OFF sequences with a simple script, and finally, as an option, a photovoltaic panel, battery and voltage regulator to provide autonomous power supply. Some parts have been obtained by 3D printing. The prototype has been installed in an experimental vineyard and has met the expectations and it will be used for the creation of an experimental network, that will provide data and images, useful for a proper vineyard’s management and for the implementation of phenology models. New technologies make it possible to create innovative tools in a short time and at low cost to match an increased need for precise crop management.


Introduction
The knowledge of the development phase of the vine in the open field is crucial for a proper management of the vineyard, but also for the evaluation of climatic anomalies and interannual variability. As an example, frost risk, crop protection, irrigation management, grape ripening models and the harvest time are linked to the phenological stage.
One of the most evident effects of climate change is the anticipation of the phases of vegetative growth and the shifting to higher elevations and latitudes of the cultivations.
In viticulture, an example of this trend is the highest vineyard in Trentino Alto Adige, located in the Guggal-Anterivo area at 1150 m a.s.l. The raising of crops exposes growers to new challenges such as the frost risk (both winter and spring), different crop protection management, irrigation and the organization of harvest. Moreover, modifications in alpine ecosystems lead to changes in the landscape and in the dynamics within plant and animal communities, introducing potential conflict situations, due to change in landscape suitability vocation and, consequently, in the use of the territory. For a long time, phenological monitoring has been based on the direct in-field observation of the growth stages, achieved by agronomists and experts.
To each development status can be assigned a code on the basis of phenological scales, such as the international BBCH scale [1] [2] or simplified scales such as within the IPHEN -Italian PHEnological Network project [3].
Nowadays, the use of images and the multiscale approach (Liu, 2021), from digital cameras, with high spatial and temporal resolution, up to satellite data (NASA-MODIS and Copernicus Landsat and Sentinel) are increasing.
An example of detecting the seasonal evolution of plant ecosystems by time-lapse imaging is represented by the international PhenoCam network [5] [6].
The PhenoCam project provides automated nearsurface remote sensing as digital images of vegetation, which are processed in a consistent way to track seasonal changes in vegetation greenness. Sadly, the cameras used within the context of the project are rather expensive and outside the price range of your average naturalist or interested citizen scientist (see also: https://phenocam.sr.unh.edu/webcam/ Last accessed on August 26, 2021).
As a cheap alternative, Koen Hufkens developed the PhenoPi indoor system based upon a Raspberry Pi and camera. The project is currently in development, with a working prototype and a public repository to support the installation and provide documentation (see also: http://www.khufkens.com/phenopi/ Last accessed on August 26, 2021).
Based on Hufkens' PhenoPi camera, FEM built in 2017 the PhenoPiCam setup, an outdoor, solar-powered low-cost system, which consists in a computer board (Raspberry Pi 3) equipped with 8 MPixels module (RPi Camera v2 and/or RPi NoIR Camera v2) contained in a waterproof enclosure, and powered by a small solar panel, in order to provide 3-hourly time-lapse images of a vineyard.
In 2014, iXem Labs Foundation (Politecnico di Torino, Torino, Italy) developed iXemWine, a webcam/datalogger system consisting in a small outdoor camera as a node of a low-energy and long range wireless sensor network, which can cover vast areas and still transmit high-resolution images and meteorological data to a base station. The system consisted of a main station (master), connected to the web by 3G network, and nodes (slaves) to be installed in the vineyard and communicating with the master station by means of a patented wireless protocol. This product is no longer available.
Finally, there are several new tools assisting winegrowers and agronomists in surveying activities, such as apps for smartphones, electronic field books and weather stations.
Based on the results of the EIT Climate-KIC "PhenoPiCam" project (in collaboration with CNR-Ibe in Florence and YetiSystems in Pineta di Laives), a new lowcost device with innovative features is presented.

Material and methods
The device consists of several commercial components mounted on a customized printed circuit board (PCB) designed.
Specifically, the diurnal hourly time-lapse images are captured by the 8 MPixel Raspberry Pi camera module V2 (Raspberry Pi Foundation, Cambridge, UK) connected to the Raspberry Pi zero W single board computer. Each image consists of 3280 x 2462 pixels and the final size of the jpg file is about 5 MBytes.
Images are sent back to the server via WiFi, by means of file transfer protocol (FTP) services.
Meteorological data are acquired by an Arduino MKR WAN 1300 microcontroller, which uses Long Range and Wide Area Network protocol (LoRaWAN) for data transmission. Air temperature and relative humidity are measured by an AM2315 encased I2C digital sensor (Adafruit, New York City, NY, USA).
A capacitive leaf wetness sensor (LWS MK1, YetiSystems, Pineta di Laives, BZ, Italy) is also included in the setup to provide crucial data for crop protection modelling.
To schedule on/off sequences with a simple script and to reduce therefore current drainage, a realtime clock and power management board (Witty Pi 3 Mini, UUGear, Elst, The Netherlands) has been adopted. At every exact hour the device turns on for 5 minutes before turning off and waiting for the next hour.
The components are soldered on a customized printed circuit board (PCB), called Raspberrino, designed by FEM researchers (Fig. 1).
The board provides all the connections between the components, which require only to be soldered to have an almost ready to use phenological station.
All the components have been enclosed in a waterproof plastic box KF 1600 G (Gustav Hensel GmbH & Co. KG Lennestadt, Germany; Fig. 1).  The first phenological station was mounted on the main pole (Fig. 3) of the vineyard begin of April 2021; the images provide an overview of the vineyard (Fig. 5).
A minimal setup has been mounted in a WP11-15-4G enclosure (Takachi Electronics Enclosure Co. Ltd., Kawaguchi-shi, Saitama, Japan) and installed begin of July on a vineyard pole, facing to opposite row (Fig. 4). In this case, the field of view is limited to 3 vines (about 2.5 m), but the images are very detailed (Fig. 6).   Fig. 3. Main phenological station, mounted on the pole of the general electrical panel. On the left, the AM2315 digital air temperature and humidity sensor is hosted in a 3D-printed radiation shield, which supports also the capacitive leaf wetness sensor.
Each Raspberry Pi zero W computer board is registered into an OpenVPN private network to ensure the connection to the server (Linux-Ubuntu) for file transfer, as well as, the remote access over a secure connection (SSH), which, in turn, allows changes in the ON/OFF scheduling script or uploading a new sketch (sequence of commands) into Arduino, and, finally, to upgrade the operating system (Raspbian) of the Raspberry Pi zero W single board computer. The Arduino code has been written, compiled, and uploaded according to the manufacturers' online guidelines.
The instructions include the functions to read the sensors, to save the data, as well as the connection parameters to transmit the payload (as array of bytes) to the LoRaWAN network and application service (The Things Network -TTN, The Things Industries).
Finally, the data are stored back into a PostgreSQL database with Python scripts and Message Queue Telemetry Transport (MQTT) protocol services.
Arduino is programmed to collect and send data every minute. As it is powered directly by Raspberry Pi, it also stays on for 5 minutes per hour.

Results and discussion
The raw data consist of diurnal hourly time-lapse images in JPG format and 8 MPixel resolution (Fig. 5-6), and air temperature and leaf wetness data (5 data per hour; Fig.  7).
In addition, the midday images are resampled to 800x600 pixel resolution and assembled in animated gif to provide a time-lapse video.
Air temperature/humidity from the low-cost digital thermo-hygrometer AM2315 have been compared to more expensive and research-grade sensor as the MP100 (Rotronic AG, Bassersdorf, Switzerland; data not shown), but no significant differences has to be reported. The major limitation is due to the limited sampling frequency (5 data per hour), caused by the Raspberry Pi on/off sequences. An increase in sampling would be possible with changes in the scheduling script, but, in turn, this would increase the power requirements of the system and the amount of transmitted data.
Raw leaf wetness data presents picks of the signal in correspondence of presence of water on the sensor's surface; a threshold value must be defined by the user to assign the wet/dry status.   6. Image taken by the camera inside the vineyard (Fig. 4).   Fig. 7. Scatterplots of air temperature (cyan), humidity (red), and leaf wetness (green) from the data collected every hour for 5 minutes and 1 measurement/minute.

Conclusions
The new phenological station has met the expectations, and it will be used for the establishment of an experimental phenology network, in collaboration with local wineries and with the support of an Internet of Things start-up.
The main goal was to provide new tools and services to support improved, more efficient, and sustainable practices in agriculture, based on cost effective openhardware systems.
The presented phenological station will be useful to optimise the production systems, by reducing both economic and environmental costs in terms of number and timing of the treatments, monitoring activities, water use.
Meteorological data and images will feed irrigation, pest control, and ripening models.
A network of stations over the wine-growing regions will reduce the necessity of field visits.
Digital photography will offer advantages, since digital images can be mathematically processed to detect and enhance patterns and/or to classify objects; moreover, digital photographs can be archived for future analysis.
An estimate of greenness and counts of individual flowers could be extracted by way of mathematic algorithms from the photo time-series.
Time-lapse photography, coupled with site-specific meteorology measurements, could greatly enhance our understanding environmental triggers of phenology events.
In addition, the new and low-cost tool could be easily adopted in citizen science projects as well as by agronomists and "digital farmers".
I would like to thank my colleagues Gonzalo Ricardo Cervantes, Ivan Piffer and Luca Delucchi for their support.