An IoT-based Precision Agriculture Project for Education in Circuits and Systems

—In this paper, we present how education can be involved in innovative CAS-based solutions and precision agri-culture. We focus on a student project dedicated to plant growth monitoring using the Internet of Things (IoT). The objective was to make the students aware of the need for electronic solutions to sustain food production. They were proposed to design and deploy a network of connected devices using LoRa technology to monitor plants in our engineering school, ENSEIRB-MATMECA. We choose a deployment in LoRa technology in order to master the deployment of the network from the beginning to the end. Their work was divided into 3 parts: sensors, radiofrequency circuitry and data management.

• proposing a concept for agriculture using IoT, • describing data to be collected by IoT, • designing the object, • deploying the object within an IoT network, • collect and display data to the user.The project is limited to the school facilities for material issues.Use cases and network deployment are dedicated to students and staff to motivate more projects and raise ideas.The project has both an educational and a practical target to demonstrate relevance of IoT for precision agriculture as a showcase.
ENSEIRB-MATMECA offers a training on five scientific disciplines: electronics, IT, telecommunications, mechanical and mathematics with advanced equipment and software, a building of more than 20000m 2 at the service of pedagogy and technology transfer.It is focused on innovative projects and relies on performance of its research centers (IMS, LaBRI, I2M, IMB), recognized nationally and internationally.The school has forged strong links with large companies, but also with an entire local network of SMEs and startups.It hosts companies and a FabLab within its facilities.
The Radio and Telecommunication Systems specialization (SRT) is offered to 3rd year engineering students (equivalent to a Master 2nd year level) from the Electronics Department.The objective of the training is to provide students: • technical knowledge of technologies, circuits and radio systems and communications, • skills on design and characterization of these systems, • methods of analysis of the quality and security of transmissions.This IoT project is a practical demonstration and application of theoretical lessons learned in the radio training unit deploying.
The students realized this project by combining 2 things.The first, of a global problematic type, concerns the growing difficulties of agriculture [2].It faces an increase in the needs of the growing population.But, it must also suffer from degradation of these production conditions due to global warming and the reduction of arable land, cut off by urban agglomerations.The second, technological, is the emergence of the Internet of Things (IoT) making everyday objects smart and connected.These two things can then be linked by considering the second as potential solution of the first.If IoT could help agriculture by helping it to be more productive or even more economical financially and energetically [3] [4].This paper describes in section 2 what are the technical challenges proposed to the students.Then, it details in section 3 how students have designed their object, both hardware and software, with some experimental results in section 4.

II. DESCRIPTION OF THE PROJECT
The project is to realize a connected object monitoring the living conditions of a plantation.This object therefore requires sensors of physical quantities relevant for the development of this plantation.Among the most common are temperature (air and soil), humidity (air and soil), brightness, pressure and air quality (CO2).The remote monitoring of the data perceived by the sensors requires a system of radio frequency transmission typical of connected objects.Finally, to interconnect these sensors with the radio module, the station is managed by an onboard system that processes the data returned by the sensors before controlling the radio module for sending data to a mother station for receiving and monitoring the data.Students are in charge of selecting sensors and designing the electronics as depicted in Figure 1.The selected radio module is a LoRa module (ref SX1272) which has relevant characteristics for connected objects of this type such as large spans for reduced energy consumption but for low data rates.In addition, the school, the project's geographical test area, is already equipped with a LoRa gateway to a dedicated computer network.The embedded system used to manage the station is an Arduino Nano because these hardware cards are very common for lowpower embedded systems, especially in sensor systems.In addition there are also dedicated sensors for use on Arduino.It is also to these sensors that the choice of those of the station as the Grove101020008 (soil moisture), the LDR ST012 (brightness), the BME680 (temperature, humidity, pressure and quality of the air), except for TMP36 (soil temperature).All these elements are interconnected to form the connected object.
Students have to take into account the power consumption and the budget allocated to the design: • Power consumption: to check the energy coherence of the object, a balance of consumption is drawn up and summarized in Table I below.With a total power consumption estimated at 327.5mW, the goal of making the station more autonomous possible seems possible.This is why is added to the system a 5000mAH battery (Velleman PCMP32), it has a USB output of 5V (1A maximum) can therefore supply the entire system energy for a minimum of 76 hours without reloading.In addition, the battery is equipped with a photovoltaic cell to self-recharge with solar energy making the system fully autonomous energetically.
• Financial: The IoT project has to respect a financial budget of 150eallocated.It is therefore necessary to draw up an assessment of the costs of carrying out such a project.The components are interconnected as depicted in the schematic in Figure 2. The physical implementation also consists of defining a support to contain all the elements of the station in a single portable system but also ergonomic and integrating visually to his environment.This object is designed and realized using the TinkerCAD software and a 3D printer.Students proposed the classic shape of a mushroom, as illustrated in Figure 3.The programming of the Arduino corresponds initially to the reading of the values ââof the sensors and their conversion into an explicit measurement.Only the BME680 is a digital sensor that can be controlled by a dedicated library.The other sensors are analog and thus provide a voltage value representative of the measured physical quantity.This voltage is converted by the analog-digital converter of the Arduino and calibrated by the program.
To manage the sensors within the program, a general sensor mother class.It contains all the attributes and functions that all sensors can have in common.Each sensor is then identified as a daughter class in which the conversion and calibration function specific to each sensor is performed.After initializing and declaring all the sensors, the main program picks up the value returned by a sensor by the read function of the associated class.To check the correct functioning of each sensor, a sending on the serial port of the perceived values ââis realized, as illustrated in Figure 4.
Once the sensors are properly validated, the code dedicated to the module LoRa SX1272 is integrated and interacts with the main program for sending the data frame.Figure 5 shows the activation of the LoRa module, the frame sent to it and then put it in sleep mode to save the battery before a new series of measurements and sending.

