RaspberryPi-Arduino (RPA) powered smart mirrored and reconfigurable IoT facility for plant science research

Continuous monitoring of crops is critical for the sustainability of agriculture. The effects of changes in temperature, light intensity, humidity, pH, soil moisture, gas intensities, etc. have an overall impact on the plant growth. Growth chambers are environmental controlled facilities which needs to be monitored round‐the‐clock. To improve both the reproducibility, and maintenance of such facilities, remote monitoring plays a very pivotal role. An automated re‐configurable & persistent mirrored storage‐based remote monitoring system is developed with low‐cost open source hardwares and softwares. The system automates sensors deployment, storage (database, logs), and provides an elegant dashboard to visualize the real‐time continuous data stream. We propose a new smart AGRO IoT system with robust data acquisition mechanism, and also propose two software component nodes, (i.e., Mirroring and Reconfiguration) running as an instance of the whole IoT facility. The former one is aimed to minimize/avoid the downtime, while the latter one is aimed to leverage the available cores, and better utilization of the computational resources. Our system can be easily deployed in growth chambers, greenhouses, CNC farming test‐bed setup, cultivation plots, and further can be also extended to support large‐farms with either using multiple individual standalone setup as heterogeneous instances of this facility, or by extending it as master‐slave cluster configuration for communication as a single homogeneous instance. Our RaspberryPi‐Arduino (RPA) powered solution is scalable, and provides stability for monitoring any environment continuously at ease.


INTRODUCTION
Plants life plays a crucial role serving the conduit of energy into the biosphere, provide food, and shaping our environment.With the growth of new technologies, plant science has seen tremendous transformation.David et al. [1] identify the role of technologies to address the challenges faced in Plant Science.With climate change being a major concern, the outdoor farming is threatened, and the fertile land is a limited resource globally.Certainly, the trend is towards indoor cultivation [2][3] [4].
0 Abbreviations: UX, User Experience; GUI, Graphical User Interface; IoT, Internet of Things; CNC, Computer Numerical Control; USB, Universal Serial Bus; I2C, Inter-Integrated Circuit; UART, Universal Asynchronous Receiver/Transmitter; PWM, Pulse Width Modulation; AO, Analog Output; NDIR, Non-Dispersive Infra-Red FIGURE 1 "LOMAS++" -Autonomous Multi-functional CNC cultivation test-bed.But, then just indoor cultivation is not the ultimate end solution.There is always a need for an organized indoor cultivation for maximizing harvest on a smaller surface, with optimized usage of resources, thereby preparing ourselves today for the global need of better tomorrow.In this paper, we introduce our cyber cultivation test-bed -"LOMAS++".It is an autonomous multifunctional CNC-farming test setup, aimed for high quality indoor growth, and monitoring of crops, with an aim to optimize the cultivation, while producing high quality yields.The core purpose being producing healthier and tastier crops/herbs.It is part of the Autonomous Intelligent Machines Exploration & Enterprise (AI.MEE) projects and collaboration between Alfred Nobel Science Park & Örebro University.The LOMAS++ system (Fig. 1) is primarily designed using the aluminium extrusion, plates and brackets which are driven by stepper motors & actuators, microcontroller, and Raspberry Pi computer.The low-level control and logic is based on ROS [5].The telemetry sensors are interfaced through the firmata protocol, while the machine through the G-protocol.The growing area is 125 x 105 cm, and the plants can grow as tall as 30 -35 cm.The system is functional on X-direction, Y-direction, and Z-direction movements along the tracks, gantry, and the cross-slides.Soil loosening, digging and seed plotting can be done using the robotic arm maneuvering operation along the whole test-bed using the program interface, by providing the (X,Y) coordinates as the location point.Firstly, the soil is loosened with the ploughing tool, which runs over the entire bed.Once the cartesian coordinates are specified, the robot arm gets moved to that location point, and the seeding tool starts with the digging operation, after which the seeds are seeded.
In the past, several works have been addressed to monitor the greenhouses, and various controlled growth chambers [6][7][8][9][10][11][12].IoT devices are internet connected things that are capable of collecting data, and sending it through the internet services.IoT security has been a major challenge [15][16][17][18][19]. IoT or sensor data [20] consists of a continuous stream of time-series data, where the time interval between successive updates of data is very small; usually minutes, seconds or even milli-seconds.To cater this, there is always need of a robust solution.The major drawback of the existing works are its heavy pre-configurations required to be done to get started.Further, it requires the users to be familiar with various technologies, and third-party software's before it could be readily used in purpose.The other motivations for such a smart setup, with end-to-end automation is listed below:a.To alleviate the data loss and increase the data availability which is critical to IoT applications.b.Most of the times with Raspberry Pi, the computation becomes a bottleneck.So, there is always a need for optimal resource utilization.
The contribution of this paper is two folds:-1.We propose a facility providing persistent data storage with mirroring, and re-configurable nodes to meet the characteristics of smart IoT systems designed with low-cost devices, alleviating the computational bottlenecks, and to preempt downtime.

2.
A complete automated solution is powered for continuous real-time remote monitoring that is designed and integrated with above key aspects.
The rest of the paper is organized as follows.In Section 2, we describe the system details.Also, an overview of the hardware used are provided.Section 3 concludes with the summary and future work.

Accepted Article
This article is protected by copyright.All rights reserved.

Implementation
The system built consists of various devices like Raspberry Pi, Arduino, and the different sensors (array of gas sensors, pH sensor, temperature sensor, environmental sensor, soil moisture sensor, soil temperature & humidity sensor, lux sensor, and quantum sensor).All these sensors, except the quantum sensor were interfaced to the Arduino using a Real-Time Clock (RTC) to provide real-time timestamps.The quantum sensor being USB-type was interfaced with the Raspberry Pi.The developed monitoring IoT framework is an affordable way to monitor the environment providing persistent data storage, that is modular, as well as scalable.The developed platform is device-agnostic, thereby making it easy to analyze the data from any sensor.The software allows for connecting different sensors, storing the data, and visualizing the incoming raw stream of continuous data with fancy gauges and time charts.The source code is made publicly available in GitHub1 .The proposed system framework is shown in Fig. 2.
As seen in the proposed architecture, two software component nodes are created, i.e., Mirroring and Reconfiguration.The nodes in this context are the software component node that represents an instance of a module running inside the whole application.The advantage of these nodes are as follows:-1) Mirroring node is responsible for maintaining the parallel backup to increase the availability of the data, thereby removing the downtime over a failure.
2) Reconfiguration node is responsible for increasing the flexibility of the software while utilizing parallel processing achieved with threading, that is need of the hour to alleviate memory constraint limitations where the load balancing is distributed over the different cores.

Accepted Article
This article is protected by copyright.All rights reserved.

Hardware Setup
The core of the setup is a single-board computer (Raspberry Pi), and a micro-controller board.The overview of each devices are described below.

Raspberry Pi & Arduino
Raspberry Pi is pocket-sized single board low-cost computer developed by Raspberry Pi Foundation [13].This computing device is very popular and widely used in many industrial & research applications.Arduino [14] is an open-source electronic hardware prototyping platform, that design and manufacture microcontrollers and other related kits.It enables the end-users to create digital projects with this hardware device, which are also widely used.We used the Raspberry Pi B+ model, and Arduino UNO R3 version.The RPi 3 has 1.4 GHz 64-bit Quad-Core processor with 1GB ram.The circuit for the system includes a microcontroller, external power supply (3.3V & 5V), resistors (10K Ω, 4.7K Ω), and the different sensors (gas sensors, pH sensor, temperature sensor, environmental sensor, soil moisture sensor, soil temperature & humidity sensor, light sensor) connected over different modes like I2C, UART, PWM, and analog outputs over the load resistor.Here, only the GND was common to all the devices, while VCC is different for each of the sensor that was powered by the external power supply.

Sensors and other hardware components
Each sensor, and its communication interface is described in the following sub-sections below.

DS18B20 temperature sensor
This is a 1-wire interface temperature sensor that is pre-wired, and water-proofed.The usable temperature range is -55 to 125 degree celsius.A 4.7K Ω resistor, is required as a pull-up from the DATA to VCC line when using this sensor.The Dallas temperature library is parsed with One-Wire library to establish communication with this sensor.

Adafruit BME680 environmental sensor
BME680 can detect a broad range of gases such as Volatile Organic Compounds (VOC) which is one of the key sensor used in our setup.It is a digital 4-in-1 sensor that measures VOC content, humidity, pressure, and temperature.The detection range varies from Temperature (-40 to 85 Celsius), Pressure (300 to 1000 hpa), VOC Gas (0-100 ppm), Humidity (0-100).This environmental sensor contains a small MOX sensor integrated referring to a resistance value, that estimates the overall VOC content.

TSL2561 Lux sensor
It is an advanced digital light sensor.This sensor contains both infrared and full-spectrum diodes, thereby making it possible to measure IR, full range spectrum or visible light range separately.It can detect light range from upto 0.1 -40,000+ lux on a go.

