
Show HN: GreenPiThumb – A Raspberry Pi Gardening Bot - mtlynch
https://mtlynch.io/greenpithumb/
======
setq
I love these projects. They are always destined to fail from experience but
are great fun anyway. I've tried a few times to do similar things. I'll
catalog my disasters quickly:

1\. Seedlings need blowing around a bit when they pop out or they get all
spindly. Cue wiring up two 80mm PC case fans to a chain of a single astable
then two monostable 555's to generate an oscillating wind field that goes on
for 5 seconds each direction after a delay of 10 minutes. Dried the compost
out, blew most of it it away and then killed the plants dead. No tomatoes for
me!

2\. Watering robot version 1. Similar to above but with a 74hc390 dividing
down the clock so it only ran once every day. Used an unprotected MOSFET to
control a small water pump from ebay. Back EMF blew the MOSFET up and jammed
it as a short. Emptied the entire water reservoir into the pot, down the wall
and into the carpet.

3\. Watering robot version 2. Same as above with problems fixed. Apart from I
ran out of bipolar 555's so I used CMOS ones which are a little more tetchy
about noise. Cue last 555 getting jammed in an on state and the same thing
happening. This time, the tupperware box with the electronics ended up getting
wet and the wall wart exploded.

Edit: meant to say to the OP - nice work. This is the spirit of all things
interesting :)

~~~
joshvm
Fun story: we're doing a project at work to do with agriculture.

We bought some pot plants to keep alive and some cheap soil sensors; they're
just two electrodes and you pass a current through the soil, measure the
resistance and get a proxy for soil moisture. We left the sensor continuously
logging on Friday, came back on Monday to find the plant very unhappy and the
probe contacts almost completely corroded. Within a day or two it was a stump,
never recovered.

Turns out you're not supposed to leave these things powered on 24/7 and
capacitative sensors are a much better solution. TIL you can electrocute
plants.

~~~
kaybe
Put a metal stick in the soil and check the travel time of the reflected
signal:

[https://en.wikipedia.org/wiki/Time-
domain_reflectometer#TDR_...](https://en.wikipedia.org/wiki/Time-
domain_reflectometer#TDR_in_geotechnical_usage)

[https://en.wikipedia.org/wiki/Measuring_moisture_content_usi...](https://en.wikipedia.org/wiki/Measuring_moisture_content_using_time-
domain_reflectometry)

~~~
setq
This is a really cool idea actually. However you're likely talking sub
nanosecond rise times which makes things a little difficult in the signal
processing space. For example my scope (knackered old 1971 Tek 475) can barely
manage 1.8ns on a properly terminated transmission line which this will likely
not be.

~~~
tonyarkles
I don't remember the name of the peripheral off the top of my head, but there
are some PICs that have a very fast time measurement unit in them. I don't
know if they're fast enough for soil measurement, but there's app notes around
for doing TDR-based liquid level sensing with them.

~~~
setq
[http://www.edn.com/Pdf/ViewPdf?contentItemId=4433411](http://www.edn.com/Pdf/ViewPdf?contentItemId=4433411)

Details above. Looks like you can get 3.5ps resolution with an off the shelf
PIC after calibration which is pretty impressive!

~~~
kaybe
Wow!

So the price is..

3$ for the microcontroller, 3$ for the 4 ns comparator, and a few cents for
the resistors, capacitors, and 7 GHz transistors (I couldn't find the exact
model), and probably some dollars for the rest of the materials such as steel
rods and tubes. All in all it looks doable for <50$ easily. That's pretty
amazing!

------
crusso
_But I’m a programmer, not a gardener. If I had a plant, I’d have to water it
and check the plant’s health a few times per week. I decided it would be much
easier if I just spent several hundred hours building a robot to do that for
me. If the plant lives to be 80 years old, I come out slightly ahead._

The mark of the start of any good hobby project is a sense of humor about the
time it really takes to accomplish something simple with technology on the
first go-round.

~~~
F_J_H
Reminds me of this: [https://xkcd.com/974/](https://xkcd.com/974/)

~~~
ryfm
expected that one [https://xkcd.com/1205/](https://xkcd.com/1205/)

~~~
branchan
expected this one [https://xkcd.com/1319/](https://xkcd.com/1319/)

~~~
wattengard
expected this one
[http://i.imgur.com/3PBpIQm.gif](http://i.imgur.com/3PBpIQm.gif)

------
exelius
So the reason your moisture sensor project failed is because those types of
moisture sensors are really designed for "stick it in, test it, and pull it
out" testing. If left powered on in a moist environment, the conductive
material on the sensor will quickly corrode (quickly as in the span of a few
hours, as is seen on the graph).

However, Vegetronix makes an ultrasonic soil moisture sensor that does not
have electrodes, and thus does not corrode. It is far more complex and
expensive ($40) but it's designed as a moisture sensor for sprinkler systems
and as such is engineered to be left in the ground.

Edit: Link to Vegetronix sensor:
[http://www.vegetronix.com/Products/VH400/](http://www.vegetronix.com/Products/VH400/)
. I have used it and it works well, but as it turns out, even this is not
sufficient to really automate a garden. You need fertilizer. Hydroponics make
dealing with that complication _much_ easier -- until you realize that the
fertilizers are caustic / acidic enough that you have to flush the lines with
water as well...

In other words, there's a pretty good reason you can't buy a kit off the shelf
that will grow plants :)

~~~
HeyLaughingBoy
The sensors corrode due to oxidation caused by the DC current. It's a pretty
simple design change to alternate the current flow through the sensor and
prevent that oxidation by toggling the pins.

~~~
mdorazio
Exactly this. I created a soil moisture setup with cheap sensors that worked
consistently for several months. The key was to send the current flow one
direction for a few seconds, then reverse high/low on the pins for the exact
same time. This prevented excessive oxidation.

------
Eduardo3rd
I really like the addition of the web camera - it's a nice bonus on top of the
more traditional temperature/humidity/light/moisture readings that most people
incorporate into these DIY systems. Much better than what I made the first
time I built one of these things.[0]

The one thing that made my scratch my head was your approach to measuring
moisture. There are several very reliable methods for measuring soil moisture
directly (changes in resistance, capacitance, time domain reflectometry, etc)
that will give you exactly what you are looking for here.

"Therefore, we felt it was fair to assume that watering based on moisture
level is impossible and that GreenPiThumb is doing the best it possibly can,
given certain inexorable limits of the physical world."

This just isn't true. The sensor you picked up from Sparkfun should give you
decent measurements for a while before degrading gradually depending on your
soil chemistry.

[0] I ran a consumer soil moisture IOT company for a few years that was sold
to Scotts Miracle Gro in 2016.

~~~
dethswatch
> time domain reflectometry

Can you point us in the right direction on this? The wiki doesn't make it
clear how it would be used for measuring soil moisture.

~~~
Eduardo3rd
Sure - this paper (PDF warning) is a decent place to start learning about how
the process works.
[http://quebec.hwr.arizona.edu/classes/hwr432/2014/jones02-TD...](http://quebec.hwr.arizona.edu/classes/hwr432/2014/jones02-TDR-
principle-applications.pdf)

I haven't looked at the industry in a couple of years, but I think that many
of the high-end commercial sensors use some variation of this technique.

------
danhardman
Did the pot you use have holes in the bottom? It looks like you have it just
sat on a desk so I'm assuming it's basically just a bucket?

Your moisture problem could just be that you were relying too much on the
water evaporating/being absorbed rather than needing to drain out. Gravel at
the bottom of a pot with holes in helps water drain really well.
Alternatively, without the gravel you could place the pot on a dish, fill the
dish and let the water be absorbed from the bottom up.

~~~
mtlynch
Yeah, it drains into a little tray underneath. I'm trying to figure out a
better solution for that because we can't see how much water is in the tray,
so if too much has drained out, it starts overflowing onto the table with no
warning.

Also I get the sense that I shouldn't just be leaving standing water in the
tray forever, but it's also pretty difficult to remove the tray and empty it.

~~~
hammock
Put some pebbles on top of the tray to raise the pot off of it, so it's not
sitting in the standing water.

~~~
mtlynch
Oh that's a good idea. Thanks!

~~~
and0
I usually throw a base of pebbles / marbles into the bottom of any pot before
I put the dirt in, which also aids in draining.

------
2III7
I bought this moisture sensor for a gardening project

[https://www.tindie.com/products/miceuz/i2c-soil-moisture-
sen...](https://www.tindie.com/products/miceuz/i2c-soil-moisture-sensor/)

Haven't had the chance to try it out in soil yet, but reading the comments it
looks promising. It uses capacitance instead of resistance and connects
directly to the I2C pins of the Pi. So, easier to setup and should be more
reliable.

On the software side I use Grafana
[https://grafana.com/](https://grafana.com/)

Not really made for gardening projects but its monitoring and alerting
capabilities are pretty much perfect for this kind of application. Not to
mention how easy it was to set it up on the Pi and get all (temperature,
moisture, light) the sensor data in.

~~~
05
Or.. you can use a $2 Arduino Nano clone, a 1¢ 10MΩ resistor and some aluminum
foil strips to build one yourself.

[http://playground.arduino.cc/Main/CapacitiveSensor](http://playground.arduino.cc/Main/CapacitiveSensor)

~~~
simonrobb
...nope. This'll give you a nice little touch sensor but not much more than
that. Try turning this into any sort of usable measurement of soil moisture as
opposed to "there's wet soil on this strip of foil" and you'll run into a
wall.

~~~
ollie87
Reminds me of Cheesoid.

[https://www.youtube.com/watch?v=B_m17HK97M8](https://www.youtube.com/watch?v=B_m17HK97M8)

------
thedaniel
In the water distribution section the author mentions the other gardening
software doesn't mention how they distribute water. There's a longer history
of irrigation than there is of embedded software development, so maybe he
should have talked to someone that actually does agriculture or googled
'irrigation system parts' and bought one of the thousands of existing drippers
for a buck.

Of course the later heading "the gardening wasn't supposed to be hard" seems
to imply that he assumes non-coding skills are easy to figure out or obvious,
which is a sadly too-common trend in the tech world.

~~~
mtlynch
I didn't mean to imply that gardening in general is easy, just that gardening
basic houseplants seems like it's not supposed to be very hard.

We did look for gardening supplies that would spread the water out, but
everything we found was designed for large fields or at least small gardens,
not single planters. I'm seeing the same thing now when I Google "irrigation
system parts." Looking at drippers, I'm not seeing how it would solve the
problem. Doesn't it just drip onto a single spot?

~~~
thedaniel
Sorry to come across so harsh, I was in a poor mood yesterday :) There are a
bunch that friction fit onto tubing that have e.g. 10 holes and spray out to
the sides

------
bfu
Instead of measuring soil moisture try:

    
    
        - measuring air moisture of small upside down cup on top of the soil 
        - measuring weight of the whole pot
    

Or don't measure at all and instead use precise amount of water on precise
times (RTC module, medical grade piezo-electric pump). My similar project is
on hold at 20 or so sketches of various types of water pumps.

~~~
rwmj
Wouldn't the weight of the pot increase as the plant grows (because it's
absorbing carbon from the air in fact).

~~~
jbeales
This could be accounted for - for example, if the weight of everything drops
by 100 grams, then _at least_ 100 grams of water has been used or evaporated.
Eventually any increase in weight from the plant could probably be calculated,
but for many plants, (like bush beans), it's a relatively small amount,
probably less than a pound.

OTOH indeterminate tomato plant, for example, weighs a _lot_ , and the weight
would also be affected by picking the fruit.

------
nrs26
I am so excited to see this! I've been working on a very similar project to
monitor my outdoor vegetable garden using a raspberry pi and some ESP8266's.
Like you, I'm using this as a project to better learn javascript, angular and
django. It's in the very early stages, but I'm really loving the experience so
far.

Here's a picture of my setup.
[http://imgur.com/a/BV188](http://imgur.com/a/BV188)

I have a enclosure (that I recently made waterproof) that sits out in my
garden that has the ESP8266 wireless chip in there, which works very similar
to an Arduino with built in WiFi. I have it reading data in from a soil
humidity / temp sensor, an air humidity sensor, a light sensor, and a air
temperature sensor.

That data gets sent back to a simple django webserver that I have running
(indoors) off of a raspberry pi. It records all the sensor readings every 10
minutes and registers them to various plots in my garden. And then, if there
are any big issues (no light for 2 days, lower than average soil humidity or
soil temperature, etc), it texts me.

Eventually I'll connect it to my irrigation system, but I don't trust it
enough yet!

I have the exact same problem with soil humidity sensors that you mentioned. I
even sprung for some fancy ones
([http://bit.ly/2sMNRnD](http://bit.ly/2sMNRnD)) that claim to be waterproof.
I cannot make them read useful information and, once it rains or I water
outdoors, the sensors read 99% for the next few days. It's very frustrating
and the missing piece to make all of this work.

Like you, this started as a quick, month-long project and now it's become
something a lot bigger :)

I think eventually I'd like to build this out to be a vegetable garden
planner, so I can plan my vegetable garden at the start of the season, monitor
what's happening with them, and automatically trigger my irrigation system if
needed.

Anyway - it was great to read this! I'd love to hear how this project evolves
and would be happy to share any of my experiences as I've put this together.

P.S. And, it's a long shot, but if you (or anyone is reading this) figures how
to accurately measure soil humidity temperature in a waterproof environment, I
would be forever grateful!

~~~
faster
Soil moisture measurements can be scientific if you have enough money. Look up
Time Domain Reflectometry and Soil Moisture Tension.

I don't understand TDR well enough to explain it, so I will let you search for
your own info. The cheapest usable TDR sensor is about $350.

Tension has a simple analogy; a Slurpee (is that trademarked?) is easy to
drink through a straw in the beginning, but it gets harder to pull the liquid
up the straw as you drink more of it. That's tension and plants also struggle
to pull the water from the soil depending on lots of factors including the
composition of the soil, the amount of water present, drainage, etc.

There are several sensors that can be used to measure tension but none are
accurate in all conditions, so people who want to measure tension tend to use
multiple sensors of different types and triangulate on a useful number.

Large scale farming (in dirt across thousands of acres) is where the complex
sensors are needed because the soil attributes are not uniform.

When you're gardening in a pot indoors or in a greenhouse with the same soil
everywhere (because you bought bags of it), you can use those $0.43 resistance
probes and just calibrate your watering amounts and intervals over time. Pump
on for X units of time, ignore for Y units to let the water move through the
soil, then sample every Z units until it needs more.

~~~
kaybe
It should be possible to hack together a basic TDR device, especially if you
can calibrate it.

Then one needs a/two metal piece of defined length, and a high-frequency
oscilloscope, that can also give a pulsed signal (ideally of high frequency).

The biggest issue I see is that you'd need something like at least 0.5 GHz
resolution in the oscilloscope with a metal piece of 25cm (quick mental math
and some guesses, don't hold me to it). Probably better to have at least 2
GHz. I don't think computers and software alone is up to it after a quick
search. Maybe one can increase the travel time in the probe (metal stick)
somehow to lower the needed resolution, but not by orders of magnitude.

[https://electronics.stackexchange.com/questions/268333/ghz-c...](https://electronics.stackexchange.com/questions/268333/ghz-
class-sampling-oscilloscopes-on-the-cheap?rq=1)

------
zfunk
Love this. I went down a similar path last year, using a Raspberry Pi to water
an outdoor vegetable patch. In the end I used a package [1] to control a
remote controlled plug socket. I also hit similar problems with soil moisture,
so went down the route of pulling a weather feed - pump water if it isn't
going rain. Easy if you are watering outside!

[1] [https://github.com/dmcg/raspberry-
strogonanoff](https://github.com/dmcg/raspberry-strogonanoff)

~~~
mtlynch
Oh, that's awesome! Doing it outside is interesting because there are a whole
different set of challenges. I like your project name.

------
grw_
A raspberry pi is the wrong choice for this project from my perspective,
complexity is far too high for a simple project. I looked at building the same
thing (minus watering) because it seemed commercial products were way too
expensive (Parrot Flower Power is $60!).

The cheapest DIY solution I could think of was ESP8266 ($2), Vreg ($.5),
moisture sensor ($.5) and LiPo battery (i have many of these..) but I decided
I didn't have time or inclination to write the software.

I continued looking for commercial products, and ordered one of these:
[https://www.aliexpress.com/item/Chinese-Version-Original-
Xia...](https://www.aliexpress.com/item/Chinese-Version-Original-Xiaomi-Flora-
Monitor-Smart-Tester-Soil-Light-Water-Digital-Grass-Garden-
Plant/32807893133.html)

Pros- Cheap ($15). Has temperature, light and 'fertility' (capacitance?)
sensor. Cons- Logs to phone app (in chinese) via BTLE instead of WiFi.

After a few weeks it seems to be working satisfactorily and I will probably
order a few more units.

~~~
urethrafranklin
Come on. Maybe unless you live in India or Africa (and even then, still), $60
is nowhere near as expensive as designing and building your own device.

Not that there's anything wrong with building your own device. Just don't lie
about it.

~~~
grw_
True, I had discounted my time spent on DIY as 'hobby time', which I do for
fun and learning. Had I included this then of course it would have been far
greater.

I have a few plants I wanted to monitor, so price is more relevant- $300 is
more than I'm willing to pay. I think you underestimate how much of the world
thinks $60 is unreasonable for such a device, but i don't suppose there's a
way to know which of us is right :)

------
lloydjatkinson
Hmm. A MOSFET for a motor switch might be overkill. Also, there's no flyback
diode. So your Pi pretty much will let its blue smoke out when you get a
flyback voltage, or at least the MOSFET.

~~~
mtlynch
That sounds... undesirable. Electronics is definitely not my area of
expertise, so I'm very open to feedback. What do you recommend?

~~~
Jaruzel
Wouldn't a relay be easier to integrate? and also keep the pump power circuit
isolated from the pi power circuit?

~~~
lloydjatkinson
Anything involving collapsing magnetic fields, eg solenoids, relays, motors,
absolutely simply has to have a flyback diode.

So your suggestion is actually introducing a second magnetic field, so now
you've doubled the chances of blowing up your Pi and or the MOSFET.

Whether you're using a transistor/MOSFET directly with a motor or instead with
relay + motor you need the flyback diode.

~~~
cr0sh
> So your suggestion is actually introducing a second magnetic field, so now
> you've doubled the chances of blowing up your Pi and or the MOSFET.

No. You haven't fixed the original problem, but your motor is now isolated
from the rest of the circuit.

You've just now have a relay with an inductive element instead of a motor.
Ultimately, you haven't solved anything (unless you are using an AC motor, and
you don't have a triac or something else solid state to control the motor).
You still need the flyback diode.

But you haven't doubled your problem by introducing a relay, merely moved the
issue to another part.

Now - in regards to the mosfet - many mosfets (not all!) have a built in
protection diode between the source and drain. Check your datasheet for
details (including what kind of back-feed voltage/current can be handled by
them - some may need an added diode with better ratings in detail).

EDIT: Also - some relays have built-in protection diodes (or can be ordered as
such) as well (again, check the datasheet). You see this more on relays for
automotive applications (ie - standard BOSCH style relays) than ordinary bare
PCB relays.

------
joshribakoff
As for the faulty soil moisture, check out tropf blumat. It's made in Germany
(you know the Germans make good stuff). It uses osmosis and gravity to keep
the soil moisture consistent, no electricity. I've had great success with
roots even growing up out of the soil towards the drippers
[https://youtu.be/UWPLr0Selh8](https://youtu.be/UWPLr0Selh8)

~~~
mtlynch
Cool, thanks for the tip!

------
jnty
So great to read. This is exactly the kind of project the Raspberry Pi was
designed to enable - doing something a bit odd (and arguably pointless!) but
having fun and learning loads along the way.

------
tp3z4u
The plants look waterlogged; the roots need air to breathe.

Drain the water back into the reservoir (use a simple filter to prevent damage
to the pump) and just use a schedule for watering.

I used a mechanical timer switch for 15 mins every hour for my hyrdo setup.
For soil, such tiny plants, and no lights you would need far less frequency. A
general rule of thumb is to give it enough time between waterings to let it
get a bit dry.

~~~
mtlynch
Oh, thanks for the feedback. There are holes at the bottom of the planter. Is
there something different we need to be doing to get it to drain properly?

How much time do you think it should go between waterings? The first batch, we
kept waiting for the soil to get _really_ dry, but weren't sure if it should
just be not very damp to the touch or like as dry as before we put water in at
all.

~~~
heavenlyblue
I would think a purely technical approach to this is flooding the plant every
hour, and then measuring the differential of how much water had flooded the
roots vs. how much water was pumped out.

If the differential is tending to 0 then it means that not only the soil is
saturated, but the plant is as well. This is _quite_ a basic concept, since
you do not want a fully saturated soil all of the time.

A proper biological approach is to estimate how much water exactly the plant
needs per unit of time, and then make sure the differential is always exactly
that amount. This is not an exact science, especially when you're only working
with a single plant and your conditions are probably far from ideal.

This approach would easily take into account other hidden variables, such as
the rate of evaporation of water from the soil that depends on the ambient
temperature. It also scales to hydroponics.

~~~
exelius
This is basically hydroponics. And by "basically" I mean "exactly". Replace
the soil with an inert, porous medium like hardened clay. And if you aerate
the water with say, an aquarium pump/stone, you don't even need to drain it...

------
hammock
>GreenPiThumb: a gardening bot that automatically waters houseplants, but also
sometimes kills them.

Quite an advanced bot: as close to a human as you can get!

------
dbrgn
I also thought about doing a project like that, thanks for the write-up. I
somehow can't really believe that it's that hard to measure soil moistures.

Are there any industrial plant moisturing robots? What approaches do these
use?

Edit: I met this guy a few months ago at a faire:
[https://lambdanodes.wordpress.com/](https://lambdanodes.wordpress.com/) The
project doesn't seem to have advanced since then, but maybe he'll get better
results with his epsilon node.

~~~
schiffern
>Are there any industrial plant moisturing robots? What approaches do these
use?

Sure there are. They look like this:
[https://upload.wikimedia.org/wikipedia/commons/8/86/PivotWit...](https://upload.wikimedia.org/wikipedia/commons/8/86/PivotWithDrops.JPG)

I assume you mean the second/third definition of "robot," since GreenPiThumb
doesn't look like a human. [https://www.merriam-
webster.com/dictionary/robot](https://www.merriam-
webster.com/dictionary/robot)

------
ldp01
I'm not much of a gardener but the idea of measuring the moisture level seems
ill-conceived... Namely because you are measuring at only a single point in
your 3D region of soil, and you don't know what range of moisture should be
maintained without experimentation.

Using our guy's own sawtooth model of watering/drainage, it would make more
sense to just water at fixed intervals and experiment with the frequency to
see if the plant grows.

Still a fun project!

~~~
thatcat
As the plant grows the rate of water being removed from the soil increases, so
the amount of water supplied will need to increase. Varience in illumination,
temp, and humidity will also change transpiration rates.

------
Dlotan
I have a pretty similar project. But the problem with the mainstream moisture
sensors is that they break after some time (or I did not find a good one). For
myself I found the expensive solution a flower power from parrot
[http://global.parrot.com/au/products/flower-
power/](http://global.parrot.com/au/products/flower-power/) a handy solution.
It workes with bluetooth and they have some documentation. I did some working
for python: [https://github.com/Dlotan/flower-master-
fab/blob/master/app/...](https://github.com/Dlotan/flower-master-
fab/blob/master/app/hardware/flower_power.py) and get good results over a long
perioud without too many outliers

------
INTPenis
As a city dweller who has grown a lot of plants on balconies and in apartments
I have also been down that road but I found a much easier solution to the
watering. Autopots[1].

With those you can have 6 plants on a single 47l tank and only re-fill it
every month. (depends on how thirsty they are)

It's a gods send when I want to go away for a few weeks vacation.

For other house plants that are not connected to a huge water tank I tend to
just turn over a 2l plastic bottle into the soil after thoroughly saturating
it first with water.

So with this the only real requirement I had for my grow op was monitoring.
Because I have hard wood floors and I don't want them to swell up due to a
leaking tank.

1\. [https://autopot.co.uk/products/](https://autopot.co.uk/products/)

~~~
schiffern
Nice product, and nice KISS approach.

For those who don't want to / can't pay for it (eg the developing world),
burying unglazed pots will also work. It's probably the most water-efficient
method in arid land. The technique is at least 4000 years old.

[https://www.treehugger.com/green-food/unglazed-clay-pots-
cre...](https://www.treehugger.com/green-food/unglazed-clay-pots-create-
efficient-drip-irrigation-video.html)

------
amelius
Some kickstarter projects doing the same (some in non-obvious ways):

[https://www.kickstarter.com/projects/studiolorier/ultimate-s...](https://www.kickstarter.com/projects/studiolorier/ultimate-
self-watering-flowerpot-the-natural-balan)

[https://www.kickstarter.com/projects/1267027760/rigavit-
the-...](https://www.kickstarter.com/projects/1267027760/rigavit-the-easiest-
way-to-water-your-flowers)

[https://www.kickstarter.com/projects/849992274/giy-stick-
let...](https://www.kickstarter.com/projects/849992274/giy-stick-let-nature-
self-water-your-pots)

------
cbanek
As someone who has done a lot of gardening, and automated that gardening, I
personally find soil moisture to be a complete boondoggle of something to
measure. It doesn't tell you if the plant is taking up the moisture, or if the
pH is correct (or you have some kind of nutrient salt lockout). The author
says they are having trouble because the water isn't evenly distributed.

While it sounds scary, hydroponics is much easier to automate. Use a substrate
like grodan blocks that can't be overwatered, and have it drain back into the
reservoir you are pumping from. Then it's just a matter of setting your cycle
time appropriately, and watering for x seconds every y hours, and changing the
water after a set number of days, and adding new nutrients. By using more
water than you need without risk, you can ensure an even level of watering
over the entire medium.

It's also much easier if you have a nutrient problem as you can easily flush
with a large amount of properly pH'd water to 'reset' your substrate, which is
very hard to do with soil.

This doesn't even get into things like potting mix typically has eggs for all
sorts of pests, if not pests themselves. If you are lucky and get a clean
batch, you are still providing a great environment for pests to live.

While it does cost a bit more to do hydro, it's honestly not that much. If you
want to be super cheap you can use pH papers or by a $20 pH pen. A starter
nutrient kit from general hydroponics should be under $30.

PS - here's a link to my raspberry pi automated hydro system on hackaday
([https://hackaday.io/project/12418-garden-
squid](https://hackaday.io/project/12418-garden-squid))

------
ShirsenduK
You may also hack this product by Xiaomi.

[https://www.aliexpress.com/item/Xiaomi-Mi-Flora-Monitor-
Smar...](https://www.aliexpress.com/item/Xiaomi-Mi-Flora-Monitor-Smart-Tester-
Flower-Care-Soil-Water-Digital-Grass-Light-Sensor-for-Garden/32804584205.html)

There are many wifi enabled switches to enable the water pump. Try out the
ESP8266 and/or ESP32 in your next project.

Your mind will blown with the possibilities :D

Also, you may loose the soil and go for hydroponics, that would make this
really from the future.

~~~
danesparza
"loose the soil and go for hydroponics"

What a great idea! (Especially since his "dirt is broken"). :-)

------
splitbrain
I recently build something similar for my balcony. But instead of a $30
raspberry I used a $9 NodeMCU:
[https://www.splitbrain.org/blog/2017-06/10-automated_plant_w...](https://www.splitbrain.org/blog/2017-06/10-automated_plant_watering)

Also just took me a few evenings instead of months.

~~~
Dowwie
Great work! This is inspiring.

------
tylerjaywood
This is awesome. I did something similar at reddit.com/r/takecareofmyplant

I was running through moisture sensors on a weekly basis until I hooked it up
to the GPIO on only flipped the power on when I was taking a reading. Now I
get readings every 10seconds and haven't had to replace the sensor in over 6
months.

~~~
nrs26
Interesting -- was this indoors or outdoors?

~~~
tylerjaywood
indoors, and it's still going. over a year!

------
yellowapple
The traditional answer to automated irrigation for indoor plants (and outdoor
plants when you need better water efficiency than with a sprinkler system) is
typically a drip system (background info:
[https://en.wikipedia.org/wiki/Drip_irrigation](https://en.wikipedia.org/wiki/Drip_irrigation)).
Interesting that this project didn't seem to go that direction, seeing as how
water distribution is kind of a solved problem in agriculture/horticulture (at
least in terms of the mechanical aspects; efficiency can still use
improvements, and little projects like GreenPiThumb are definitely steps in
the right direction).

------
option_greek
I had good results with using a simple timer board that switched the pump on
and off at fixed intervals. The total setup (for 5 potted plants) costed
around $25 including the timer board. The results were great especially with
tomato and okra where we had a hard time collecting the produce :)

Edit: Was using something similar to this board:
[http://www.ebay.com/itm/Automation-DC-12V-LED-Display-
Digita...](http://www.ebay.com/itm/Automation-DC-12V-LED-Display-Digital-
Delay-Timer-Control-Switch-
Relay-A7Y6-/272702855151?_trksid=p2349526.m2548.l4275)

I think RPi is a overkill for this project.

~~~
kingosticks
> I think RPi is a overkill for this project.

Not when you consider the goals of their particular project and the experience
of the author(s), as he does explain.

------
krylon
I dig the writing style! I find that putting in a joke or two every now and
then makes it far easier for me keep up my attention.

Also, this makes me think. I have two Raspberry Pis lying around. One is a
glorified video player, the other one is just catching dust right now. I have
wanted to do some kind of hardware project with it for a while, but I am kind
of lazy and have pretty much no knowledge of electronics.

I have wanted to build a weather station, though, that keeps a long term
record of its measurement in some kind of database. A Pi would be well suited
for that, so I might get around to it one day after all.

------
inetknght
One of the better laid out Pi project summaries I've seen. Good work, I say.

~~~
mtlynch
Thanks for reading!

------
rdez6173
I wonder, for a container plant, if you can reliably use weight as a measure
of soil saturation. Of course plant growth would add to the weight, but I
suspect that could be accounted for.

~~~
ShakataGaNai
Interesting thought, probably could. USB scales are cheap, but your plant with
water (draining through) would be sitting on top of said scales electronics.
Could get messy.

------
peter_retief
I used a fish tank pump with surgical tubing and a moisture sensor with an
arduino to switch the pump on when it got dry but as you say, its never that
easy, the whole thing is lying in a drawer somewhere, it didn't make anything
easier. Another project involved load cells and LPG gas bottles. That was a
bit more useful but it needed to be constantly powered and the wires kept
falling out, so that's also in a drawer somewhere. I still haven't made a
useful project yet

------
tanvach
This was exactly the route I wanted to go down until I found out about
hydroponics, especially the Kratky's method. It's super easy, does not need
any electronics or pumps, and I've successfully grown lettuces and herbs.

[http://www.instructables.com/id/Kratkys-non-circulating-
hydr...](http://www.instructables.com/id/Kratkys-non-circulating-hydroponics/)

------
betolink
This project reminds me of an installation at MOMA NY, the same concept but
they used an Arduino. Now there are even kits to do it for whole garden
[https://www.cooking-
hacks.com/documentation/tutorials/open-g...](https://www.cooking-
hacks.com/documentation/tutorials/open-garden-hydroponics-irrigation-system-
sensors-plant-monitoring)

------
un-devmox
> The first time we pumped water into our planter, the tube directed a small
> stream into one spot, completely soaking that area but leaving the rest of
> the soil dry.

I use irrigation tubing with drip line emitters in my garden. That might be a
solution for you. The cool think about the emitters is that they control the
flow of water and are easily positioned. I think they start at .5ga/hour on up
to 10ga/hour.

~~~
glup
One could hook the RPi up to a solenoid valve and then standard Orbit drip
tubing or variable drop line emitters.

------
somecallitblues
I'm building a space bucket atm using Arduino instead of Pi. It's a lot of
fun. There are some amazing projects on spacebuckets.com.
[https://www.spacebuckets.com/u/POstoned](https://www.spacebuckets.com/u/POstoned)
has a good Pi setup with schematics etc. I think his reddit post is very
detailed with sourcecode.

------
fpgaminer
I vaguely remember that when I read about soil moisture sensors, they all
needed to be cleaned and dried after every use. Basically, you couldn't leave
them in the soil. Seemed odd to me, but I never dug further into it.

Is that true? If so, that would explain why the sensor doesn't work here, but
leaves me wondering why I've seen so many projects try to use the sensors that
way.

~~~
ShakataGaNai
Many soil sensors use electrical conductivity between two contacts, using the
resistance to gauge the moisture. The more water, the lower the resistance.
Unfortunately those contacts will start to corrode after being left in a damp
(and electrified) environment.

------
pavel_lishin
Questions to everyone who's tried similar things:

1\. why use a water pump, instead of a gravity-fed system with a valve you
could control with a servo?

2\. Would a scale be able to measure soil moisture? Dump in X grams of water,
wait until scale registers X/2 before adding more. (Some fiddling would be
required to see how much of the water is retained by the plan as building
material.)

~~~
exelius
1\. Because solenoid valves that can work with a very low pressure
differential (a few feet worth of gravity often isn't enough to "force open"
the valve) are expensive and require higher power draw than an Arduino / RPi.
If you already need an external power source, might as well go with a pump. A
pump is going to be a more consistent flow rate, and thus easier to control.

2\. Generally not; a plant's water consumption is not steady over its
lifetime.

I eventually moved on to hydroponics. Soil is just too "analog" for most of
this stuff to work. Hydroponic kits are available on Amazon for cheap, though
the main measurement you end up doing with hydroponics is pH measurement --
and I am not aware of any "hands off" sensors capable of accurate pH
measurement that are remotely affordable.

~~~
s73ver
Aren't the kinds of plants you can grow in hydroponics limited, though? I like
having flowers on my balcony, and I'm not sure I could get the same stuff with
a hydroponic setup.

~~~
exelius
Not sure, but pretty much any plant with a root system will grow in
hydroponics (which includes most flowers). The fertilizer mix may be different
for different plants, but the concept is the same.

The biggest pain with hydroponics is that you do have to totally change out
the water periodically. That gets difficult, because you have to add
nutrients, and those nutrients are pretty caustic, cannot be pre-mixed and
actually need to be mixed into the solution in a certain order...

After a while, these "automated garden projects" end up becoming basically
industrial control/automation projects with complex rulesets, programming
schedules, etc. It was fun and I learned a lot, but it ends up being a _much_
bigger project than you assume when you start.

------
neelkadia
I did almost same to feed the Rat! :D
[http://www.feedmyflash.in/](http://www.feedmyflash.in/) and also open sourced
the code at
[https://github.com/neelkadia/FeedMyFlash](https://github.com/neelkadia/FeedMyFlash)

------
theandrewbailey
I'm sorta thrown off by the use of "we" and "our" in the middle of this
article. From the top of the article (which doesn't use we/our), I understand
that this is just one guy doing this. Is there someone else in the process
that I'm missing?

~~~
mtlynch
It's the royal "we". I should have mentioned in the post that I reign over a
small kingdom.

Kidding, it's a project I worked on with my friend. I maybe should have made
that more visible at the top of the post.

------
stevehiehn
This is inspiring. I've been thinking about hand rolling a rain water reserve
style irrigation system that essentially just pulls/scrapes a weather forecast
and waters my garden. Not nearly as precise as this but hopefully useful.

------
_devillain_
This was a hilarious read (as well as informative). Fantastic work, fantastic
writing!

------
ajarmst
I dislike the use of the "robot" for anything that doesn't have autonomous
movement (those were "RC Wars", not "Robot Wars"\---although I, for one, would
have delighted, at a safe distance, in someone strapping a circular saw to
something autonomous). Nor is watering a single indoor potted plant the same
thing as "gardening." An actual Gardening Robot would have been very
interesting (I envisioned something trundling around with a spade and
actuators for pulling weeds when I saw the title).

I actually love the Pi---one is now my primary computer---but it seems to have
created a niche for "let's add a website and database to my really trivial
control systems project" that I'm not sure really advances much of anything.

~~~
LordKano
I understand your argument but I disagree.

According to the Merriam-Webster, this arguably fits two of the three
definitions of "robot".

I guess you could say that measuring soil moisture and adding water isn't
"complicated" but I would also disagree with that assessment.

[https://www.merriam-webster.com/dictionary/robot](https://www.merriam-
webster.com/dictionary/robot)

2: a device that automatically performs complicated often repetitive tasks

3: a mechanism guided by automatic controls

~~~
ajarmst
I see your point, but I think that complexity is key (and I think that
definition 3 is far too over-broad, unless you require minimal complexity of
the mechanism or pay close attention to the plurality of "controls"). The
problem with categorizing anything with a sensor and actuator as the proper
study of robotics means that very little is excluded. We wouldn't be impressed
if a car salesman claimed that the automated dash-light dimmer is a "robot"
(even if he had a well-researched semantic argument), and I don't think the
term is applicable in this case.

------
LordKano
I have been thinking about making a homebrew Phototron using an arduino, grow
lights, temp+moisture sensors and a water reservoir.

The addition of the camera makes me think that a Pi might be a better
solution.

------
banderman
I am excited to see projects like this. I believe that it will be important to
be able to deploy fully autonomous food production facilities to Mars ahead of
any colonization effort.

------
soheil
I once setup something similar but with solar panels in Mojave desert to water
a peach tree. Needless to say that didn't work oht as planned.

------
pjc50
On this subject, does anyone know what the state of the art is in using
machine learning to identify (and preferably eliminate) weeds?

~~~
semi-extrinsic
Do we really want to start down the road of teaching computers to identify
beings that are slightly different from the rest and then killing them?

------
water42
the codebase is really elegant. thanks for open sourcing everything!

~~~
mtlynch
Thanks! We put a lot of effort into making the code readable, so I'm glad you
found it pleasant to read.

------
crb002
Why computer vision of plant stress is better than fancy sensors.

~~~
glup
I've run into trouble with human vision in this case: I can see that a plant
is stressed, but it's often much harder to figure out what is stressing it.

------
z3t4
it would be interesting to see if its possible to make a closed system. a
black box that gives tomatos ...

------
bitJericho
The Color Computer from Tandy started because of a project called "Green
Thumb". Hurray for gardeners and farmers! :)

[https://en.wikipedia.org/wiki/TRS-80_Color_Computer#Origin_a...](https://en.wikipedia.org/wiki/TRS-80_Color_Computer#Origin_and_history)

