Introduction: AutoPlant - Automatic Plant Watering

AutoPlant 1.0, The Irrigation Machine.

There are some guides on how to make an Irrigation Machine, how ever most of them need a power outlet of 220v
for the pump to work.

I managed to find a 3-6v water pump on Ebay and made my own version.
There are some future development which I will add, well, in the future, like moisture settings, water level checker and more.

Now, however the AutoPlant do as folow :
1. When turned on once an hour the Arduino sends a pulse through a transmitter probe (screw) that is buried in the ground next to the plant.
2. Next to the transmitter probe buried the receiver probe which receive the pulse through the ground if it moist enough, the ground act like a resistor and by measuring the pulse the arduino knows the moist level.
3. According to the program settings, if the moisture is less then the program settings, the arduino turns on the water pump and add water until the program settings of the high moisture level is reached unless to much time is passed then it figures there must be no water in the reservoir and shuts down the pump until high moisture level is reached by manual watering and the whole process starts again.

Step 1: Parts List

1 5v Arduino pro mini
2 220ohm reisistors
1 5v regulator
1 9v battery
1 3-6v water pump
2 long screws
1 breadboard
1 on/off switch
1 transistor

Step 2: Making the Probes

Making the probes is quite easy, I've seen many around the internet, you could ether solder a long enough
cable to each of them or use these bolts as i did securing the cable in place by force.

You should bury them in the pot's ground about 1cm apart, make sure they do not touch each other.

Step 3: The Pump

As i mentioned before, i used a 3-6v submersible pump which means i only need one pipe to go to the plant as the
pump itself sits inside the reservoir.

DO NOT connect the pump directly yo the arduino, never do that, you might burn it, I used a voltage regulator to downgrade from the battery 9v to 5v and turned the pump on/off using a transistor.

Also make sure there are no back current going back to the arduino by pulling down the current using a resistor to ground.

Step 4: The Circuitry

Follow the diagram, the arduno's pins act as follow :
Pin 9 HIGH = pump on, LOW = pump off.
Pin 8 - Transmitter Probe
Pin A3 - Receiver Probe

Vcc - 5v (through the on/off switch)
GND - Ground (-)

Step 5: The Code

The void loop checks the probes every 60 minuts and if the ground is dry starts the waterOn function which turn the pump on until the high moist level is reached or 5 seconds pasts.
if moist level reached turns off pump and goes back to the void loop, if 5 second pasts and the level did not reached then turns off pump and blink error (pumpErr function) until moist level reched (manual watering)

NOTE : The serial communication commands were added for debugging reasons and can be dropped.

/*
The AutoPlant reads the humidity level through 2 probes, one sends 5V pulse through the ground (Digital Pin 8) the outher
reads the pulse from the ground (A3), the weter the ground the more pulse is transfered through it.
when the ground is dry the AutoPlant turns a 5V pump to add water to the plant (through Digital Pin 9)
*/
int probeVal;
#define wetnessLow 500
#define wetnessHigh 800
#define waterTime 5000
void setup() {
pinMode (13, OUTPUT); /* Led Indecator */
pinMode (9, OUTPUT); /* Pump on/off */
pinMode (8, OUTPUT); /* Probe Transmiter */
pinMode (A3, INPUT); /* Probe Reciver */
Serial.begin (9600);
}
void loop() {
Serial.println ("loop");
digitalWrite (8, HIGH);
probeVal = analogRead (A3);
digitalWrite (8, LOW);
if (probeVal <= wetnessLow) {
waterOn();
}
delay (60000);
}
void waterOn() {
Serial.println ("waterOn");
digitalWrite (13, HIGH);
digitalWrite (9, HIGH);
digitalWrite (8, HIGH);
long Time = (millis());
long pumpTime = millis();
/* Pump on, fills the water until probe reciver matches waternessHigh */
while (analogRead (A3) <=wetnessHigh) {
if (millis() == Time+700) {
digitalWrite (13, !digitalRead (13));
Time = millis();
}
/* If no matching of the waternessHigh until waterTime runs the pumpErr function */
if (millis() >= pumpTime + waterTime){
Serial.println ("iffff");
pumpErr() ;
}
}
digitalWrite (13, LOW);
digitalWrite (9, LOW);
digitalWrite (8, LOW);
}
void pumpErr() {
Serial.println ("pump Err");
digitalWrite (9, LOW);
while (analogRead (A3) <=wetnessHigh) {
digitalWrite (13, HIGH);
delay (200);
digitalWrite (13,LOW);
delay (200);
digitalWrite (13, HIGH);
delay (200);
digitalWrite (13,LOW);
delay (1000);
}
}