Title Of  Project:
 “Smart Agriculture monitoring moisture by using a Moisture sensor”

Introduction
How a Moisture sensor does it work?
Moisture is critical for plant growth, so a soil moisture meter sensor not only aids in keeping vegetables  during periods of drought but also helps gardeners decide when to water, especially when climate change. Expensive professional meters use a variety of measurement methods, many requiring permanent probes wired together, but home meters are typically handheld devices utilizing electrical resistance or water pressure and a digital interface to measure moisture inside a soil.
In Agriculture Measuring soil moisture is important for applications in agriculture to help farmers manage their system of irrigation in a splendid way which is very effective. Knowing the exact soil moisture conditions on their fields, not only are farmers able to generally useless water to grow a crop, they are also able to increase yields productions  and the quality of the crop by improved management of soil moisture during critical plant growth stages.
In Research Soil moisture sensors are used in numerous research applications, e.g. in agriculture for the Scientific  and other domain  including irrigation planning,  the research on climate changes, on sciences for the environment, and as auxiliary sensors for the respiration of soil measurements.
For our project of monitoring level of water in the soil by detecting moisture, we will use the capacitive moisture sensor and we will upload the data we get on  Ubidot cloud to visualize the change of different states of the soil. The necessary information is shown  in the slides below:

Image of Capacitive Moisture Sensor





Image: Capacitive moisture sensor

Material used to implement on Project

·         Node MCU
·         Capacitive moisture sensor
·         Arduino software of running project
·         Simple  wires male and females for connections
·         The platform of  Ubidots cloud to visualize data


Table of Connection on Node MCU Devices
Moisture Sensor
Node MCU
Ground
Ground
Aout
Ao(Analog pin)
Vcc
3V


Codes to implement project to Ubidot cloud
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
int WET= 16; // Wet Indicator at Digital PIN D0
int DRY= 2;  // Dry Indicator at Digital PIN D4
int sense_Pin= A0; // Soil Sensor input at Analog PIN A0
int value= 0;
const char* ssid = "ClementRegi4";
const char* password = "44448888";
#define TOKEN "A1E-BgFDEzhAYKGbZJ1q1dpWDS5W36Fklw"
#define MQTT_CLIENT_NAME "Janvier"
#define Variable_label "moisture"
#define device_label "moisture-based-project"
const char* mqttbroker = "things.ubidots.com";
char payload[100];
char topic[50];
WiFiClient espClient;
PubSubClient client(espClient);
//Set-Up WiFi
void setup_wifi() {
    Serial.print("Connecting to ");
    Serial.println(ssid);
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED)
    {
      delay(500);
      Serial.print(".");
    }
  randomSeed(micros());
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}
void reconnect() {
  // Loop until we're reconnected
  while (!client.connected())
  {
    Serial.print("Attempting MQTT connection...");
    if (client.connect(MQTT_CLIENT_NAME,TOKEN,""))
    {
      Serial.println("connected");
    } else {
      Serial.print("failed, rc=");
      Serial.print(client.state());
      Serial.println(" try again in 5 seconds");
      // Wait 6 seconds before retrying
      delay(1000);
    }
  }
}
void callback(char* topic, byte* payload, unsigned int length)
{
  }

void setup() {
  Serial.begin(9600);
  pinMode(WET, OUTPUT);
  pinMode(DRY, OUTPUT);
  Serial.println("Moisture test!");
  setup_wifi();
  client.setServer(mqttbroker, 1883);
  reconnect();
}

void loop() {
  client.setCallback(callback);
  if (!client.connected()) {
  reconnect();
  }
  client.loop();
   Serial.print("MOISTURE LEVEL : ");
   value= analogRead(sense_Pin);
   value= value/10;
   Serial.println(value);
   if(value<50)
   {
      digitalWrite(WET, HIGH);
   }
   else
   {
      digitalWrite(DRY,HIGH);
   }
   digitalWrite(WET,LOW);
   digitalWrite(DRY, LOW);
   Serial.print("Publish a message Moisture:");
  int num=value;
  char cm[16];
  itoa(num,cm,10);
  Serial.println(cm);
  sprintf(topic,"%s%s","/V1.6/devices/",device_label);
 sprintf(payload,"%s","");
 sprintf(payload,"{\"%s\":",Variable_label);
 sprintf(payload,"%s{\"value\":%s}}",payload,cm);
 client.publish(topic, payload);
  delay(3000);
}
                                       Image photo of  Project during Implementation


                                
                                     Data on serial monitor




                                   Platform result on Connection of Devices to Ubidots Cloud
  







For more info follows:

YouTube channel: IOT Soil Moisture Monitoring

 

Git hub name: IotSoilMoistureMonitoring



References




























Comments

Popular posts from this blog

Summary Report on Courses of Sensor and Actuators

How Actuators and Actuation technology works ?