E-cultivation using the IoT with Adafruit cloud

and The IoT sensors based technologies and are working with Adafruit on This research work aims to solve the challenges of cultivation to meet the requirements of the modern world with the help of IoT and predictive data mining techniques. This research article is written for the automation in cultivation by using IoT sensors, which detects data from the real cultivated farms and send it to Adafruit cloud using multiple technologies and protocols. Furthermore, MQTT protocol has been connected with applications for transmission of data. This protocol is providing information to farmers that which weather is best for cultivation by observing the soil nutrients. This can analyze the soil and crop instantly to inform and get the required fertilizer. A web-based application is developed by the authors that are connected with Arduino/Raspberry Pi module and GSM module. Finally, the application sends data by using technologies to the Adafruit cloud. This system will be helpful for the whole life cycle of the crop in the E-cultivation system.


Introduction
*Cultivation is the backbone of developing countries like Pakistan. Today Pakistan is facing a lot of problems like low per hectare yield, the lake of irrigation facilities, waterlogging and salinity, so Pakistan needs a lot of improvements in this field. This research work is written by keeping the difficulties of farmers in mind (Ferrández-Pastor et al., 2018). This automation will provide more relief, and it will create easiness in the life of farms by doing automatic watering the fields because of the sensor's values. It is a combination of IoT and website (Balaji et al., 2018a).
The Internet of Things, or IoT, refers to the billions of physical devices around the world that are connected to the internet, collecting and sharing data (Balaji et al., 2018b). Now it's possible to turn anything, from a pill to an airplane, into part of the IoT. This adds a level of digital intelligence to devices that would be otherwise dumb, enabling them to communicate without a human being involved, and merging the digital and physical worlds (Nayyar and Puri, 2016).
This research contains some sensors like humidity, temperature, soil moisture, HCHO, PH, PIR, and water level, and these sensors will collect the data from the field, and then data will be at a single point in Arduino/Raspberry Pi (Fangquan, 2009). GSM module and water pumping device will be connected to the Arduino/Raspberry Pi; the GSM module will be used to send data to the server, from that server the data will be displayed on the web in the graphical form, which will be easy to understand for the farmer (Pingli et al., 2011). Then by using the data, it will also inform the former that water needed for fields, and from that web, the farmer can control (ON/OFF) the water pump (Balducci et al., 2018;Wolfert et al., 2017). With the help of this research, the farmer will be known if some animal is entered into his field. The farmer can see the detail of the temperature, humidity, water level, PH of the soil, and the motion of animals around the field (Sun et al., 2010).

