Saturday, November 23, 2024

IoT Mesh Network Agriculture System

Watering various herbs, shrubs, crops and indoor decor plants at the right time with the right amount of water is essential for their productivity and growth, though care needs to be taken while doing so. Excessive water can cause soil erosion, deplete nutrients such as nitrogen present in pores of soils and can also cause plant root decay. At the same time, a lack of water can damage plant growth, resulting in their death. Therefore, an appropriate amount of water is needed for each plant. All plants can’t be watered based on the same measurements from a single soil sensor. The water needs of each plant depend on various factors like soil type, land topography, sunlight exposure etc.

To realise it, today, with the help of this IoT project you will learn how to create a mesh network-based device. It has a central node and several child nodes that are equipped with a soil sensor. The sensor node is inserted in the soil near each plant’s root to take readings and transfer them to the central node. Upon receiving the data from each child node, the central node triggers a valve to provide water only to that particular plant (and not to all plants). 

- Advertisement -

Bill Of Material

Build your project by shopping the following electronics:

- Advertisement -

Coding 

Two pieces of code are required for the mesh device: one for all the child nodes whose job is to take readings from the soil sensor and transfer it to the central node, and another for the central node to check which plant requires water and then send a signal to open the valve. 

So first let’s create the code for the log nodes i.e. child nodes. For this, some libraries need to be installed in the Arduino IDE. Also, a few ESP boards need to be added to the Arduino IDE for compiling and uploading the code to them. To do this, go to the board manager option in the Arduino IDE menu and search for esp8266 and esp 32 boards. Then select install.

Fig 1. Log child node code setting mesh network

Central Node Code

Here you will learn to create the central node code that will check the child nodes available for mesh connection, manage their data and process it to trigger the correct valve for water flow control. 

Uploading the code 

To upload the code, the module needs to be programmed using either an Arduino UNO or FTDI/ESP 8266 programmer module.

Esp8266  FTDI /ESP 8266 01 programmer
RX TX
TX RX
CHPD + VCC 3.7 v
GPIO0 + GND GND

Connection 

Testing 

After connection, power all the nodes and put the sensor in the soil. Then connect the central node to a PC to get soil data from all the nodes.

Download Source Code

This article is a part of the Top 30+ IoT Projects | IoT Project Ideas for Enthusiasts. If you want to read more interesting IoT Projects can go through this article.
Ashwini Sinha
Ashwini Sinha
A tech journalist at EFY, with hands-on expertise in electronics DIY. He has an extraordinary passion for AI, IoT, and electronics. Holder of two design records and two times winner of US-China Makers Award.

2 COMMENTS

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Electronics News

Truly Innovative Electronics

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics