Software apps and online services
It's summer-time, it's hot, and it's dry. For your lawn, your mind says golf-course green, but Mother Nature says Sahara desert sands. Or maybe it's late fall when landscapers are busy over-seeding lawns before the frost sets in. Wherever you find yourself in the situation, you're probably watering your lawn. But the question is - "When do I water my lawn? And how much do I water it?" Really their is no single answer. With so many different species of grass, different soil conditions and compositions, one size doesn't fit all. But if you decide you want to take matters into your own hands, a Water Buffaloo might be your golden ticket.
The Water Buffaloo is a Wi-Fi enabled soil moisture monitoring system. With the help of a Sparkfun Soil Moisture Sensor, an outside-dwelling Particle Photon monitors the amount of moisture in the soil, and is programmed to report when the soil moisture reaches a lower bound. With such a system in place, there is no question as to how frequently a lawn needs to be watered. Simply wait for a notification on your phone, and a flashing LED, driven by another Photon in your home, to tell you when.
To measure soil moisture outside, you've got to have a sensor. Where you have a sensor, you've got to have something to power and read that sensor. Outside on the lawn is this black box, with this white pipe.
This black box is the housing for the sensing Photon. It's weather-resistant, and it only cost $10 from Harbor Freight with a coupon (https://tinyurl.com/yd466qb5). Inside it looks like this:
Yes it is big for the job, but that will come in handy for mounting a solar panel to it in the future.
Inside, the Photon is powered by a battery pack - 3 AA batteries. With a little ingenuity, wire, and solder, this 6 volt 4 battery pack was turned into a 4.5 volt 3 battery pack - the perfect voltage for the Photon to operate. While you could use a Li-Po battery with a solar panel to charge it, and that is the long-term plan for this project, some AA batteries will do for now. This Photon is programmed to wake up from deep sleep mode (where it can conserve power) every hour. It wakes up, connects to Wi-Fi, powers the sensor, reads the sensor, then transmits data to the cloud. After which, it immediately powers off for the next hour. The time your Photon remains asleep is dependent on your thoughts, but once every hour should be frequent enough.
The sensing Photon will be the one sending data to the cloud that is searched for by the indicating Photon, IFTTT, as well as a Webhook sending data to Thingspeak for data analysis.
ThingSpeak Data Link: https://thingspeak.com/channels/361274
The soil moisture sensor is housed in 1 1/2" PVC pipe components sourced from the Home Depot. How you choose to weatherproof the electrical components is up to you. I simply cut a notch in one end of the contraption and epoxied the sensor in place. While it's not ideal, it will work.
To be honest, I'm not sure where you can find them for YOUR soil. Luckily I have a Civil Engineer for a brother, who directed me to this data: https://tinyurl.com/y8xo4xfk In the Charlotte region, soils vary from curve 8 to curve 24. Approximating at curve 16, about a 20% moisture content is ideal for infrastructure. While we're not building a coliseum, this data should get you in the right area. Around 25-30% soil moisture is probably a better guess.
For this project we decided to use a remote photon. Ideally, this project could operate without it but we wanted to add an additional feature to our water sensor. For the sake of simplicity, we chose to keep our remote photon to a basic operation. When the water sensor publishes the "wateron" command to our event "WaterBuffaloo" on Particle.io, our remote sensor then reads this through a Particle.subscribe function written into our code. Once the command is recognized, our remote photon will illuminate an LED on the breadboard for 3 seconds. Again, we chose here to demonstrate a simple feature. However, this is where this remote photon can provide added functionality to this project.
For example, if the "wateron" notification is sent to our cell phone in the middle of the day, we might forget about it by the time we get home. With the remote photon we can have a secondary visual notification as a reminder. It should be noted that our code is written to flash the LED for 3 seconds and then turn off. But this is where a user can manipulate the code to do an assortment of operations. The LED can blink constantly until it reads a "wateroff" command, it can stay illuminated until the user sends an "off" command, it can blink for a predetermined amount of time; the possibilities are endless. Or, we can go away from the LED and the remote photon can be linked directly to an irrigation system and programmed to turn the water on and off. This would obviously take a different function in the code, but is definitely possible.
The remote photon is a excellent bonus feature to have and as seen in the code below, not very difficult to add to the water sensor project. The required parts for the remote photon are:
A few things that you should know when it comes to this project involve the sensor and IFTTT. If you rely only on IFTTT to send notifications to you via e-mail/text/tweet/etc. then you might consider a second/backup method. Apparently Particle likes to mess with their firmware every now and then, and there was a 1-week period where Webhooks were failing and IFTTT was giving off errors constantly.
Secondly, this sensor is rather crude in its measuring. There are lots of variables that affect the measurements from the sensor. Dense, compacted soils caused an instant high moisture level of over 95% moisture no matter how dry the soil was. If you have the tools to do so, you should do controlled moisture tests and fit the sensor value to a curve against controlled moisture values. We suspect that the sensor has a sweet spot in application that needs to be found. We haven't found this spot as we have no way of determining soil moisture content aside from this sensor.
Here is a document outlining this procedure:
Otherwise, this is a great introductory IoT project. In the future I (Dalton) will be outfitting this system with a valve to run a sprinkler system fed from a rain barrel, and control the pump to do so. The hope is to have a completely autonomous sprinkler system to keep our lawn looking great.