Smart Agriculture System using Internet of Things (IoT)
*This project was done in collaboration with Mr. Nikhil Gupta and Mr. Roydon Jude Pereira*
INTRODUCTION:
What is IoT?
The internet of things, or IoT, is a system of interrelated computing devices, mechanical and digital machines, objects, animals or people that are provided with unique identifiers (UIDs) and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction.
A thing in the internet of things can be a person with a heart monitor implant, a farm animal with a biochip transponder, an automobile that has built-in sensors to alert the driver when tire pressure is low, or any other natural or man-made object that can be assigned an Internet Protocol (IP) address and is able to transfer data over a network.
Increasingly, organizations in a variety of industries are using IoT to operate more efficiently, better understand customers to deliver enhanced customer service, improve decision-making and increase the value of the business.
1.1.2 How does IoT work?
An IoT ecosystem consists of web-enabled smart devices that use embedded systems, such as processors, sensors and communication hardware, to collect, send and act on data they acquire from their environments. IoT devices share the sensor data they collect by connecting to an IoT gateway or other edge device where data is either sent to the cloud to be analyzed or analyzed locally. Sometimes, these devices communicate with other related devices and act on the information they get from one another. The devices do most of the work without human intervention, although people can interact with the devices -- for instance, to set them up, give them instructions or access the data. The connectivity, networking and communication protocols used with these web-enabled devices largely depend on the specific IoT applications deployed. IoT can also make use of artificial intelligence (AI) and machine learning to aid in making data collecting processes easier and more dynamic.
1.1.2 How does IoT benefit organizations?
The internet of things offers several benefits to organizations. Some benefits are industry-specific, and some are applicable across multiple industries. Some of the common benefits of IoT enable businesses to:
- monitor their overall business processes;
- improve the customer experience (CX);
- save time and money;
- enhance employee productivity;
- integrate and adapt business models;
- make better business decisions; and
- generate more revenue.
IoT encourages companies to rethink the ways they approach their businesses and gives them the tools to improve their business strategies.
Generally, IoT is most abundant in manufacturing, transportation, and utility organizations, making use of sensors and other IoT devices; however, it has also found use cases for organizations within the agriculture, infrastructure, and home automation industries, leading some organizations toward digital transformation.
IoT can benefit farmers in agriculture by making their job easier. Sensors can collect data on rainfall, humidity, temperature, and soil content, as well as other factors, that would help automate farming techniques.
1.2 Arduino
Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or IDE (Integrated Development Environment) that runs on the computer, used to write and upload computer code to the physical board.
The Arduino platform has become quite popular with those just starting out with electronics. Unlike most previous programmable circuit boards, the Arduino does not need a separate piece of hardware (called a programmer) in order to load new code onto the board -- you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks out the functions of the micro-controller into a more accessible package.

Figure 1.1: Arduino Uno
1.3 Node-RED
Node-RED is a flow-based programming tool, originally developed by IBM’s Emerging Technology Services team and now a part of the JS Foundation. Invented by J. Paul Morrison in the 1970s, flow-based programming is a way of describing an application’s behavior as a network of black-boxes, or “nodes” as they are called in Node-RED. Each node has a well-defined purpose; it is given some data, it does something with that data and then it passes that data on. The network is responsible for the flow of data between the nodes.
It is a model that lends itself very well to a visual representation and makes it more accessible to a wider range of users. If someone can break down a problem into discrete steps, they can look at a flow and get a sense of what it is doing; without having to understand the individual lines of code within each node.
Node-RED provides a browser-based flow editor that makes it easy to wire together flows using the wide range of nodes in the palette. Flows can be then deployed to the runtime in a single click. JavaScript functions can be created within the editor using a rich text editor. A built-in library allows you to save useful functions, templates or flows for re-use.
The lightweight runtime is built on Node.js, taking full advantage of its event-driven, non-blocking model. This makes it ideal to run at the edge of the network on low-cost hardware such as the Raspberry Pi as well as in the cloud. With over 225,000 modules in Node's package repository, it is easy to extend the range of palette nodes to add new capabilities.
The flows created in Node-RED are stored using JSON which can be easily imported and exported for sharing with others. An online flow library allows you to share your best flows with the world.

Figure 1.2: Schematic view of Node-RED window
1.4 Polyhouse Farming
1.4.1 What is Polyhouse Farming?
Polyhouse is a type of greenhouse where a specialized polythene sheet is used as a covering material under which the crops can be grown in partially or fully controlled climatic conditions.
Traditionally, the greenhouses were constructed on wooden frames where the glass was used as a cladding material. With the advancement of plastic technology, it became possible to replace glass with plastic material. Polyhouses are more suitable for tropical and subtropical regions like India.
Modern-day playhouses are built on G.I. steel frames and are covered with plastic, which is fixed on the frame with aluminum grippers. The white plastic film used for covering is of high quality; 200 microns thickness, with 3 years guarantee against degradation due to UV and weather. Mostly drip irrigation system is installed inside a playhouse for watering purposes.

