Instructables

Self-Watering Plant

Featured
Picture of Self-Watering Plant


Plants liven up any space by adding a sense of airiness and life. That is - of course - when you don't forget to water them, and they shrivel up and die. I am very bad at remembering to water plants. That is why I built this self-watering plant to do it for me. Using a soil sensor, and an Arduino-controlled water pump, I have created a system that will never forget to do it. Instead of remembering to water my plants when the soil goes dry, I only have to remember to once and a while refill the water reservoir. In this way, I have decreased my obligation to these plants and put it off to a much later date. Perhaps further iterations of this device can be connected to a rain barrel so that I won't even have to worry about refilling my reservoir, and the entire system can be fully automated.
 
Remove these adsRemove these ads by Signing Up

Step 1: Go get stuff

Picture of Go get stuff
You will need:

(x1) 8" x 6" x 3" project enclosure (Radioshack #270-1809)
(x1) Multipurpose PC Board (Radioshack #276-150)
(x1) 5VDC SPDT micro relay (Radioshack #275-240)
(x1) 9V battery connector (Radioshack #270-324)
(x1) 9V battery holder (Radioshack #270-326)
(x1) 9V battery (Radioshack #23-853)
(x1) SPST micromini toggle switch (Radioshack #275-624)
(x1) 10K resistor (Radioshack #271-1126)
(x1) Size M coaxial DC power plug (Radioshack #274-1569)
(x1) Red and black 22AWG wire (Radioshack #278-1221)
(x1) 12AWG black wire (Radioshack #278-556)
(x1) Non-submersible electric water pump (via Amazon)
(x1) Water storage container with lid
(x2) 8-32 x 2.5" nuts and bolts
(x8) 4-40 x 1" nuts and bolts
(x1) 4-40 x 3/8" nut and bolt
(x4) 1/4" spacers
(x1) Wire nut
(x2) 3' - 5' plastic tubing
(x1) #8 Terminal Ring
(x1) House plant to water

Step 2: Trim the pump

Picture of Trim the pump
2B.jpg
Trim away any unnecessary plastic mounting brackets from the front of the pump that may prevent it from being flush with the case (nozzles and corresponding hardware not included).

Step 3: Drill or cut

Picture of Drill or cut
3B.jpg
3C.jpg
3D.jpg
3E.jpg
3F.jpg
Line up the water pump with the base of one of the 6" x 3" sides of the case.

Drill or cut a hole large enough to fit the nozzles through.

2 questions: 1) is this design adaptable to maintain more than one plant (potentially 3 or 4 at a time with 3 or 4 separate pumps, so the pumps all go to the same set of circuitry?) and 2) is it possible to add a rechargeable solar assembly to power everything?

dmoonen10 days ago

I can't seem to find the code?

Thats exceptional...

Can you use a bigger reservoir for the water.
Axorr1 month ago

Step ten says;
"Attach
an 18" section of 12 AWG wire to the free pin of the 10K resistor.
Solder a 6" section of black 22 AWG wire to this joint.

Attach an 18" section of 12 AWG wire to an unused part of the PCB. Solder a 6" section of red 22 AWG wire to this joint."

However, the pictures show two additional wires coming off the PCB. You can see them again in images from steps 12,13, 15, and 22. Step 23 talks about where the OTHER end of those wire go (connecting to the Arduino), but I am wondering where they connect exactly on the PCB. I seem to be missing the step where it mention when and where those wires are connected.

tommycai1 month ago

so 5v goes to the plant analog in comes from the other probe.

Where is the ground at? Kinda confusing?

Is this correct; I found no schematic found

redwire to arduino 5v and then soldered and to plant

black wire to a1 (analog in) and ground and to resistor side of relay.

digital 12 pin to one side of relay coil on micro relay

tiongson2 months ago

can i use bigger water pump

nodoubtman2 months ago

Hi! I'm wondering, watering plant once a week?... do you feed the plant when it's dry all the time?

thank you!
marC:)

tiongson3 months ago

what is this??? is this an ordinary screw or a sensor???????? plz answer

FD5SRJDH461WXGI.MEDIUM.jpg
tiongson3 months ago

is the probe is the sensor

Polymorph3 months ago

I'm having a hard time finding the schematic or wiring diagram.

I think a driver transistor would be a good idea, as most relays require more than the maximum 40mA the microcontroller is rated at. I'm also not seeing a snubber diode across the relay, without it your Arduino is being damaged every time the relay is shut off.

regaltaxlaw4 months ago
I got all the parts today. Can't wait to start tomorrow! Thank you for the instructable!!!
Anyone know how long an Arduino will run off a 9V battery? Seems to me you could throw an AC>DC adapter in the box too and power the Arduino off of it so you have one less thing to forget :)
A 9 volt battery wont charge an arduino with added sensors on it for very long... a week maybe?
majenko Eirinn4 months ago
You're havin' a laugh, aren't you? Not including any sensors or anything an Uno draws around 50mA. Your typical PP3 battery is only about 575mAh. That equates to a total runtime of no more than about 11.3 hours!!!

delay() does NOT help reduce the battery drain. For that you would have to manually put the Arduino into sleep mode. Doing that, and waking once per hour to sample the soil you could maybe get a week's worth of use out of it if you are really really lucky.

On another note, I'd most definitely use a 12V pump, NOT a mains pump in this situation. Wiring up the mains like that is a recipe for disaster, and even death. 12V pumps are easy to get hold of, and the 12V supply for the pump could also run the Arduino and relay. Hell, you could even scrap the clunky relay and use a MOSFET instead then. Much neater.
Eirinn majenko4 months ago
I said a week, you said a week - i also meant under optimum conditions ;) Just add a mains adapter and it should be fine. However adding sleep would still be good, saves electricity :)
9V batteries are not that long lasting. I would go with 6x AA or AAA NiMH batteries plus a solar charger on top ;-)
small solar charger?
It's possible that a number of small water pumps that hace ac IN actually have their own ac-dc converter internally that powers a dc motor. You can probably tap that to power the arduino, and add the relay a little bit further on that line, so you're also only switching the lower voltage DC.
genius4hire5 months ago
It is good practice to ad a liquid fertilizer to your water. I get it from my local hydroponic farm. the A and B solution is also available in stores, but so much more expensive. Then I check the A and B solution watered down for nutrient strength depending on what you are growing. Good solutions always come in two bottles as otherwise the solution crystals will combine and not work. Only dissolved in water it is ok to mix them together. There are some fabulous nutrient strength meters available with LED readout.
I use something like this http://www.onestopgrowshop.co.uk/blog/2013/08/control-of-nutrient-strength-levels-in-hydroponics/
You get a way with PH meters.
And nutrient strength tables are also online.
The probes I assume are stainless steel.
I like this project and will try to get a pump that is small and for low voltage as I do not like to mess with Electricity and water. Above 80 Volts it is just too dangerous. Use a transformer in between. 12 or 24 Volt and a suitable pump. I live in Australia where we have different plugs and 240 Volt AC anyway.
genius4hire5 months ago
It is good practice to ad a liquid fertilizer to your water. I get it from my local hydroponic farm. the A and B solution is also available in stores, but so much more expensive. Then I check the A and B solution watered down for nutrient strength depending on what you are growing. Good solutions always come in two bottles as otherwise the solution crystals will combine and not work. Only dissolved in water it is ok to mix them together. There are some fabulous nutrient strength meters available with LED readout.
I use something like this http://www.onestopgrowshop.co.uk/blog/2013/08/control-of-nutrient-strength-levels-in-hydroponics/
You get a way with PH meters.
And nutrient strength tables are also online.
The probes I assume are stainless steel.
I like this project and will try to get a pump that is small and for low voltage as I do not like to mess with Electricity and water. Above 80 Volts it is just too dangerous. Use a transformer in between. 12 or 24 Volt and a suitable pump. I live in Australia where we have different plugs and 240 Volt AC anyway.
EET19827 months ago
Finished mine. Found the fault. User error :D. Also changed mine to cycle every 5 seconds. Thanks again. Pretty awesome!
EET19827 months ago
I got all the parts today. Can't wait to start tomorrow! Thank you for the instructable!!!
Ninjaco12 months ago
Hey,
I've got a question for you, How well does this work? Am I able to set the amount of water (ML) it will pump to my plant every day?? And how do I do that? Am I able fo adjust something in your code to change that or what?

peace!
Roshy10 Ninjaco8 months ago
You can adjust the delay time from 10000 to something different, this is a time measurement in milliseconds so it is currently watering for 10 seconds, It will take some quick measurements to find out the time you need, but it should be easy enough.
My Diet Area8 months ago
Please help I want to make this as a science fair project and need more information.
jkarimi9 months ago
could you use a MOSFET instead of the relay? In general, I don't see what the practical difference between the two is.
dls0201010 months ago
I have a question about your moisture measurements: How did you normalize the readings? I've heard that soil moisture content readings from capacitance probes (the nail method) is affected by temperature and salinity.
gmendez310 months ago
Nice project, and the instructable is so clean! Thanks!!
marshath11 months ago
How is the witing connection done on the pc board?
And where does the pump get current frm? From the mains?
pcha11 months ago
Where is the soil sensor, or are the terminal ring the sensors. Please help I want to make this as a science fair project and need more information.
iApple guy12 months ago
Having a problem with the code:

Screenshot from 2013-04-23 17:02:45.png
randofo (author)  iApple guy12 months ago
put a ; after int dryValue = 700

It should be:
int dryValue = 700;
iApple guy12 months ago
expected unqualified-id before numeric constant
jonmash1 year ago
Very nice post. I wouldn't worry about previous comments saying that grid voltage on a PCB is not a good idea. I use PCBs for 400VDC all of the time.

Only thing that I'd recommend is adding a diode across the relay winding to protect your Adruino. It is commonly called a flyback diode or a bypass diode.

What can happen is when the relay opens (or closes) you can get a back emf caused by the magnetic fields collapsing on the relay windings. This back emf MAY not be high enough to destroy your arduino but you never want to take a chance.
cgosh jonmash1 year ago
@jonmash is correct.

Good practice is to always add a reverse-biased, high-voltage diode (1A at 400V, e.g., 1N4004, as low as 10 cents each) right at the pins of any wound coil (the relay coil in this circuit) if it's powered with DC from any semiconductor switch. Some relays even come with this diode already installed, so they must observe correct DC polarity. Positive end of the diode goes to the negative side of the circuit, so no current flows during normal use. Reverse-EMF occurs the instant the coil is **de-energized**. An energized coil of wire creates a magnetic field around itself (that's what makes the relay work by pulling the armature/switch). When the power is cut, this magnetic field collapses back into the coil and generates a brief, reverse-biased, high-voltage pulse into the circuit. The reverse-biased diode instantly shorts out this pulse. One pulse may or may not fry your electronics, but repeated blasts over time could easily do so (the bigger the coil, the more powerful the pulse). This is a very cheap addition to any circuit with a relay or solenoid.

I also agree with other posters that the best 'ible includes a schematic drawing to eliminate any confusion and to clarify the idea. Even if you just draw it the way it's laid out on the board, that's fine. Draw it on a piece of paper and shoot a photo.

Great concept and photos, BTW, and lots of good, clear, specific instructions. Thanks, and keep up the good work!
sakko3031 year ago
I love this project, thanks! I see much nerd-dom in planning improvements, so allow me to add my idea. How about a piezo chirp (these always drive everyone nuts :/ ) on 2 possible conditions on your guys added ideas...

#1 - piezo chirp on plant is too dry (in case the device is activating but no water is present, the plant could get too dry, you would be notified)
-or-
#2 - piezo chirp on reservoir is empty.

Like I said, chirping devices usually drive people nuts, so feel free to replace piezo chirp with "twitter", "smack me in the head with a hammer", or "email my gardener, I don't have time for this ****".
mrdudej1 year ago
What was the total cost of this project with the arduino?

randofo (author)  mrdudej1 year ago
I don't remember.
Raveler11 year ago
(I am unable to post this as a reply to the comment on setting the dry value, so please forgive this post's location.)

A simple correction to the code would set the dry value whenever the device is turned on. Then, if you want to reset the dry value, simply turn off the device, wait for the dryness that you prefer, then turn it on. It would set to your plant's particular needs.

Thus in the code:
...
int dryValue = 700;
...

Delete the "=700", but be sure to leave the semicolon

Then in the setup section, below the serial communication section but before the closing } add:
...
// Set the "dry" value of soil on turning on the device. If you want to keep your plant more
// watered, set the soil to the minimum dampness before turning on your auto watering device
dryValue = analogRead(analogInPin);

//print the dry value to the serial monitor
Serial.print("dry value = " );
Serial.println(dryValue);
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!