Introduction: Garduino Self Watering Plant System

For this project, I wanted to create a self-watering system that would help maintain the health of plants, even if they are owned by a serial plant killer (RIP Rosemary, Rosemary II, Rosemary III and Basil). I knew I wanted to keep the engineering relatively simple and focus more on the design, so kept the components to simply a part to release water, a part to sense moisture, and of course the Arduino to tell them what to do.

Supplies

Plants!
Arduino Uno

Plastic Solenoid Valve

Capacitive Moisture Sensor Breadboard

1N4001 Diode

TIP120 Transistor

1Kohm Resistor

12V Arduino Power Adapter

PVC Connectors

Clear Plastic Tubing

Waterproof Heat Shrink Tubing

Water Reservoir

Quick Connects

Wire

Waterproof box
Plant Container

Step 1: Step 1: Obtain a Plant

To start out, get a plant you haven't killed yet and make sure it's in a pot big enough for it and your circuit. This will depend on your own design tastes as well as how you support it. I chose to use metal plant support sticks and a candle holder to hold up my circuit. Use whatever you have, as going to the store is not always possible right now.

Step 2: Step 2: Build Your Circuit

Now for the techy part! You're gonna need a breadboard and some connector wires to prototype everything. You can solder this all together once it's done and cover it in the heat shrink for an extra layer of waterproofing. It's especially recommended to heat shrink the parts that will be outside your waterproof box to keep them safe.

Step 3: Step 3: the Code

Here is the code for the Arduino:

const int AirValue = 660; //replace this value with
Value_1 to calibrate const int WaterValue = 580; //you need to replace this value with Value_2

int soilMoistureValue = 0; int soilmoisturepercent=0; int solenoidPin = 4;

void setup() { Serial.begin(9600); // open serial port, set the baud

rate to 9600bps

pinMode(solenoidPin, OUTPUT); }

void loop() {

soilMoistureValue = analogRead(A0); //put Sensor insert into soil Serial.println(soilMoistureValue); soilmoisturepercent = map(soilMoistureValue, AirValue, WaterValue, 0, 100);

if(soilmoisturepercent > 0)

{ Serial.println("100 %"); digitalWrite(solenoidPin, HIGH); delay(30000); digitalWrite(solenoidPin, LOW); delay(1000);

}else if(soilmoisturepercent <100)

{ Serial.println("0 %");

//Switch Solenoid ON

//Wait 5 Second //Switch Solenoid OFF //Wait 1 Second

} else if(soilmoisturepercent >0 && soilmoisturepercent < 100)

{ Serial.print(soilmoisturepercent); Serial.println("%");

} delay(250);

}

Step 4: Step 4: Test It!

I started by testing the sensor, first to make sure I could get a reading, and then to make sure I could make it do a thing based on the reading. Then I incorporated the solenoid into the circuit and tested that. Once everything works, go ahead and put it in your waterproof box! You're almost there!

Note: You'll have to drill holes in the box for the wires to come out since you could damage them by just closing the box on them. However, you may be thinking "this will make the waterproof box not waterproof anymore, right?" Yes, so to fix that I used waterproof silicone to fill the holes once the wires were through.

Okay, now you're almost there.

Step 5: Step 5: Build It!

Okay! Now you're gonna need to find something to support the weight not only of your circuit, but also the water in the reservoir, so find (or assemble) something sturdy.

I used the top part of a small plastic hummingbird feeder for my reservoir, so i didn't need anything crazy heavy duty. What I ended up being able to use was a candle holder, plant supports and heavy duty farm wire to connect everything and keep it in place (along with some welding but you don't have to do that). I also had to drill a hole into the reservoir big enough for a small funnel, since I want to easily be able to refill the water if it gets low. Another thing I did was use plastic sheet protectors to create a pocket for the box to keep the dirt out. Alternatively, you could keep your circuit outside your container entirely, it's up to you.

Then you'll need to attach the tubing and your reservoir to the solenoid valve and poke some holes in the tube so the water can drip out.

You don't have to spray paint everything but I wanted it to look cohesive.

Step 6: Step 6: Finished!

Once you have your circuit all running and everything put together, you'll need to adjust the code one last time to coordinate with the moisture levels in your soil. Once you do that, you can put your water in the reservoir and plug it in! That's it! You don't have to change any batteries and your plants will never be over- or under-watered again! (Sorry again, Rosemaries). As an added design element I attached these shell pieces so that they make a small noise when the water drips on them which is very cool.

Thanks for checking this out! If you build your own, please let me know, I'd love to see! Good luck and happy gardening!