Figure 1.3: Polyhouse Farming
Exotic vegetables like colored capsicums, cucumber, cherry tomatoes, zucchini, and nursery plants are mostly grown in poly houses.
1.4.2 Site Requirements for Polyhouse Farming
One requires a minimum of 1000 sq. mt. of the area to raise a commercially viable polyyhouse. The availability of a continuous source of quality water is also essential. The site of construction should be higher than the surrounding land. The selected site should be pollution-free. Finally, there should be a facility of good roads for transport of polyhouse produce to nearby markets.
1.4.3 Advantages and Disadvantages
Polyhouse protects the crops from wind, rain, radiation, precipitation, and other climatic factors. It creates a microclimate surrounding the crops that help in maximum growth regarding production and quality. Polyhouse also provides higher concentrations of CO2 to increase the production to maximum level; therefore, polyhouse yields are way higher than open-field cultivation. You can grow the plants in polyhouse conditions that are otherwise impossible to cultivate in that particular climatic zone. For example, growing strawberries in the plains of India. Polyhouse crops can give maximum profit in a minimum area under cultivation. With a maximum level of automation, the number of manual activities, dependency on labor, and overall labor cost are reduced.
Polyhouse farming comes with its own share of disadvantages. The production cost is very high, and a significant amount of initial capital investment is required. The polyhouse cultivation involves high maintenance farming and requires continuous vigilance. Technical knowledge is essential for running a polyhouse, and a skilled supervisor and trained laborers are required to perform daily activities. Polyhouse farming is too much dependent on chemical fertilizers and pesticides, and still, there is less scope for organic agriculture. Finally, increasing temperatures during summers can sometimes damage the cladding of polyhouse farming.
2. ARDUINO IDE
The components and applications used are Arduino Microcontroller, MIT App Inventor,
Node-RED and IFTTT. The sensors and modules used are DHT11, Soil moisture sensor, 16*2 LCD display, and a Bluetooth HC-05 Module. The DHT11 measures the temperature and humidity in the atmosphere. The soil moisture sensor reads the moisture content in the soil. The LCD 16*2 display displays the value of the sensor readings on the screen. Finally, the Bluetooth HC-05 module is used to send the data to the MIT App via Bluetooth.
The code for the study was programmed into the Arduino microcontroller using the Arduino IDE where various libraries have been used for different modules.

Figure 2.1: Arduino IDE
The sensors were connected with the microcontroller through jumper wires and breadboard. The DHT11 sensor records the values of temperature and humidity in the atmosphere soil sensor was put in the garden to measure the moisture in the soil.

Figure 2.2: Hardware Interfacing
Now, the data which was read by the sensors were displayed on the LCD screen.

Figure 2.3: LCD Display
3. MIT APP INVENTOR
MIT App Inventor is an online platform designed to teach computational thinking concepts through the development of mobile applications. Students create applications by dragging and dropping components into a design view and using a visual blocks language to program application behavior.
After this, a basic mobile application was created using the MIT App Inventor. Bluetooth was integrated with the application using the blocks.
The blocks were programmed as followed:
First, a list was created which contained three options
- Check Temperature
- Check Humidity
- Check Soil Moisture
As soon as any of these buttons were clicked, the value of the same was displayed in the text box below the respective buttons as shown in Figure 3.4.

Figure 3: App Display
This value was received via the Bluetooth HC-05 Bluetooth Module which was connected with the Arduino.
4. NODE-RED and IFTTT
Node-RED provides a browser-based flow editor that makes it easy to wire together flows using the wide range of nodes in the palette.
IFTTT derives its name from the programming conditional statement “if this, then that.” What the company provides is a software platform that connects apps, devices, and services from different developers in order to trigger one or more automation involving those apps, devices, and services.
Also, the data was sent to the Node-RED server. This was done using a web server and storing the IP address of the HTTP server in the MIT App.
The sensor data once received from MIT app through HTTP request, was then displayed on the Node-UI dashboard. Actions were performed using the IFTTT service which triggered a notification to the phone depending on the weather conditions inside the polyhouse and the moisture level of the soil.
Using Google Assistant, the devices could be easily controlled using simple voice commands. Apart from this the weather and satellite imagery data were fetched from their respective APIs and shown in the UI which refreshes from time to time.

Figure 4.1: Node connections in Node-RED

Figure 4.2: Notification from IFTTT

Figure 4.3: Using Google Assistant to open rooftop and switching off the water pump

Figure 4.4: Node-RED Dashboard
Video Link: https://www.youtube.com/watch?v=k8JCJrHr0mU
REFERENCES
[1] Ratnaparkhi S, Khan S, Arya C, Khapre S, Singh P, Diwakar M, Shankar A, Smart agriculture sensors in IOT: A review, Materials Today: Proceedings (2020)
[2] Parameswaran G, Sivaprasath K, Arduino based Smart Drip Irrigation system using Internet of Things, International Journal of Engineering Science and Computing (2016)
[3] Pandey A.K., Chauhan , IOT Based Smart Polyhouse System using Data Analysis, International Conference on Issues and Challenges in Intelligent Computing Techniques (2019)
[4] Raja. G , Rajarathinam. D. R. P , Abhiraj. R , Arunkrishnan, Febin Malik, Jesu Jorof Divin. J , Smart Polyhouse Farming using IoT Environment, International Journal of Trend in Scientific Research and Development (ijtsrd), ISSN: 2456-6470, Volume-2 | Issue-3, April 2018
[5] M. Ayaz, M. Ammad-Uddin, Z. Sharif, A. Mansour and E. -H. M. Aggoune, "Internet-of-Things (IoT)-Based Smart Agriculture: Toward Making the Fields Talk," in IEEE Access, vol. 7, pp. 129551-129583, 2019, doi: 10.1109/ACCESS.2019.2932609.
[6] U. Shafi et al., "A Multi-Modal Approach for Crop Health Mapping Using Low Altitude Remote Sensing, Internet of Things (IoT) and Machine Learning," in IEEE Access, vol. 8, pp. 112708-112724, 2020, doi: 10.1109/ACCESS.2020.3002948.