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.
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|
|CHPD + VCC||3.7 v|
|GPIO0 + GND||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.