MINI PROJECT - AUTOMATIC WATERING PLANT USING BLYNK
192011145
R2427-MICROELECTRONIC ENGINEERING
Have you ever worried about your plant when you are away from them? afraid not as this project will make sure that your plant receives the necessary amount of water with a one-click of your phone.
Here's a list of component that you need :
ESP32
1CH Active H/L 5V OptoCoupler Relay Module
Micro Submersible Water Pump 3v-5v
Tube
4xAA Battery Holder C/W Cover
4xAA Battery
Jumper Wire
Source code :
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";
#define WATER_PUMP 27
boolean state = false;
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(WATER_PUMP, OUTPUT);
}
void loop()
{
Blynk.run();
}
BLYNK_WRITE(V1)
{
if (state == false) {
state = true;
Blynk.notify("You just watered your plant.");
digitalWrite(WATER_PUMP,HIGH);
delay(1000);
}
else {
state = false;
digitalWrite(WATER_PUMP,LOW);
}
}
Testing your project :
Project's specimen & component
Comments
Post a Comment