MQ-7 gas sensor
We used the Sparkfun MQ-7 MOX sensor for sensing CO concentration in the air.It can detect CO gas concentration range from 10 to 500 ppm.It can also be used to detect other gases.

SHT1X Soil Temp/Humidity sensor
We used the SLHT5 series, for measuring the soil temperature and humidity.It provides a weather-proof casing that makes it durable in underground soil conditions.The temperature ranges from -40 to 120 degree celsius, while the humidity from 0 -100 % RH.

pH EZO sensor
The Atlas Scientific EZO sensor is used for getting accurate, and precise pH measurements.The best part with this sensor is that we can get pH readings down to the thousands place.The full-range pH reading ranges from .001-14.000

Accepted Article
This article is protected by copyright.All rights reserved.

MH-Flying Fish soil moisture sensor
We used the FC-28 model that measures the moisture content in the soil.We used the analog output values ranging from 0-1023, instead of the digital output available that just indicates the dryness or wetness of the soil.Here, we used three of these sensors placed at different locations in the test-bed.

NDIR(CDM7160) sensor
For measuring CO2 concentration, we used an advanced IR sensor.The NDIR CO2 click model has an integrated CO2 gas sensing system by which one can measure absolute concentration.The main component of NDIR CO2 click is the CDM7160, with a pre-calibrated single light source, dual wavelength, and CO2 sensing system by FIGARO, Inc.The detection range of CO2 is 300 ~5,000 ppm.

Full Spectrum SQ-520 Quantum sensor
Photosynthetically Active Radiations (PAR) quantum sensors, measure the radiation in the frequency used by the plants for photosynthesis in range from 400 to 700 nm.PAR is typically expressed as photon flux in units of micromoles per square per second.We used the SQ-520 full-spectrum model as it features an advanced optical detector providing precise PAR measurements under all artificial lamp source, including the colored LEDs.

RTC DS3231
DS3231 RTC is a low-cost, accurate real-time clock chip with a two-wire I2C interface providing seconds, minutes, hours, day, date, month, and year information.The clock operates either in the 24-hour or 12-hour format.It also incorporates a battery input to provide uninterrupted timekeeping.

Calibration of Gas Sensors
The MOX sensors were calibrated by using the load resistor method.We choose the value for the load-resistor after the burn-in time.The load resistance of 10K Ω was chosen.The NDIR CO2 calibration was obtained by pin-7 of the sensor.When low voltage is applied to this port, a calibration mode is activated.This pin is internally pulled-up.When this pin is connected to low for 2-11 seconds, background calibration is carried out assuming 400 ppm exposure to the sensor.When connected to low for 12 seconds or longer, zero calibration is carried out assuming 0 ppm exposure to the sensor.

CONCLUSIONS
Over the past few years, continuous streaming data from the different sensors are used in varied use-case applications, providing one of the most promising source of real-time data.With cost-effective open-source resources, we design a remote environmental monitoring, and data logging system focused towards plant science research.With such IoT prototype, the data can be gathered round-the-clock providing explicit information and boundless decision-making capabilities.Our proposed system is designed to (1) Alleviate the data loss and increase the data availability which is critical to IoT applications (2) Better utilize computational limitations.The setup comprises of sensor configuration, data acquisition module, mirrored storage module, reconfiguration module, and finally the dashboard module for live visualization.The system is built with open-source hardware's (Arduino, Raspberry Pi), and various open-source software's (Python, HighCharts, JustGuage, Flask, SQLite, etc.).Such, automation of remote monitoring facility with low-cost devices, and open-source technologies can greatly facilitate to accurately maintain the monitoring conditions.The community can leverage this design integrated with key features to quickly prototype, and monitor the environment or chambers or use it for any applications of one's interest.Further, this gives a better chance for faster reproducible experimentation's.The system has the characteristics of simple operation, and interoperability functionalities proving its high application value.The total cost of our Agro IoT prototype (all inclusive) is around USD 1100.We plan to extend this IoT facility to include deep learning possibilities as part of our future work, and also aim to integrate a DL-based intrusion detection system to alleviate the possibility of anomaly being introduced, in case of any attacks.Further, this design can be easily extended to deploy AI capabilities to the core with Edge TPU, Jetson Nano, etc.

Accepted Article
This article is protected by copyright.All rights reserved.

FIGURE 2
FIGURE 2 Structure diagram of the proposed IoT system.