Literature review
In a startup, they used to monitor the environment of surrounding like temperature and moisture of the soil. For this purpose, they used the Arduino mega, ESP 8266 Wi-Fi module, waterproof temperature sensor and soil moisture sensor they put all these sensors on one stick and put in flower port with the help of the stick they can monitor the temperature and soil moisture on the cloud (Yang et al., 2011). In their project, they are monitoring the two factors temperature and soil moisture of plant and sending this data on the cloud with the help of ESP 8266 WI-FI module, and they are providing power to entire components with the help of solar plate and battery installed in filed for night power supply. Besides, they named it an IoT stick. Following components and sensors used in their project (Gao et al., 2012;Ren et al., 2012). a. Waterproof temperature sensor b. Arduino Mega c. Soil moisture sensor d. Stick In the research paper, they used some sensor for the monitoring of the field they used light sensor, Mq2 gas and smoke sensor, DHT11 for temperature and humidity monitoring and soil moisture (Cai, 2012). Light intensity sensor and all the remaining sensors are recording the data or providing the data of the real environment in real-time. Moreover, after noting the reading, it sends these readings to the cloud where processing is occurred on the data as quickly as possible after processing this data is showed on the webpage where the farmer or any other person related to the crop can (Gayatri et al., 2015) see the real-time data on a webpage in various forms. Before showing data on the web, the Machine Learning Algorithm (KNN) is applied to data to calculate the crop, which is best to grow in the specific field based on the current real-time data. They used a standardized dataset, which has the least requirement of each crop, is maintained and used for the prediction of the crops, which is to calculate (Hsu et al., 2018). Their system also consists of a Virtualization where every data, which collected from the field, plotted concerning the arrival of time. There another feature available which is an SMS sending system based on the specific value of each sensor of you can say if the value is above or below some threshold value, then it will send a notification on the specific number so that necessary action can be taken according to the problem on time, following sensors used in their project (Verdouw et al., 2016).
a. Temperature and Humidity sensor DHT11 b. Gas and smoke sensor (MQ2) c. Soil Moisture d. Light Intensity e. Node MCU The current strategy in farming is the manual technique for checking the parameters; in which landowner utilizes their labor to recognize the development facet of their yield. The landowner himself or herself checks the parameters in their harvest field (Liu et al., 2012;Sinha et al., 2015). They utilize just the sensor, not the driven dimension of warning it might expend additional time and the vast number of labors. Continuous checking of the yields and support is troublesome. Exact outcomes cannot be acquired. It is difficult to be there in the harvest field, and breaking down the temperature, humidity, and comfort for the yields may not be exact and fulfilled. This may prompt a reduction in harvest yield because of lacking labor and observing (Maureira et al., 2011).
In this paper, thermal imaging will be used for irrigation in the harvest field. No need is required here for adjustment in the outside temperatures when the thermal imaging method is used because it's a noncontact and nonintrusive method. The advantage of using this method that thermal imaging can offer the temperature rate of all pixels in the ground through which we can get an average value. Multiple techniques are used in the thermal imaging process for scheduled irrigation, e.g., image processing and data analytics (Sruthi and Kavitha, 2016). Cyber-physical systems and cloud of things are used in it. The main disadvantage of thermal imaging is that when it gets temperature values from the field, if the values are too closed in range, thermal imaging leads towards inaccurate information taken from the cameras through which objects cannot be differentiable (Pasha, 2016).
In the proposed system, information is collected from the cultivation field through different sensors for crop monitoring (Farahani et al., 2014). Temperature, humidity, and soil moisture sensors are used in it. All the information that is collected from the sensors is then sent to the microcontroller. The information can also be displayed on LCD. And data will be sent to the authorized person. The limitation in this method is sensors working are just limited only for crop monitoring, and it can be enhanced in the future for irrigation and monitoring systems.
In this proposed work area of the field is monitored through embedded system video Water requirement for the crop, different temperatures values, humidity, and soil moisture is measured and send to the controller to take actions according to the information. Animal's intrusion is detected by using an image processing technique in the cultivation field (Arduino, 2019a). Different cameras are placed in the field, and through video surveillance, movement is detected. Images are already stored in the database. When the camera captured the image of an animal, then the picture is resized and converted into a grayscale image. After converting it, then send it to the database if the current picture matured with the stored image in the database, a notification is sent to the person through the GSM module (Arduino, 2019b). A major drawback of the system is it has lighting issues through which the detection of animals can be interrupted. The brightness level may affect the detection in day to night-lights. The stirring plants by wind speed may be measured center picture and little unmoving animals that keep on motionless time as backdrop reflection by the algorithms.

Experimental setup
As discussed in the literature review, we have implemented the e-cultivation system. This system is categorized in two types, the first type is called the implementation of E-cultivation hardware details, and in the second part, he software details and webbased application are discussed.
Hardware like Raspberry Pi, Arduino, YL69, DTH11, PIR, LCD, water pump, and PH sensor are used to monitor fields. Our work is done in this sequence.
a. Receiving data from sensors b. Data communication between Pi and Arduino through the serial port c. Data is sent by Raspberry Pi to the cloud and also received. d. Cloud data is sent to the web and displayed in gauges and graphs. e. The web has buttons to control the buzzer and water pump in emergencies. f. The communication between Pi and Arduino is done through JSON data. g. 75% Python and 25% C++ are used. Fig. 1 shows the proposed model diagram that is the whole system architecture. The detail of complete hardware, which is used in this research work is discussed as follows.

Arduino
Arduino Uno is a microcontroller board that is shown in Fig. 2. It has 14 digital pins out of which six of them are PWM, and it has 6 Analogue pins in our case two DHT11, soil moisture YL-69, PH sensor, water pump Buzzer, and ultrasound sensor is connected with Arduino UNO R3. Arduino and Raspberry Pi are both communicating with each other through a serial cable. Arduino connected at tty/ACM0 port of Raspberry Pi.

Raspberry Pi
Raspberry Pi is also a microcontroller and is the main component and used as a controller, as shown in Fig. 3. Here we will use it as a controller and all the components connected to it like sensors. Raspberry Pi is responsible for sending and receiving data from the cloud. A display unit known as LCD is connected with it. All of the data is also displayed on it. Our project, Arduino and Raspberry Pi, both are communicating with each other through a serial cable. Arduino connected at tty/ACM0 port of Raspberry Pi.

Proximity sensor
The proximity sensor used to detect the presence of nearby things, as shown in Fig. 4. It sends electromagnetic radiation, and these radiations got changed due to some movement. It detects movement when any sort of change is detected in the signal. It returns digital value "0" or "1". Zero means no presence, and 1 shows the presence of some nearby object. Two PIR sensors are used, one PIR sensor is used with Arduino using pin no 8 and second one PIR sensor used with Raspberry Pi using pin no 4.

DTH11
The DHT11 is a basic sensor for the measurements of humidity and surrounding temperature (Fig. 5). Its working is based on capacitance. It measures temperature and humidity by a change in capacitance plates. It has analog pins that mean they are analog sensors. Two DHT sensors are used, and a DHT11 sensor is connected with Arduino at pin no A2, and the second one DTH11 sensor is connected with Raspberry Pi at pin no A3.

Liquid crystal display (LCD)
Mostly LCD is used in projects, they are available in little home appliances like UPS, and many other things they are used to display some sort of data. Usually, it displays ASCII characters. It has 16 columns and two rows. LCD is the most common message display device used to display ASCII character. It is also known as a liquid crystal display unit, which is shown in Fig. 6.

Soil moisture YL69
It is a volumetric sensor used to sense the moisture of the soil, as shown in Fig. 7. It gives an analog value between 0 to 1023, and 0 and 1 in digital form 1 mean the soil is dry and 0 means the soil is wet. Two YL-69 sensors are used; one is connected with Arduino at the following pins A0, A1, 13, and 12.

Sound sensor
SR04 ultrasonic sound sensor used to find the distance of the object, it has two portions trigger and echo, and the trigger is for the generation of sound waves and echoes to receive the reflected sound waves. It calculates the distance by sending a sound wave from the trigger and through echo time noted that after how much time waves are returned. It is shown in below mentioned Fig. 8.

Relay and water pump
Here we are using one DC motor, which is a device used to turn electrical energy into some useful mechanical energy, as shown in Fig. 9a. In our case, we will use it to give water to plant. We will use a relay module, as shown in Fig. 9b. Which is a circuit that can be controlled (ON/OFF) by providing a small amount of current.

PH sensor
PH sensors are used to find out the PH of different things, e.g., soil, water, and many other things, as shown in Fig. 10. We are using a PH sensor to find out the PH of the soil. It has a range of 0 to 14. PH 7 means that result is neutral, if PH less than 7, which shows an acidic result, and if PH greater than 7, that shows the basic result. Diagram as per the proposed model for the Acquisition and sensing system in the cultivation field. Which the model shows all the sensors and the Internet cloud, E-Cultivation system with clouds, are connected via the Arduino IDE Software platform. Fig. 11 shows the hardware-based support circuit model and shows the Arduino IDE based circuit diagram and Fig. 12 shows the Raspberry Pi based circuit diagram for measuring and monitoring systems in cultivation fields about the proposed Raspberry Pi Circuit Diagram for measuring and monitoring systems in cultivation fields. This purposed circuit is connected with the domain model and the Adafruit cloud.

Arduino IDE software
Arduino IDE is integrated software development. Arduino and Arduino device functions to encode data by using the help of the Microcontrollers. This connects with sensors and other hardware Categories: Board components and operation are both places in global control with the help of library functions.

Results and discussion
Once it has been established coding without error, the program runs, and you can see the sensor output into a room as a platform 16x2 LCD and the district Internet transfer to E-Cultivation data to Adafruit cloud, and we cannot look to a global platform. Fig. 13 shows on the project LCD considered valid parameters as output format such as temperature, humidity, rain, heat, light, and air quality, and this result displayed on the panoramas LCD screen.

E-cultivation IoT with Adafruit cloud results
Fig. 14 shows the output result graphically through the E-cultivation IoT base Adafruit cloud. If you want to see this result, first, you should come to the E-Cultivation website and create an account with a username and password, and then you should able to see these results.

Conclusion
This research paper is written for the automation in cultivation by using the cloud and its MQTT services. Some sensors like humidity, temperature, soil moisture, HCHO, PH, PIR, and water level, these all sensors will collect the data from the field and then data will be at a single point in Arduino/Raspberry Pi.
GSM module and water pumping device will be connected to the Arduino/Raspberry Pi; the GSM module will be used to send data to server, from that server the data will be displayed on the web in the graphical form, which will be easy to understand for the farmer. Then by using the data, it will also inform the former that water needed for fields, and from that web, the farmer can control (ON/OFF) the water pump. This research paper is written for the automation in cultivation by using the cloud and its MQTT services.

Fig. 14: E-Cultivation IoT with Adafruit output results
Some sensors like humidity, temperature, soil moisture, HCHO, PH, PIR, and water level, these all sensors will collect the data from the field and then data will be at a single point in Arduino/Raspberry Pi. GSM module and water pumping device will be connected to the Arduino/Raspberry Pi; the GSM module will be used to send data to the server, from that server the data will be displayed on the web in the graphical form, which will be easy to understand for the farmer. Then by using the data, it will also inform the former that water needed for fields, and from that web, the farmer can control (ON/OFF) the water pump.

Future works
In the future, we suggest that this architecture is implementing the Biological parameter for sensing humidity and water percentage. This system installs in different pond locations. It's also imposing in the future for the water distribution system, especially in cultivation fields and canals and collects data of water and sends it to the Adafruit cloud by using IoT.