Instructables

Automatically water your small indoor plant using Arduino + pump

Featured
Picture of Automatically water your small indoor plant using Arduino + pump

Have you ever wanted a little plant to brighten up your desk or home, but you're afraid that you'll forget to water it? Fear no longer! Using an Arduino, a scavenged wall-wart, and a peristaltic pump, you can set up your plant to be watered as often as you like, from a jug or any other vessel. To be as accessible to as many people as possible, this tutorial can be done without soldering. That being said, the advantage of soldering is increased robustness and reliability.

 
Remove these adsRemove these ads by Signing Up

Step 1: What you'll need

Picture of What you'll need

What you'll need:


(x1) Arduino UNO rev 3 (http://adafru.it/50)
(x1) USB cable (http://adafru.it/62)
(x1) 1N4001 diode (http://adafru.it/755)
(x1) PN2222A transistor (http://adafru.it/756)
(x1) 12v 1000mA DC power supply (http://adafru.it/798)
(x1) peristaltic pump (http://adafru.it/1150)
(x2) alligator clip test leads (http://adafru.it/1008)

(x1) jug, glass, vase, or any other vessel that can contain water (not pictured)
(x1) a piece of scotch or electric tape (not pictured)

Tools: wire snippers, soldering iron + solder (not pictured)

Step 2: Understand your transistor

Picture of Understand your transistor
transistor with circuit diagram 2.JPG

First, figure out what the different pins are on your transistor. The diagram from the datasheet shows you which pins are the base, collector, and emitter. The second picture shows how the pins match up to the circuit diagram. This transistor is awesome because it will allow us to use 5v from the arduino to switch the much higher 12v required by the motor, which would destroy our Arduino if we connected it directly to the pins that we can control with our Arduino code. The PN2222A transistor is great for this purpose because it can handle 5v from the Arduino without any resistors.

1-40 of 51Next »
daugguy4 months ago

You have a great project, I like it when its simple. I have a problem with your code though, I can't get wait time beyond about 30 seconds. I think its limited to 32767 ms, but with the ()'s it should go farther. What version of Arduino are you using.

osmithy (author)  daugguy4 months ago

Hmmmm good point, you may have to use a long instead of an int.

billbillt4 months ago

I just love it when a GREAT project such as this is posted how all of the "experts" pop up to give advice on how to "do it better"...

osmithy (author)  billbillt4 months ago

I'm very glad you like it! I actually appreciate all the comments on how it could be improved, because it opens my eyes to things I hadn't thought of, and broadens my perspective.

yzerbeat4 months ago

Great project! Nice job.

I did not want to sacrifice my arduino for it, and made one with these parts :

http://www.banggood.com/Soil-Hygrometer-Humidity-D...

http://www.banggood.com/1-Channel-5V-Relay-Module-...

an aquaruim waterpump and a 5volt powersupply.

Let it grow !

osmithy (author)  yzerbeat4 months ago

Great idea, and very cheap! I didn't realize that sensor could operate without an arduino. Did you have any trouble calibrating it so the soil had the right moisture level?

yzerbeat osmithy4 months ago

There is a little blue potentiometer on the board, it was very easy to calibrate the relay.

You should consider writing an instructable for your project!

Very nice and good tutorial! Congrats on it!

However there is one thing of which I am concerned. I checked the data sheet of the pump and found out that the current of the pump motor is 200-300 mA. Arduino max current output is 30 mA. Will not the motor destroy Arduino? Please explain if I am wrong (I would like to learn! :))

Thank you and congrats again!

The current limits for the Uno are 40mA from any one I/O pin or 200mA from all I/O pins combined, and 50mA from the 3.3V supply pin.

The only I/O pin he is using is A0 to drive the transistor which will be very well under 40mA.

I'm not sure exactly what the current limit for the 5V supply pin is. I think it might be 1.5amps, but it's at least 500mA which is the most that can be drawn over a standard USB port.

However, he is not using the 5V supply pin to power the pump (which would be bad because dropping 12-5=7volts @ 300mA would require dissipating 2.1 watts of power which would definitely overheat the voltage regulator)- he is using the Vin pin which he is supplying with 12V. That is, the same 12V supply that is powering the Arduino through the 5V regulator is directly connected to one side of the transistor. The pump is connected to the other side and when A0 goes HIGH, the pump will draw current directly from the 12V supply. More explanations:

http://bildr.org/2011/03/high-power-control-with-arduino-and-tip120/

osmithy (author)  hunsnowboarder4 months ago

You would be correct if we were powering the pump directly from the arduino. However, we are only using the arduinio to switch on a transistor. The transistor can handle much higher current and voltage than the arduino.

Dear osmithy. Thank you for your reply. I don't understand then. :) What is powering the pump? From the schematics I see that the pump is powered from the arduino 5V pin and the transistor is controlled by the A0 analog pin. I don't see any other power source. I am confused. Please help.

diy_bloke4 months ago

Nice project. I think though that the container you are using might be empty pretty soon :-)

osmithy (author)  diy_bloke4 months ago

Thanks! The container runs out in about a week which is not bad.

diy_bloke osmithy4 months ago

not too bad :-)

Akin Yildiz4 months ago

very nice osmithy. you can easily add a sleek plant arm to the pot, so it has light..! please check out my designs, i'm in the process of combining the two technologies...

http://www.instructables.com/id/USB-powered-LED-pl...

love & peace...

IMAG0348.jpgF09OVZOHU842FQX.jpg
osmithy (author)  Akin Yildiz4 months ago

Really cool! I posted a comment on your project.

proxyrat4 months ago

I found a cheap plant waterer on indeigogo crowdfunding. https://www.indiegogo.com/projects/daisy-si-smart-plant-waterer

osmithy (author)  proxyrat4 months ago

Wow, it looks like they don't even use a pump, just gravity. That allows their device to run off AAA batteries for years instead of needing to be plugged in. Pretty cool!

tmorsch4 months ago

Great project! I have an arduino that is just collecting dust in my project box. I wonder how difficult it would be to measure the moisture content of that water and so make the unit almost autonomous. Here is a dirt cheap sensor:
http://goo.gl/5MXSyO Shipping is free but it can take between 4 to 6 weeks.

moisture sensor.png
diy_bloke tmorsch4 months ago

Actually that is not really difficult tmorsch. All you need to do is make the sensor part of a voltage divider and let the arduino measure the voltage over that divider:

http://www.instructables.com/id/Watering-your-plan...
In fact you dont even need an Arduino:

http://www.instructables.com/id/Irrigating-your-ga...

In fact, the sensor that you mention has an Op amp as a comparator, on that little companion board and in fact you dont need an Arduino to make an automatic irrigator with that, only need to attach a relay to the board.
However, some of these cheap humidity sensor boards actually give a HIGH signal when the resistance on the moisture sensor is LOW (i.e. when the soil is wet), so a relay would do exactly the opposite of what you want: irrigate when it is wet. In that case you either would have to use the NC contact of the relay (but yr relay would be pulling power when there is no irrigation) or you would need to switch the relay via an inverter (e.g. a PNP transistor).
If you dont want to wait 4-6 weeks for ordering, just use two galvanized nails with yr Arduino and grab the program I put in my instructable)

osmithy (author)  tmorsch4 months ago

Wowwwww that is so cheap! You could absolutely make it autonomous if you used one of those, and it wouldn't be difficult at all. I knew about the one Adafruit sells but it's $50, so I didn't use it.

BLR_RAVI5 months ago
good idea..but what you are doing is a on and off timer ...this you can do with a 555 ..cost too less...so i expect a microcontroller to do some more complex task...any way thanks for sharing
osmithy (author)  BLR_RAVI5 months ago

There are definitely cheaper ways to do the same thing, but 555s are confusing to me. And also it's easier to upload new code than to get new resistors and capacitors. But now I'm curious - what component values would you use to make a 555 that turns on for 10 seconds every hour?

VirtualG osmithy4 months ago

I think the use of the MCU is not an overkill as this would offer the possibility to be upgraded with more featues if you want. And it also offers a good reason to learn about sleep modes and other features of the atmega.

I think if I would do this kind of projekt in that scale, I would use one of those popular darlington arrays as the ULN2003 as a one chip solution. You can use with higher load and it comes with protection against reverse current spike when stopping the motor. It would minimize the possibility to fry the atmega.

BLR_RAVI osmithy5 months ago
hi smith...i would use 4.7k good quality cap..if i need timer of 1hr or so..but for large timer i prefer cd4060... http://www.electroschematics.com/6189/time-delay-relay/
osmithy (author)  BLR_RAVI4 months ago

The other thing you could do that would really use a microcontroller's power is to incorporate a soil moisture sensor. Then you would never have to worry about over- or under-watering.

bezo88 osmithy4 months ago

you could use two 555 , one to activate every hour which will activate the second one for 10 seconds. http://www.csgnetwork.com/ne555timer1calc.html this site might help

jfgilmore4 months ago

Really nice project, and well-presented for those of us who are just starting out with Arduino. I've been looking to do something similar to maintain water levels in egg incubators…I'll probably connect a humidity sensor.

osmithy (author)  jfgilmore4 months ago

Thanks so much! I'm glad you found it useful. Humidity sensors are great too. I used one to control an ultrasonic humidifier, and it worked very well. However, I had to hack one of those wireless outlet things because I didn't want to mess around with relays and switching mains voltage. Now that I think about it, that hack may be my next instructable.

thereyno4 months ago

hahaha its nice but not that practical project. :) but pls send me some of your works sir.. cuz evrything is interesting! :) very nice.. hehe ty !

muddog155 months ago
Use a solid state relay with the arduino. Mine can switch 3v and up to turn on 12-240v
osmithy (author)  muddog155 months ago
That sounds awesome. Do you have the model number?

Solid state relay is the expensive and overdone way to do this.

The OP uses a great transistor for turning on the small pump. If you need more power, or just have them on hand, you can use a mosfet (Adafruit has a great tutorial on this.)

If you want to switch AC, then a regular relay will usually be a cheaper solution than a solid state relay, but you'd want to get one with integrated components to allow the low powered arduino to turn on the relay (these can be found on ebay for <$5.) Especially if you are dealing with relatively low power, you can some cheap SSR type of stuff.

osmithy (author)  Kinnishian4 months ago

Cool, thanks for the info.

I should note if you want to avoid a "ClicK" sound or if you have a high duty cycle, then solid state relays are always better.

In this case, it would be infrequent turning on, so a regular relay would be fine.

Attmos4 months ago

Water, speakers, not a good mix. ;)

primosanch4 months ago

Very nice project.

wliu34 months ago

Wont it get inaccurate when you set such a large value to delay? Would it be better to cut the delay into smaller ones?

osmithy (author)  wliu34 months ago

I don't think it would matter - the crystal resonator isn't super accurate no matter how long you count with it. But for plants I don't think it's a big deal. If they get watered a second or two later than they were last time, they still get watered.

1-40 of 51Next »