Smart Indoor Plant Monitor - Know When Your Plant Needs Watering

4,940

83

10

Introduction: Smart Indoor Plant Monitor - Know When Your Plant Needs Watering

A couple of months ago, I made a soil moisture monitoring stick that is battery powered and can be stuck into the soil in your indoor plant's pot to give you some useful information about the soil moisture level and flash LEDs to tell you when to water your plant.

It does a great job, but it's quite prominent stuck into the pot and it's not the best-looking device. So this got me thinking of a way to make a better looking indoor plant monitor which could give you the information you need as a glance.

If you enjoy this Instructable, please vote for it in the Remix contest!

Supplies

Step 1: Designing the Base

After playing around with a couple of ideas, I thought of making a simple round base for the indoor plant to stand on, similar to a coaster. The base would consist of three layers, a layer of MDF, then an indicator layer that would light up to show the status of the plant, and then another layer of MDF.

The indicator layer would be lit up by an RGB LED which would go green when the plant had enough water and go red when the plant needed water. The levels of moisture in between would be varying shades of yellow/orange as the LED transitions from green to red. So a greeny-yellow would mean that there is still a fair amount of water and an orangy-yellow would mean that you'd need to water your plant quite soon.

I still wanted to use the same capacitive soil moisture monitoring sensors that I used in the first project, as I had a couple of spares. This time, however, there won't be any electronics attached to it directly, all of the processing would be done in the base.

The microcontroller I decided to use was the Seeeduino XIAO because its really small, it's Arduino compatible and it costs just $5.

I started out by measuring up the base of the pot so that I could make the new base slightly larger. I designed the components in Inkscape to be laser cut as well as in PDF format to be printed and cut by hand. You can download the templates here.

Step 2: Cutting the Acrylic & MDF

I cut the components out from 3mm MDF and 3mm clear acrylic on my laser cutter. If you don't have a laser cutter, you can print out the PDF templates and cut the components out by hand. Both MDF and acrylic are quite easy to work with.

In order to get the RGB LED to light up the edges of the acrylic layer, you'll need to roughen them up using some sandpaper. I used some 240 grit sandpaper and sanded all of the edges of the acrylic until they had an even white haze. The rough edges diffuse the LED's light and make the acrylic look as if it is lighting up.

Step 3: Assembling the Base

Next, glue the layers together using some epoxy adhesive.

Only use a small amount of epoxy, you don't want it to seep out of the edges and onto the acrylic faces which you've just sanded or you'll have to sand them again.

Use some small clamps to hold the layers together or put them under a heavy object while the epoxy cures.

Step 4: Soldering the Electronics

While the epoxy is curing, you can solder your components together.

The circuit is quite simple, you've just got two PWM outputs to control the RGB LED, one for the green leg and one for the red leg, and then a single analogue input to read in the sensor output.

You'll also need a current limiting resistor on each of the two LED legs. The green light from these LEDs is generally much brighter than the red, so I used a 220Ω resistor on the green leg and a 100Ω resistor on the red leg to balance the colours out a bit better.

These capacitive soil moisture sensors are supposed to be able to run on either 3.3V or 5V, however, I have had a couple which just don't output anything when powered by 3.3V. If you find that you get no output from your sensor, you might need to power it from the 5V supply on the Arduino - Vcc instead. The sensor steps the voltage down anyway, so you'll still only get a 3.3V output. Be careful if you use a different model sensor as this particular Arduino can only accept up to 3.3V on the analogue inputs.

Step 5: Installing the Electronics

Next, you'll need to install your electronic components into your housing at the back of the base.

When I tried to assemble my components the first time, I saw that I'd been a bit optimistic in thinking that I'd get them all into the two-layer space, so I had to cut an additional spacer layer.

Push your LED into the hole in the acrylic, making sure that the brightest part of the LED is within the acrylic layer. So don't push it all the way in.

Then glue your Arduino into the housing and the header pins onto the top cover. You can use epoxy or a glue gun for this step, I used a glue gun as it sets faster. It's also a good idea to cover the soldered joints on the header pins with glue so that they don't short on the legs of the LED when you close it up.

That's it for the assembly, now you just need to program it.

Step 6: Programming the Arduino

The sketch is quite simple. It just takes readings from the soil moisture sensor and then maps these between the wet and dry limits. It then uses these mapped values to drive the two LEDs proportionally.

So the red LED is on completely and green is off completely when dry and visa versa for wet. Intermediate levels have scaled PWM outputs to provide the varying shades of yellow/orange.

In my first version of the sketch, I just updated the LEDs with each value read in from the sensor. I noticed that there was some variation in measurements and every so often there was a value which was significantly higher or lower than the others, which caused a colour flicker/glitch. So I changed the code a bit so that the past ten readings are averaged and this average drives the LED colour rather. This makes the changes a bit more gradual and allows for some outliers without significantly affecting the colour.

