Smart Plant is an Arduino based plant watering system which checks environment parameters like temperature and humidity and automatically waters plants.

Steps for making Smart Plant:


Step 1: Collecting components

               The following components are needed:      

  • Arduino mega/ Arduino uno
  • DHT11
  • YL-69 + YL-38 Moisture sensor
  • Submersible water pump (3-6 volts)
  • n-p-n transistors
  • Jumper wires
  • Breadboard
  • Bluetooth module (HC-05)
  • USB cable

You also need to download an app called Ardu Tooth on your android     device which will be used to receive the sensor values and help us take better care of plants.



Sensors used:


  • DHT11: DHT11 sensor is very basic. It has two parts, a capacitive humidity sensor and a thermistor. It can measure relative humidity ranging from 20-90% with an accuracy of ±0.5% and temperature ranging from 0-50֯ C with an accuracy of ±2֯

The capacitive humidity sensor measures the electrical resistance between the two electrodes to give the relative humidity. It contains moisture holding substrate between the two electrodes. When water vapor is absorbed by the substrate, ions are released, which increase the conductivity between the electrodes. Thus, resistance varies with relative humidity.


 Relative Humidity = (D/Ds) *100

                                   D: Density of water vapour

        Ds: Density of water vapour at saturation


At saturation, water vapours start condensing.

There is a single signal wire for transmitting data (both relative humidity and         temperature). The sensor sends out 40 bits (5 bytes) of data continuously in the data line.


The 40-bit data from the sensor has the following structure:

Data (40-bit) = Integer Byte of RH + Decimal Byte of RH + Integer Byte of Temp. + Decimal Byte of Temp. + Checksum Byte


The checksum byte detects successful transmission of data. If all data is transferred successfully, the checksum byte is equal to the last eight bits of the sum of the first four bytes:

Checksum = Last 8 bits of (Integer Byte of RH + Decimal Byte of RH + Integer Byte of Temp. + Decimal Byte of Temp.)

DHT11 contains a thermistor, which has a negative temperature coefficient, i.e. the resistance increases with a decrease in temperature.

Features of HMC5883L:

  • Voltage Supply (3 to 5.5V)
  • Supply Current (0.5mA to 2.5mA)
  • Size 15.5mm x 12mm x 5.5mm 
  • Moisture Sensor: The soil moisture sensor or the hygrometer is usually used to detect the humidity of the soil. The Soil Moisture Sensor uses capacitance to measure dielectric permittivity of the surrounding medium. In soil, dielectric permittivity is a function of the water content. The sensor creates a voltage proportional to the dielectric permittivity, and therefore the water content of the soil. More water makes the soil conduct electricity more easily (less resistance), while dry soil conducts electricity poorly (more resistance).




  • Operating voltage: DC 3.3V – 5V
  • Output voltage signal: 0 ~ 4.2V
  • Current: 35mA
  • LED: Power indicator (Red) and Digital switching output indicator (Green)
  • Size: 60 x 20 x 5mm



 Interfacing With Arduino:

Step 2: Circuit Diagram

Step 3: Code

#include <dht.h>

#include <SoftwareSerial.h>

SoftwareSerial BTserial(10, 11);

int dhtpin = A1;

int motor=2;

int fan=3;

int soilsensor=A0;

int red = 3;

int blue = 4;

int green = 5;

dht DHT;

// higher number is more dry



void setup()

{ Serial.begin(9600);


  pinMode(soilsensor, INPUT);

  pinMode(motor, OUTPUT);

  pinMode(fan, OUTPUT);

  pinMode(dhtpin, INPUT);

  pinMode(red, OUTPUT);

  pinMode(blue, OUTPUT);

  pinMode(green, OUTPUT);


int x;

int min_temp;

int max_temp=25;

int max_dryness=900;

int temp=0;

int hum=0;

int SensorValue=0;

void loop()


  x= DHT.read11(dhtpin);

  temp = DHT.temperature;




  SensorValue = analogRead(soilsensor);





  if(SensorValue >= max_dryness)


   digitalWrite(motor, HIGH);


   digitalWrite(motor, LOW);


  if(temp >= max_temp)


    digitalWrite(fan, HIGH);


  if(temp <= max_temp)


    digitalWrite(fan, LOW);