Close
0%
0%

Automatic “Smart” Outdoor Waterer

Keep your outdoor plants happy and avoid wasting water

Similar projects worth following
In the front of our house are some rose bushes, but unfortunately, they are JUST under the eave of the house which means more often than not, they are incredibly dry. I have no interest in plant maintenance and my wife frequently forgets to give them some love, so this seemed like a great/easy project for automating. Instead of just using a timer, I wanted to both check the moisture level of the soil and pull in some weather data to decide whether to water now or wait for some expected rain. Way overengineered? Yes. Worth doing? Hopefully, maybe, I think?

I actually ‘started’ this project several years ago using my microcontroller of choice at the time, a Particle Photon. I got the basics working easily enough, but I got hung-up on the weather data portion at the time. I have my own weather station which reports to Weather Underground and I REALLY wanted to use the forecast for my specific station. They offer a free API for folks that have a weather station, but my complete lack of actual coding skills meant that I was never able to get it to work properly. I ultimately shelved the project for quite some time but picked it up again after setting up a Home Assistant instance; this made things a lot easier for my none-coder-self to get everything to play nice together, albeit without using the forecast for my specific weather station.

Once I started utilizing Home Assistant, I knew that I would be using ESPHome with all of the ‘smarts’ being done by logic on my local HA server. The ‘code’ for the microcontroller is simple enough that it doesn’t really count as programming; it’s a short YAML file that I flashed onto my ESP device. From there, I just monitor (and ultimately automate) everything within Home Assistant.

I started off by attempting to monitor a houseplant and initially used an ESP8266 but ultimately switched to an ESP32 to give me an extra analog input (didn’t think I’d need it for my initial use-case, but I planned to make a PCB and I wanted it more multi-purpose for situations where I might want multiple soil sensors). Yes, I could have used an ADC to get way more inputs, but I had an ESP32 on-hand and I didn’t foresee a situation where’d I’d monitor more than 2 sensors anyways. Throw in an analog soil moisture sensor, a 12V solenoid valve, resistor, diode, capacitor, 12V to 5V regulator and a transistor for controlling the solenoid and I had a finished prototype. Once I went through a couple dry/watered cycles with the Aloe plant in my office window, I was satisfied that the sensor would give me reliable and useful readings so I designed a simple PCB. I opted to use phone plugs (RJ11) for the inputs/outputs to make it more user-friendly instead of screw terminal blocks that I normally use. This didn’t end up being QUITE as user-friendly of an improvement as I envisioned, as I ultimately designed the case to still require opening it up to make the connections (felt like the best way to make it more water-resistant).

After receiving the finished PCB and assembling it, testing confirmed I didn’t mess anything up in my ELECTRICAL design; I did however realize that I failed to check the width of the pins for the ESP32. Luckily it was a small enough difference, that by adding header pins I was able to make it work. I then made up some simple enclosures for both the PCB as well as the top of the solenoid valve and got some fittings to allow me to use the valve with standard garden hose threads. With the physical design ‘done’, it was time to install it outside and take it for a spin.

Install was pretty simple and straight-forward. I had originally planned to use some heat-shrink on the top of the soil sensor, but ultimately chose not to. Partly this was because I didn’t have any large enough on-hand, but I also was curious how long it would last completely exposed to the elements. It’s a cheap part, I already assume that it will fail in short-order anyways and I wanted to see the quickest that it would need to be replaced as a baseline before I start trying to protect it (that way I know if anything I do actually makes a difference). With it all installed, I did some quick testing of the valve to ensure it operated properly and didn’t leak (mainly on the inlet side). I also wanted to get a rough idea of how long it would need to ‘run’ to start affecting the soil moisture readings. While I didn’t time things, I ran it for a few minutes and subsequently noticed the soil moisture readings start increasing from ~20% to ~75% for the next ~30 minutes, before dropping some...

Read more »

Auto Waterer.sch

Eagle Schematic file

sch - 295.58 kB - 07/19/2022 at 20:32

Download

Auto Waterer.brd

Eagle Board file

brd - 94.80 kB - 07/19/2022 at 20:32

Download

Standard Tesselated Geometry - 253.40 kB - 07/19/2022 at 20:31

Download

Standard Tesselated Geometry - 218.64 kB - 07/19/2022 at 20:31

Download

Standard Tesselated Geometry - 934.95 kB - 07/19/2022 at 20:31

Download

View all 8 files

  • 1 × ESP32
  • 2 × TIP120 Transistor
  • 2 × 1N4004 Diode
  • 2 × 1kOhm Resistor
  • 1 × 7805TV 12V to 5V Regulator (and heatsink)

View all 13 components

  • 1 Month Later

    Ben Brooks08/16/2022 at 17:47 0 comments

    It works? Maybe? Outside of strange reading spikes during watering (the voltage jumps really high, more than it does when in dry air), it seems to be giving me pretty consistent/meaningful readings. I did notice a lot of variation early on, but I realized this matched with temperature changes quite closely, so after gathering a little data and doing a curve fit in Excel, I was able to filter this out for the most part.

    I ultimately adjusted my control scheme to only check the moisture level once a day. I started with it doing it super-early in the morning, but it happens that the faucet is RIGHT next to our bedroom and the flow is large enough that it's quite loud. The water-hammer from it shutting off is even louder, so I changed this to check in the evening, a bit before we go to bed. No more getting woken up by my sentient house.

    I also put together an additional sensor and found the readings to be in the general ballpark as the original sensor. Still required calibrating to get them essentially matched up (I just left them both in dry air for a few minutes and then put them in cups of water to get both extremes). I also noticed that the new sensor has much more stable readings and DOESN'T have the strange voltage jumps during watering. Not sure if I did a poor job sealing up the wiring on the first one, or if the few extra months of use is the culprit. One other random thing I noticed; when I plugged in the additional sensor the reading for the other sensor changed as well (can't remember if it was up or down). Not really sure why this is, unless they have enough power draw to lower the actual voltage of the whole system with both operating? Whatever, it works.

    New Sensor. Notice the much cleaner shrink-wrap work this time.

    I've since moved the 'new' sensor to another part of our garden and set it up to check the moisture level every evening and send my wife a notification that the plants would like some water if it's below a certain value.

    I also used this project to solve another 'problem'. We have a small fountain in our yard that regularly requires having additional water added to it. I had already added a 'smart' plug so I could automatically turn it on/off (tied to motion from a security camera) so it would only run when we're in the backyard and shut it off and send myself a notification when the power draw dropped suddenly (the pump power draw is related to flow; low/no water equals less power draw). By adding a second valve to this project and running a hose to the back of the fountain, I've now removed myself from the equation and the fountain is able to fill itself when it gets low (and still shuts off/sends me a notification if a filling cycle doesn't actually fill it up).

    Pretty satisfied with the outcome of this project, although time will tell how durable the various components are. I plan to take the whole thing inside over the winter to avoid unnecessary wear and tear. If the sensors can last a season before needing to be replaced, I'd be more than happy. 

  • Welp, that was quick!

    Ben Brooks07/19/2022 at 21:24 0 comments

    Literally not but a few minutes after posting this project, I started getting wacky readings from my soil sensor while going through the watering process. Upon further examination, apparently water and electronics don't get along well together; who knew!?

    After using a heat gun to dry everything out and verify that I was still getting reasonable readings, I found some larger heat shrink tubing that I had forgotten about and added this, along with some electrical tape to hopefully seal it all up. I could have used heat shrink for all of it, but alas, I didn't add the necessary pieces to my wiring before soldering up the larger connectors. When the sensor finally fails (hopefully not for a while), I'll make sure to do a better job with planning this part out.

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates