Worried about your plant? Here is the solution.
- Eswar Reddy
- Jul 16, 2021
- 4 min read

"I don’t have the time " One of the most heard line in this modern world yet still most people love to grow plants on their home yet they don’t have time. Here is our Smart Plant pot to make your life and time ease. You don’t have to worry about your plants anymore, you can keep your plant healthy with just one tap on your phone from anywhere on this planet.
If you are plant lover and you are worried what happens when you leave them for a week on business trip or family trip. Then this is the project you should take a look at. Let’s dive into details. but before i just wanted to tell you that this is project which i have made on my early days of B.Tech. So i don't have all the files but i will search it on my archive and upload it as soon as possible.
What is the problem and what is the solution to it?
If you are a plant lover you would have encountered this problem once in your life that is what happens when I leave for a trip, who will water it, who will take care of my plants. We all don’t have magic genie to work for us. Since we cannot genie out of thin air what we can do we can design device or machine who will work for. More like a automation setup which will water our plants when it needed.
Problem solving 101:
what is problem?
The problem is lack of someone to take care of plants while we’re gone.
What we need?
We need someone or something to take care of our plants for a period of time or everyday.
What would be solution?
Appointment a person to take care of my plants while we’re gone.
No No that’s very costly.
Then what?
An automation setup to take care of plants.
How it should work?
Our needs are to water the plant by sensing the soil moisture and update how is our plant .So, automation setup needs to water a plant and update us through IOT and we also need a water tank as source of water.
So now we have sorted what we need to now let’s dive into what are things we need to make this happen.
A microcontroller with WIFI capability --- (ESP32)
A moisture sensor to detect the moisture in soil --- (Sparkfun moisture sensor)
A water pump to push the water from tank -- (DC 9v water pump)
A water tank to store the water.
A water level sensor to detect water level in tank(Sparkfun waterlevel sensor)
Now we got all the parts let’s dive in to how we can put this altogether

Guys this is project I have made 3 years ago. So, the circuit may look a bit childish but trust me it works and you can also replace a replay with Transistor to reduce cost and high efficiency.
Now connect water level sensor to the analog pin 34 of ESP32 and connect the soil moisture sensor to the analog pin of 35 and then connect both of them to power supply rail.
Now coming to the water pump part connect Relay CTRL pin or Transistor Base pin to the digital pin 2.
How it works:
Here, soil moisture sensor senses the moisture level of the soil. And according to the soil moisture threshold setup on the code the ESP32 will turn on the pump when its needed. As plant get sufficient water and soil get wet then once the moisture level is above the threshold. The microcontroller will turn off the pump. And the water level sensor would help us to keep track of the water level on the tank.
Let’s come to the IOT part the user has to see all this data right?
So, I have integrated with this ESP32 to IOT platform called cayenne. This microcontroller will send all this data to the Cayenne IOT platform through the WIFI connection. From there using the cayenne app the user can view the data.
Now let’s see how we can teach all this process to the ESP32 microcontroller.
Code:
#include<analogWrite.h>
#include<CayenneMQTTESP32.h>
#include<CayenneMQTTESP32.h>
#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
char ssid[] = "WIFI SSID";
char password[] = "WIFI Password";
char username[] = "cayenne username";
char mqtt_password[] = "cayenne mqtt password";
char client_id[] = "cayenne client id";
int waterLevelPin = 34;
int sensor_pin = 35;
int soilmoisture = 0;
int relayPin = 2;
int moisture_percentage;
float liquid_level;
int liquid_percentage;
void setup() {
Cayenne.begin(username, mqtt_password, client_id, ssid, password)
pinMode(waterLevelPin,OUTPUT);
pinMode(relayPin,OUTPUT);
pinMode(sensor_pin,INPUT);
digitalWrite(relayPin,LOW);
Serial.begin(9600);
}
void loop()
{
Cayenne.loop();
{
float moisture_percentage;
int actual_value;
int sensor_analog;
sensor_analog = analogRead(sensor_pin);
actual_value = (sensor_analog);
moisture_percentage = ( (actual_value/1024) * 100 );
Serial.print("Moisture Percentage =");
Serial.print(moisture_percentage);
Serial.print("%\n\n");
delay(1000);
Cayenne.virtualWrite(1, moisture_percentage)
{
liquid_percentage = analogRead(waterLevelPin); //read the value of the water level sensor
Serial.print("Water level sensor value: "); //print it to the serial monitor
Serial.println(liquid_percentage);
delay(300);
}
The code is pretty self-explanatory you know the Arduino and read the Cayeene documentation. So please go through the Cayeene documentation before Coming to code.
So now let’s dive into 3D modelling part.
So now we have whole nervous system of Pot but we need a shape, right?
Here we have designed a 3d structure with an integrated water tank so the water pump to make the product minimal.
Here I have attached 3d model and some working pics









So if you understand so far and learned the basics of cayeene platform then you are good to go to make your own smart plant pot.So now hit your workbench and make something to make world better place.
댓글