Smart Irrigation using ESP8266 and IoT | IoT plant monitoring system | IoT | Esp8266

Поділитися
Вставка
  • Опубліковано 30 лис 2024

КОМЕНТАРІ • 11

  • @sgn79qed
    @sgn79qed 4 місяці тому +1

    Wow super

  • @Elextrolyte
    @Elextrolyte  2 місяці тому +2

    Here's the code:
    #define BLYNK_TEMPLATE_ID ""
    #define BLYNK_TEMPLATE_NAME ""
    #define BLYNK_AUTH_TOKEN ""
    #include
    #include
    char auth[] = ""; // Blynk Auth Token
    char ssid[] = ""; // WiFi Network Name
    char pass[] = ""; // WiFi Password
    int sensorPin = A0; // Soil Moisture Sensor Pin
    int relayPin = D0; // Relay Pin
    int threshold = 40; // Moisture threshold percentage
    BLYNK_WRITE(V3) {
    int buttonState = param.asInt();
    Serial.print("Button state: ");
    Serial.println(buttonState);
    if (buttonState == 1) {
    digitalWrite(relayPin, LOW);
    Serial.println("Water pump turned ON");
    } else {
    digitalWrite(relayPin, HIGH);
    Serial.println("Water pump turned OFF");
    }
    }
    void setup() {
    Serial.begin(115200);
    Blynk.begin(auth, ssid, pass);
    pinMode(sensorPin, INPUT);
    pinMode(relayPin, OUTPUT);
    digitalWrite(relayPin, HIGH);
    Serial.println("Setup complete. Connecting to Blynk...");
    }
    void loop() {
    Blynk.run();

    int moistureValue = analogRead(sensorPin);
    int moisturePercentage = map(moistureValue, 1023, 0, 0, 100);
    Blynk.virtualWrite(V2, moisturePercentage);

    Serial.print("Raw Sensor Value: ");
    Serial.println(moistureValue);
    Serial.print("Moisture Level: ");
    Serial.print(moisturePercentage);
    Serial.println("%");
    if (moisturePercentage < threshold) {
    Blynk.logEvent("lowmoisture", "Low Moisture Detected!");
    Serial.println("Low moisture detected, alert sent.");
    }

    delay(1000);
    }

  • @bhagyeshgunda9501
    @bhagyeshgunda9501 2 місяці тому

    Even after running the code I am getting an error in the 39th line which is telling me to specify the template ID and name. But I have verified it several times and it's always correct idk why it's showing error

  • @Dehcjemkeihhehu3709
    @Dehcjemkeihhehu3709 2 місяці тому +1

    How can we get the code?

    • @Elextrolyte
      @Elextrolyte  2 місяці тому

      Here's the code:
      #define BLYNK_TEMPLATE_ID ""
      #define BLYNK_TEMPLATE_NAME ""
      #define BLYNK_AUTH_TOKEN ""
      #include
      #include
      char auth[] = ""; // Blynk Auth Token
      char ssid[] = ""; // WiFi Network Name
      char pass[] = ""; // WiFi Password
      int sensorPin = A0; // Soil Moisture Sensor Pin
      int relayPin = D0; // Relay Pin
      int threshold = 40; // Moisture threshold percentage
      BLYNK_WRITE(V3) {
      int buttonState = param.asInt();
      Serial.print("Button state: ");
      Serial.println(buttonState);
      if (buttonState == 1) {
      digitalWrite(relayPin, LOW);
      Serial.println("Water pump turned ON");
      } else {
      digitalWrite(relayPin, HIGH);
      Serial.println("Water pump turned OFF");
      }
      }
      void setup() {
      Serial.begin(115200);
      Blynk.begin(auth, ssid, pass);
      pinMode(sensorPin, INPUT);
      pinMode(relayPin, OUTPUT);
      digitalWrite(relayPin, HIGH);
      Serial.println("Setup complete. Connecting to Blynk...");
      }
      void loop() {
      Blynk.run();

      int moistureValue = analogRead(sensorPin);
      int moisturePercentage = map(moistureValue, 1023, 0, 0, 100);
      Blynk.virtualWrite(V2, moisturePercentage);

      Serial.print("Raw Sensor Value: ");
      Serial.println(moistureValue);
      Serial.print("Moisture Level: ");
      Serial.print(moisturePercentage);
      Serial.println("%");
      if (moisturePercentage < threshold) {
      Blynk.logEvent("lowmoisture", "Low Moisture Detected!");
      Serial.println("Low moisture detected, alert sent.");
      }

      delay(1000);
      }

  • @basiltravellifeadventures1477
    @basiltravellifeadventures1477 Місяць тому +1

    plz give zip file

  • @prashanthv197
    @prashanthv197 4 місяці тому +1

    Where is the code

    • @Elextrolyte
      @Elextrolyte  2 місяці тому

      Here's the code:
      #define BLYNK_TEMPLATE_ID ""
      #define BLYNK_TEMPLATE_NAME ""
      #define BLYNK_AUTH_TOKEN ""
      #include
      #include
      char auth[] = ""; // Blynk Auth Token
      char ssid[] = ""; // WiFi Network Name
      char pass[] = ""; // WiFi Password
      int sensorPin = A0; // Soil Moisture Sensor Pin
      int relayPin = D0; // Relay Pin
      int threshold = 40; // Moisture threshold percentage
      BLYNK_WRITE(V3) {
      int buttonState = param.asInt();
      Serial.print("Button state: ");
      Serial.println(buttonState);
      if (buttonState == 1) {
      digitalWrite(relayPin, LOW);
      Serial.println("Water pump turned ON");
      } else {
      digitalWrite(relayPin, HIGH);
      Serial.println("Water pump turned OFF");
      }
      }
      void setup() {
      Serial.begin(115200);
      Blynk.begin(auth, ssid, pass);
      pinMode(sensorPin, INPUT);
      pinMode(relayPin, OUTPUT);
      digitalWrite(relayPin, HIGH);
      Serial.println("Setup complete. Connecting to Blynk...");
      }
      void loop() {
      Blynk.run();

      int moistureValue = analogRead(sensorPin);
      int moisturePercentage = map(moistureValue, 1023, 0, 0, 100);
      Blynk.virtualWrite(V2, moisturePercentage);

      Serial.print("Raw Sensor Value: ");
      Serial.println(moistureValue);
      Serial.print("Moisture Level: ");
      Serial.print(moisturePercentage);
      Serial.println("%");
      if (moisturePercentage < threshold) {
      Blynk.logEvent("lowmoisture", "Low Moisture Detected!");
      Serial.println("Low moisture detected, alert sent.");
      }

      delay(1000);
      }

    • @mstprova8602
      @mstprova8602 2 місяці тому

      @@Elextrolyte In code you set relayPin = D0 but in the vdo, u r showing to connect relay IN with esp8266 D1