Automated Plant Watering System

Hey People,
With two friends, I recently made this Smart Plant Manager(SPm) OR Automated Plant Watering System


So, before you begin, Please check out this powtoon video we uploaded to youtube on the functions of the SPM to get a clear view on the awesomeness that you are about to do!!!

Link: https://www.youtube.com/watch?v=RdQnAlkhWq0

Heres what the SPM is capable of
>Displaying Soil Moisture level(min:0 & max:1023)
>Displaying the surrounding temperature of the plant
>Water your plant once every 24 hours
>Watering the plant when temperature goes above 30 degrees C(this can be altered depending on what plant you are planning to use the SPM for)
>Watering the plant when the soil moisture level goes below 921(90%)
>A water level detector circuit which switches on an LED when there is enough water and switches of the same LED when water is not enough
So this build inegrates 5 circuits together.
Now I will got through each circuit. IF you are really sure of making all 5 circuits at the same time, then please scroll down to a picture which I have hand drawn the entire circuit design of the SPM
------------------------------------------------------------------------------------------------------------------------------------------------------
PART 1: We will first look at the LCD temperature display circuit

So I hope this fritzing circuit is very easy to follow.
Just wire it up and get going!!!
If you really want the code for this circuit spereatly visit the temp lcd link i've shared in the resource. You'll find the code in that instructable
I suggeest you dont worry about the code as I will share the entire code for this device in the end of the how-to section.
PART 2: The next part is the Moisture Sensor
The moisture sensor is really easy to use. 

Just plug in the positve and negativ wires accordingly and plug in the analog output or Vout into one of the analog inputs of the arduino(inputs with prefix A, ex: A0)
Sub Section: Before I move onto the water pump and water level detector circuit, here a picuture of our LCD display showing surrounding temperature of plant and soil moisture of plant.

PART 3: Water pump circuit(extremely important) >>> Heart and Main function of the SPM


So this is the water pump circuit, be sure to use the correct diode here or your water pump will malfunction.
Also be sure to use the correct transistor: P2N222A which is an NPN BJT
PART 4: The final part, the water level detector
This circuit requires a BC547 is an NPN BJT. If you can't find a BC547, you can use a BC337. However if you are using a bc337 transistor, be sure to be very stingy with the voltage. A high voltage can easily damnge the BC337 as its not as beefy and durable as the BC547.
Here is the water level detector circuit fritzing circuit:
You can choose to just have a low dip probe and and a base probe(this is a simple circuit)
But if you really want an accurate water level detector(which is not required for thw SPM from my point of view), you can wire up the entire circuit
------------------------------------------------------------------------------------------------------------------------------------------------------With this, the SPM circuitry comes to an end
As for the coding here it is,
NOTE: This includes the entire code for all circuits combined together. If you are editing this, BEWARE!!! and the water level detector has NO CODE and does not use the microcontroller(Arduino 101 in this case). The water level detector is a stand alone circuit.
The coding is highlighted in BOLD
// built in arduino library
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);

int tempVal;
int moisVal;
int moisPer;

float volts;
float tempC;
float tempF;
int motorPin = A1;
int watertime = 10;
int waittime = 30;

void setup()
{
  lcd.begin(16, 2);
  // clear old screen data
  lcd.clear();
  pinMode(motorPin, OUTPUT);
  // text to be dispalyed on the screen
  Serial.begin (9600);
}


void loop()
{
 //read the temp sensor and store it in tempVal
 tempVal = analogRead(A0);
 moisVal = analogRead(A2);
 delay(1000);

 //converting that reading to voltage by multiplying the reading by 3.3V
 volts = tempVal * 3.3;
 volts /= 1023.0;

 //calculate temperature celsius from voltage
 tempC = (volts - 0.5) * 100 ;
  // Convert from celcius to fahrenheit
 tempF = (tempC * 9.0 / 5.0) + 32.0;
 Serial.println(tempC);
 Serial.print("Moisture Sensor Value:");
 Serial.println(analogRead(A2));
 delay(1000);

 // (column 0) of the second line (line 1):
 lcd.setCursor(0,0);
 lcd.write ("Temp: ");
 lcd.setCursor (7, 0);
 lcd.print (tempC, 2);

 lcd.setCursor (13, 0);
 lcd.write ("C");

 lcd.setCursor(0,1);
 lcd.write ("Mois: ");
 lcd.setCursor (7,1);
 lcd.print (analogRead(A2));


 if(analogRead(A2)<=121||(tempC>=28&&tempC<=60))
 {
  digitalWrite(motorPin, HIGH);
  delay(watertime*1000);
  digitalWrite(motorPin, LOW);
 }
 delay(1000);}


------------------------------------------------------------------------------------------------------------------------------------------------------With this, comes the end of the electronics side of the project
------------------------------------------------------------------------------------------------------------------------------------------------------Mechanical Side of the Project:
For the external portable and cheap casing you can opt for a small plastic carry box with a handle as shown below. These kind of cases are available for 2 bucks at shops like Daiso. Very cheap and exactly what we need!
Related image
Next for the water shower head, you can 3d print it.
We are not sharing the 3d print file as the shower head size and shape depends on your potted plant size
This is how our shower head looks when placed with our potted plant

So thats it for the build
If you have problems hooking all these seperate parts and materials,
here is another picture, the aerial view of the SPM with a potted plant.

Another one! >>> A picture of the SPM from another angle.
 
OH yes, Be sure to make a hole in the plastic box you are using for the sensor wires to run out of the box!
This whole can be drilled using a milling machine(dangerous and hard) or
this hole can be made using an "OLD" soldering iron. The iron will melt right into the box.
Be sure not to inhale those fumes when u are melting the plastic!
Suggestion: Secure all the electronic parts inside the plastic casing with gluetack or duct tape!!!
I will conclude this with another nice pic of the SPM in action:

With this, Comes an end to the one and only, the amazing, Smart Plant Manager!!!
I really hope this helps people who find it hard to grow a plant at home!

Comments

Popular Posts