B. Radio Frequency Communications characterization
Students are asked to characterize the communication done by their object.The LoRa module used for transmission uses a chip (SX1272) dedicated to LoRaWAN communications.These new telecommunication networks are specialized in long-range transmission and low power consumption, particularly through modulation, speed reduction and spread spectrum techniques.The configurations of the LoRa module controlled by the Arduino program are: • Carrier Frequency: F c = 865.2MHz, BandWidth: BW = 125kHz • Modulation: LoRa, Spreading Factor: SF = 12 • Coding Rate: CR = 4/5, Transmitting power: P T X = 20dBm According to the technical documentation of the SX1272 with these SF , BW and CR values, the theoretical transmission rate is 293bits/s.Our data frame is evaluated at about 80bytes, with the addition of protocol-specific octets sending a complete data series requires between 3 to 4 seconds to the LoRa module.

IV. EXPERIMENTAL RESULTS
The functionality of the prototype is validated by the good reception of data on Grafana originating from measurements, performed by the object and powered on battery.All the components are then integrated into the 3D support, previously painted in the colors of an Amanite (which will give its name to the node on the network).The Arduino, the LoRa module and the BME680 sensor are housed and camouflaged inside the mushroom foot.The Grove and TMP36 floor sensors are attached to the feet while allowing them to fit into the floor.Finally, the solar battery and the light sensor are positioned facing the sky on the mushroom cap for maximum light performance.When data are sent from the LoRa module of the object, it is received by a LoRa receiver module serving as a gateway to the Internet.The LoRa node of the object is identified by a node number (here 32) and each sensor measurement is also preceded by an individual identifier (here 70,71,72,73,74,75 and 76) as visible in the sent data frame by the Arduino at LoRa (cf. Figure 7).This data is then sorted and stored in a database.The Grafana software allows access to this database and to perform varied visual monitoring as illustrated by the measurements of luminosity in Figure 8.
For its real-life test phase, the object is then installed in a planter (cf. Figure 9) where radish plants are being developed.The measurements collected by the object are recorded in the database to follow the conditions of development of the plantation.This student project aims at creating a connected object as a solution for precision agriculture, from the conceptual idea to its physical realization of a complete and aesthetic prototype.The work involved notions of design and system realization, programming with Arduino and the management of sensors and also radio frequency with the use of the LoRa module.

Fig. 1 .
Fig. 1.Assembly of components to design the object

Fig. 4 .
Fig. 4. Data provided by the sensors read on the serial port

Fig. 6 .
Fig. 6.Measurement of the spectrum emitted by the LoRa module

Fig. 9 .
Fig. 9. View of the object in a plantation of radish Table II details the costs of the different