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 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).
Bill Of Material
Build your project by shopping the following electronics:
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.
FTDI /ESP 8266 01 programmer
CHPD + VCC
GPIO0 + GND
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.