This data can be seen in the Serial monitor output.

You can download the sketch here along with a full description of the code.

Step 7: Calibrating the Sensor

The last thing to do before you use the monitor is to calibrate the sensor. You'll need to do this so that your Arduino knows at what moisture level your plant has enough water and at what moisture level it needs water. This is an important step because each sensor's output is slightly different based on the position and soil type and each plant has different watering requirements.

The best way to do this is to start with your "dry" plant, with the soil at a moisture level where you'd expect to water it.

Place your plant onto the base, push the sensor into the soil (don't submerge the electronic components), and then plug the sensor into the header pins on the base.

Connect your Arduino to your computer and open up your Serial monitor. You'll need to add a Serial.print(""); line to the code to print your sensor's outputs to the Serial monitor so that you can see the raw values. You want a new value to be displayed every 1-2 seconds, you can change this using the delay. You can output the moving average result as well if you'd like, you'll just need to wait a bit longer to get your stabilised readings.

Note the average of around 10-20 readings once they have stabilised, this will be your "dry" setpoint.

Once you're happy with the dry readings, water your plant as you would normally. Give it enough water to be fully absorbed into the soil, but don't drown it. Now do the same as before and get an average "wet" setpoint.

Update the two set points in the code and then re-upload the sketch and you're ready to start using the base properly.

Step 8: Using the Smart Indoor Plant Monitor

Since you've just watered your plant to calibrate it, the display should be green. It will slowly start going yellow and then red again over the next few days as the soil dries out.

Because of the moving average array, there is a bit of a delay between when you water the plant and when the sensor goes green again. It should turn green after around 20-30 seconds.

If you're going to use the base in a really sunny spot then you might want to add a second or third LED and another acrylic layer to the base to make it a bit larger and brighter.

Let me know what you think of this monitor in the comments section below. What do you like and what would you change?

As mentioned before, please vote for this project in the Remix contest if you enjoyed it!

Have fun building your own!

Remix Contest

Participated in the
Remix Contest

Be the First to Share

    Recommendations

    • Arduino Contest

      Arduino Contest
    • Toys & Games Contest

      Toys & Games Contest
    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest

    10 Comments

    0
    RyanMake
    RyanMake

    8 months ago

    Are you using a pot that has a drain hole in the bottom? It could be interesting to feed the moisture sensor through the drain hole in the bottom of a pot so that you could have the whole system integrated into the base plate. This could then be augmented by having some plates in the drain pan that are testing for conductivity that would indicate if the drain pan has standing water to let you know if the plant has been over watered and the drain pan is about to overflow

    1
    thediylife
    thediylife

    Reply 8 months ago

    The pot I'm currently using doesn't have drain holes, but this is a great idea for those that do. It would also help if you got a version of these sensors with a separate "probe" or were waterproof. The trouble with these sensors is that the electronics are exposed and are at the end of the spike, so pushing it into the bottom creates a water drip path through the electronics, which would be difficult to aovid.

    0
    RyanMake
    RyanMake

    Reply 8 months ago

    Interesting. I have read a little bit about these sensors and how the electrodes suffer from corrosion but I imagine the getting the electronics wet would result in a bigger problem much sooner. I will have to look at the probes that are available maybe if the electronics were recesssed into the base with the probes coming through a gasket or if the electrodes could be on leads to let keep the electronics safe.

    0
    thediylife
    thediylife

    Reply 8 months ago

    There are two common types of these moisture sensors, resistive and capacitive. The resistive ones are more accurate and reliable, but suffer from corrosion over time (a few months). The capacitive ones last much longer, but they're less accurate. I guess it depends on the project, for something like this which just relies on wet and dry limits, the capacitive ones work just fine. For projects which require accurate monitoring of the actual moisture level, you'll probably want to use a resistive sensor.

    0
    thediylife
    thediylife

    Reply 8 months ago

    Thanks Amruth

    0
    SaharT2
    SaharT2

    8 months ago

    Amazing idea and the steps are easy to understand and implement!

    0
    thediylife
    thediylife

    Reply 8 months ago

    Thanks Sahar

    0
    MPR Industries
    MPR Industries

    8 months ago

    Very nice build and very clear. I like how it's interchangeable as well (as long as the pot has the same sized base) but have you considered building one into a plant pot itself? You could seal off the components along one internal side and either have the glow around the top or as just a basic light stick popping out of the soil.

    1
    thediylife
    thediylife

    Reply 8 months ago

    Thank you! I’ve thought about trying to 3D print a pot with an integrated holder for the electronics, that’s sort of how I eventually arrived at this idea. I’m not sure how well it would hold up with being permanently wet/damp though. I like your idea to integrate it into an existing pot!