I am sure, like me, you have that weekly/daily debate. Shall I water the plants or let them die? Okay maybe not let them die but the constant reminder to get out there and water before the impending horticultural disaster occurs bugs me to no end. Especially here in Texas during the summer. You got to be on top of it else you lovely garden will become a desert.
We have sprinklers set up for the front yard and they take care of the lawn quite well. An automatic sprinkler system that pops out of the ground on command and sprays that life-giving nectar to our thirsty lawn.
But since having that installed, we have experimented with growing vegetables and fruits. To our surprise, we actually grew something that we have eaten! My o my the satisfaction of Urban Farming.
So being the good software developer that I am (or lazy) any activity that is repeated more than once MUST be automated. So I must automate the watering. BUT I don’t want to pay all of that money to get things installed so voila, let’s build it ourselves.
There are several watering projects out there but I decided to go with what I have in-house and start there.
This is going to be a multi-part article that describes the build as I go along and some of the decisions made along the way.
Now I say “Voice Control” because why have an automated watering system if I can’t also control it by my Alexa. So I will be adding that control as well.
Here are some of the requirements:
- A simple device to control with Wi-Fi functionality.
- Control different watering zone.
- Control from Mobile device and both of the different control Hub I have, Samsung SmartThings or Hubitat.
- Set up a water schedule.
- Allow weather reports to change the watering schedule if required.
- Allow voice control of the device.
So the following parts are what I used. Some of them I already had laying around, so I went with those choices. FYI, the following are links are Amazon affiliate links so I will get some money if you buy. It will not cost you any different. Also, these are the parts I purchased. I tend to buy from Amazon as I get the parts quickly through Prime. I could buy some of these parts cheaper sometimes through eBay or Alibaba but you usually have to wait a while and I am impatient.
- Ventech 5am 12v DC power supply
- 12v Plastic Water Solenoid Valve
- JBtek 4 Channel DC 5V Relay Module for Arduino Raspberry Pi DSP AVR PIC ARM
- Makerfocus 2pcs ESP8266 Module ESP-12E NodeMcu LUA WiFi Internet New Version Development Board
- Adafruit 5V 1.5A Linear Voltage Regulator – 7805 TO-220
I went with the ESP8266 module as it fits right into what I am doing without overkill. With the onboard WIFI, I can join it to my network and send it commands. I programmed it using Arduino but with the Microsoft Visual Code IDE instead of the standard Arduino IDE as I have a lot of good programming tools at my disposal. I will go into more details in later articles on how I did this and what I installed in the ESP8266 to get it done. Of course, you have to go with the NodeMCU LUA language if you want but I was more comfortable with going to C and Arduinio.
The Relay module was a great find. Usually, you would require some driving circuitry to drive the relays from the ESP8266 or for the Raspberry PI for that matter. But the great thing about this relay is that it has the drivers built in along with diode back current protection. Just hook it up and you are ready to go. The only caveat here is that the logic is opposite so a LOW (0v) will close the relay and a HIGH (3.3v) will open the relay. So far I don’t think I need “pull up resistors” to deal with the processor startup in a determinate state but as I design I will test out that theory.
Also, take into account that the current draw from this relay per channel is also low, ~1ma., way within the specs for the ESP8266.
The solenoid is of course for “turning on” water flow. When off then nothing flows. When powered it opens the flow. I am going to have to come up with some creative ways to house these as of course there will be water involved. They are 12v devices hence the need for the 12-volt power supply. You could look for built-in 12v power supplies but this is what I had. Again we will need some creative housing design.
Now the Voltage regulator is required to power the ESP8266 from 5v. This development board will only regulate up to 10v DC and even though other specs say the ESP8266 can go up to 12v I did not want to risk it.
So hopefully this is enough to entice you into following this adventure. I will try and update this at least weekly over the next couple of weeks as I gouge out time from all my other projects.