Yarana Iot Guru
Published © MIT

๐Ÿ’ง Control Your Water Pump Remotely Using an Android App

Remotely control and monitor your water pump using ESP32 and an Android app. Save water, time, and energy โ€” by YaranaIoT Guru

BeginnerFull instructions provided7 hours64
๐Ÿ’ง Control Your Water Pump Remotely Using an Android App

Things used in this project

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

๐Ÿ’ป ESP32 Sample Code

C/C++
#include <WiFi.h>
#include <WebServer.h>

const char* ssid = "YourWiFi";
const char* password = "YourPassword";

WebServer server(80);
int relayPin = 23;

void handleOn() {
  digitalWrite(relayPin, HIGH);
  server.send(200, "text/plain", "Pump Turned ON");
}

void handleOff() {
  digitalWrite(relayPin, LOW);
  server.send(200, "text/plain", "Pump Turned OFF");
}

void setup() {
  Serial.begin(115200);
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, LOW);
  
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nWiFi Connected!");
  
  server.on("/on", handleOn);
  server.on("/off", handleOff);
  server.begin();
}

void loop() {
  server.handleClient();
}

Credits

Yarana Iot Guru
35 projects โ€ข 0 followers
Yarana Iot Guru Yarana IoT Guru: Arduino, ESP32, GSM, NodeMCU & more. Projects, Tutorials & App Development. Innovate with us!
Thanks to YaranaIoT Guru.

Comments