Occam’s Razor: Gardening Edition

While the impulse to solving problems in complex systems is often to grab a microcontroller and some sensors to automate the problem away, interfacing with the real world is often a lot more difficult than it appears. Measuring soil moisture, for example, seems like it would be an easy way of ensuring plants get the proper amount of water, but soil is a challenging environment for electronics and this solution often causes more problems than it solves. [Kevin] noticed this problem with soil moisture sensors and set about solving this problem with a much simpler, though indirect, method of monitoring his plants electronically.

Rather than relying on soil conductivity for testing soil moisture levels, he has developed an alternate method of determining if the plants need to be watered simply by continuously weighing them. The hypothesis that he had was that a plant that needs water will weigh less as the available water respirates out of the plant or evaporates from the soil. This means that using a reliable sensor like a load cell to measure weight rather than an unreliable one like a soil moisture sensor will result in more reliable data he can use to automate his plants’ watering.

[Kevin]’s build is based around an ESP32 and a commercially-available load cell which are all built into the base of the plant’s pot. The design hides all of the electronics in a pleasant enclosure and is able to communicate relevant info wirelessly as well. The real story here, however, isn’t a novel use of an ESP32 chip, but rather out-of-the-box problem solving by using an atypical sensor to solve this problem. That’s not to say that you can’t ever use other sensors to directly monitor your garden and automate its health, though.

44 thoughts on “Occam’s Razor: Gardening Edition

    1. There’s an even older “weighing the plants” one that I’ve been searching for for years. I think it was done pre-ESP, so no WiFi, but with a small AVR controlling a pump/relay.

      But the question I’ve always had. Plants grow, so their weight increases over time, right? But they also slurp out nutrients from the soil, so the weight could even out. But still, the dry mass will include more water, so I guess the plant/pot/dirt system gets heavier over time. So there’s possibly a drift in the optimal weight.

      Plant growth is basically a long-term, slow process, and evaporation is pretty quick, so there’s probably some clever filtering you could do on the data to disentangle them anyway.

      (Linear autoregression to pull out the plant growth term, assuming it’s roughly constant? Long-run average vs short-run average? Something like that.)

      Do you have long-run data on this? Care to share?

      I’ve coincidentally also ordered some weight cells about a week ago, and this was one of my ideas for a project with them.

      1. Sadly, I don’t have any long term data. Like so many projects Thirsdee disappeared in a drawer and at the back of my head after the post. But back then I talked to a clever biologist. She assumed the same as you, that the plant growth would be visible in the long run and the water consumption only in the short run.

      2. I tried the concept a little bit, just measuring the plant weight over some weeks. You can indeed see a slow reduction in weight over days. Plants will absorb stuff from atmosphere slower than water loss, so you can account for the weight loss as water loss. Whatevet minerals go from pot to plant dont change the weight.
        Thought this is a good concept but:
        -the weight will change comparably to water weight change based in where the pot is sitting on the scale.
        -sudden sun and heating of the pot/measuring setup and electronics also alters the weight
        -grooming the plant changes weight
        -moving plants around can cause one to lean on another shifting the weight

        Overall, i don’t think it is a robust, simple or cheap concept to apply to many plants. You can make it work in a very controlled environment, but not in a typical environment.

        (one day i will make a write-up about it.. But not soon)

        1. > Whatevet minerals go from pot to plant dont change the weight.

          I’d assume the weight increases over time anyway because the minerals don’t “just” go from pot to plant but the plant uses those minerals (and whatnot) plus water and sunlight combined to grow and since energy from the sun is absorbed and stored the total weight needs to increase. Doesn’t it?

        2. This is really interesting, thanks for sharing! I noticed in my data that there’s a good bit of wobble in the weight data over the course of a day. That could just be poor signal conditioning on my part, but I wonder if the sunlight issue is also causing that. I also have light intensity data for the same time period so I might see if I can correlate the two.

          1. Part of that serious wobble with be the day-night cycle and environmental reactions of the plants too I would expect.

            Though actually proving such a thing would be challenging.

          2. Maybe just try to put a relatively precise temperature sensor in the base next to the load cell, and see if temperature and weight ‘wobble’ in a similar way might be an easy way to start figuring the error source out?

      3. There are actually some very fascinating experiments on this exact thought – put a plant in a pot, let it grow, and weight the amount of moisture going in and out.

        It turns out that plants collect a very very large amount of weight by absorbing CO2 from the air and binding it in the cell fibers – so you would have to correctly take the weight of the plant into account when determining if it needs to be watered!

        However, it should be possible to estimate the plant’s dry mass. Since the plant’s weight changes much slower than watering/drying will, you could wait for the user to refill the water in the pot, and use that weight then to estimate plant weight – assuming that the user will, on average, water the soil to roughly the same wetness every time.

      4. I’m thinking if you add a known amount of water, then right after watering you’d have the new maximum weight and use that as a rolling average. Maybe a reset button for after pruning to indicate a new (lower) maximum weight.

      5. There is a very old weighing the plant scheme predating electricity. I can’t remember the experimenter but it led to the understanding that the plants mass increases mostly (more than from soil nutrients) from the CO2 it absorbs and processes from the air… So over time the weight of the pot/plant may have to be “tweaked” to prevent under-watering?

      6. Admittedly, I’m not much of a data scientist, but I can say it’s been pretty helpful just gauging whether I’m watering at relatively consistent dryness each week. I’m hoping to use the data to help improve my data science abilities. The data from this plant includes things like root pruning, sensor downtime, and changes in the sensor platform, but if that dirty data would still be interesting to someone I’d be happy to package it up as a .csv file.

        I’m curious, do those nutrients slurped out of the soil end up leaving the plant entirely through respiration, or do they just move from soil weight to plant weight? I imagine the ratio of soil weight to plant weight probably plays some role in how fast the plant dries out, but if the nutrients aren’t leaving the system as a whole then you can still use change of weight as a proxy for dryness. In other words, changes in weight are still going to either be due to plant growth or the movement of water.

        Another metric worth thinking about is the slope of evaporation (or related frequency of watering). Although I don’t think this has changed much since I started weighing with a load cell, it changed pretty dramatically (based on manual weighing) from the time when this plant had a couple of leaves vs what you see above.

    2. Wow, I wish I’d seen yours before I started working! Would’ve saved me a lot of time. I initially started off trying to make a PCB with an integrated load cell (half bridge) before getting frustrated and switching to a commercial load cell.

      Did you notice a change in watering frequency as the plant grew?

    1. This is actually something I’d really like to do, but don’t yet have the skills for it. One of the big problems with my current setup is a lack of feedback about how the plant is actually doing. Without feedback, I’m really just using the weight as an input to my decision about whether to water rather than the sole deciding factor. Another approach to feedback would be to make it easier to simply add a star rating for how the plant looks like it’s doing so I can start to correlate watering with plant health.

    1. Ok someone just barely beat you to this idea, but I would upvote this if I could, just for the great name :D (even though someone else quickly pointed out you want to water them regularly enough that they don’t droop… apparently some people are better at plant care than we are ;) )

  1. I don’t have a reference on tap, but there was a famous experiment centuries ago, where a scientist grew a tree in a large bucket, to settle the question of whether a tree’s mass came from the soil or not.

    He carefully weighed everything going in: soil, water, tree seedling, and found that after years of growth the now-large tree consumed only a few ounces of soil mass.

    The conclusion was that, since the tree was obviously not water, it must have got most of its mass from thin air. Apparently a startling conclusion at the time.

  2. I’ve been toying with the idea of whipping up a similar weigh thing to measure my BBQ propane tank to determine how much propane is remaining. Then I see them available with Bluetooth to send the data to my phone, for $50. Or a simple spring gauge for $10. And the option paralysis set in and I did nothing. So I got a second tank instead.

    But one question I had when thinking about it: How much do these cheap load cells and ADCs drift over time?

    I’ve got a few and have not noticed a huge amount of zero-load day-to-day drift, but enough to want to re-zero it from time to time — a pain in the butt if you’ve got a plant (or propane tank) parked on it.

    So how much do these sensors creep or drift under load over the course of months or years?

    1. That’s a really good question. I’ve noticed a good deal of wobble in my data from day to day, but I suspect that’s due more to poor data conditioning on my part rather than drift. I hope to keep this working for many more years, so I’ll be sure to update on whether I’m seeing drift when compared to manual weighing.

  3. The lazy way is to use a deep pot with drainage hole and put that in a container (e.g. Tupperware). Fill 1/2 -1 inch of water in the Tupperware and let the water seep up the drainage hole. Water can travel up the soil by capillary action.

    Now you can monitor water intake visually or by sensors easily. I have seen water gobbled all up from the container in 10-15 minutes.

    1. I killed a potted plum tree using that method. Assuming that water is reaching the roots because there’s a lot of water in the reserve container is an error. Capillary action has its limits.

      Also, depending on wilt to indicate need to water can fail. Some plants are already effectively dead when the leaves start to wilt.

        1. Not all plants have the same needs, but most are fairly tolerant. Most don’t expect, or desire the ideal moisture level constantly. Constant moisture, will also be conducive to fungus, mold and bacterial growth. I do think the weight method is probably fairly good. Only need to tweak a few things, for different types of plants. Water will evaporate, likely quicker than the plant absorbs it. Just have to weigh wen the plant is good just watered), and what point you determine when you need to water,, how much. After each watering, is the new weight to work with, before the next. It’s not a set it, forget it solution, but who hides houseplants?

          Water also attracts bugs, animals, specially pets… Should probably put some fail safe in place, to reduce the mess, if something goes horribly wrong…

  4. If you want to automate something, you do not only grab an MCU and some sensors, you also need some actuators (or interfaces for existing actuators). Otherwise it is just data logging, not automation.

  5. Not to mess with anyone’s fun with sensors but what about a system that waters the pot every x amount of days and that has some good drainage where the excess would go back to the water tank. I’m saying it because afaik plants are ok with dry periods (I think some really need it) so letting the soil do its thing rather than sensors might be more efective. On the other hand I’m only now for the first time of my life being able to keep indoor plants alive, so I might not know what I’m saying

    1. Plants are highly variable, some really require boggy very saturated soil basically all the time, others want very little water in the soil most of the time with the odd soaking, some are more fussy about humidity than others too… You are however not likely to cause the plant any harm by keeping it a little dry/wet on average or short term spikes out of its comfort zone, some plants might have very small ‘operating windows’ but nothing my parents or I have ever tried to grow has been that fussy…

      Your idea is sound though – very much how many hydroponics systems I’ve read about are set up – PWM style watering, those that need more get more pulses or even constant flow, don’t bother monitoring the soil/faux soil just adjust every now and then based on how healthy the plant looks…

  6. Nice work, Kevin. I have a few thoughts and suggestions to share.

    The wiggles in the data might be due to vibrations in the environment. If a single reading is being taken just as you walk by the table, for example, it may introduce some bumps into the data.

    I have seen a similar effect on my outdoor temperature sensor. There are wiggles of several degrees which are obviously not actual temperature changes, I attribute them to gusts of wind at the time of the reading. I just grab a single reading each time period right now.

    (Someday) I plan on including some form of filtering such as simple averaging to see if that reduces or eliminates the effect. One method I’m considering is to take multiple readings, spread out over time then dropping the min and max values and averaging the rest. There are pros and cons to this filter method, there are many other options.

    An isolation pad (foam or rubber) under the pot should help if there is a vibration issue.

    Given the thermal mass of the pot etc. I would expect temperature effects to be slow changes spread out over many minutes, more likely hours and exaggerated during daylight hours. Unless there is an HVAC vent under the table(?)

    Do you weigh the water before each watering? (Since we’re in the US, we have to weigh it. If we were anywhere else we could just measure the volume in ml and have grams. ;) ) You could compare the change in reading to added weight as a means of cal check/confirmation.

    Feel free to share the CSV’s with me (you have my email).

    1. Thanks, Bill! The averaging is a good idea, I’ll definitely implement that in the next code iteration. At the moment I’ve been focused on getting a captive portal working to make the whole setup a little less clunky to use. I average when setting the tare weight, not sure why I didn’t do that for the actual measurements.

      This plant is right by a window, and to make matters worse, the window has a fan I use to circulate cool air at night. It could very well be that the wiggles are at least partially (if not totally) due to that. I haven’t check yet, but if it’s wigglier at night that would be a pretty compelling bit of evidence.

      I haven’t tried weighing the water during the watering, but I’ll give that a shot to see if it corresponds with the increase in weight as measured by the scale. I usually water it until it drains out the bottom, but I could easily capture that excess.

      I’ll see if I can put together a csv and send it your way!

  7. There are designs on the web that let the plant tell you when it needs water. Using Plaster of Paris or Gypsum blocks with embedded electrodes to measure “Suction” as the plant attempts to draw water from the soil (and block). Don’t know how well they work but look a kind of fun ceramics-like project. Plaster of Paris might be toxic, maybe.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.