Software apps and online services
I used to go out continuously but worry about who will water my plants reliably. Also I am not sure it would get sunlight anywhere else properly if moved elsewhere.
I use my various IoT skills and create an auto-pumping solution to water the plants when I am not home.
- Procuring and understanding the Optocoupler relay module electric diagram (Link).
- A continuous online solution which requires a separate, dedicated water tank (a pipe from bathroom or kitchen and leaving water on with electronics is not really my idea of safe :-) ).
- A reliable power supply which gets me 5v to power the relay separately and in isolation so it can do long term protection to Pi.
- Procuring a pump motor compatible with my requirements.
- I decided to go with LM7805 IC with a 9v battery clip and capacitors to give smooth power to my relay board. (This solved the power requirement for me. Plus, by my calculations, the whole thing only takes power from LM7805 when an input signal from Pi is given so I believe its energy is efficient enough for my requirements. Later, I found out this wasn't the case. The LM7805 IC takes standby current of 3ma or so, draining my 9v battery in 4.3 days!)
- For the pipe, I had to go with the local pipe store to obtain a pipe and see that the pipe fits the mini pump.
- I had to code very carefully taking into account to dispose and reclaim the GPIO pins. Also, from what I gather, this is an endurance project unlike my previous projects. That means any decision I take will need to be carefully measured against entire year. (For instance, if I blink a status LED @ 1 min on/off. Number of blinks in years transforms to 525600! As the LED will blink for 365 days a year till the solution is on.) Hence I have to weigh my decisions properly.
- I had two choices: get a pump or get a solenoid to turn water on/off. My earlier decision of solenoid, however, was problematic to say the least as when you go up against a portable tank with absolute low water pressure. Water may not flow from the solenoid. Hence I purchased and went with the submersible pump. (Link for this part is attached. Manufacturer of pump was good and went over and above the call of duty to help me.)
- The Optocoupler IC diagram was hard to procure but once I had it I immediately understood the module and used a transistor to ground the main output line on a signal from the Pi. Lesson learned. (ALWAYS go through your parts documents before you purchase, people. Don't rely on YouTube videos which just show how they integrated parts. For all we know they could be wrong, as well! A part is only as good as its documentation.)
- Final assembly and the challenges faced overall is also a point in on itself which I will shed light on in more time.
- Long life of the 9v battery is a must. I used BC547a transistor as a switch to switch on the power to LM7805. (This step was taken after carefully measuring standby and active relay current using a digital multimeter.)
- I also kept everything in an enclosed plastic box, so that the components are not disturbed.
Enjoy the pics and videos.
Just try doing this on your own and the experience of building this is good in itself.
For the code, I designed it to be modular and have a boolean value for powering entire modules selectively. Also, a headless app seems to be the perfect way to go, so that the Pi does not consume resources in the long run.
The project seems to be running fine until this point. The proof in pudding is that Sunday morning I woke up late and saw that the plant was automatically watered.
Added a link for the relay diagram.
Added a shutdown tactile switch to the circuit. This will switch off the device if the shutdown switch is pressed when LED blinks for safe shutdown. I also covered the whole box so that its in the shade.
The project is watering regularly and everything's working good, but I thought to myself why stop here?
I noticed my hibiscus plant always seems to bloom somewhere in the night. So I decided to catch it in the act! Attached is a time lapse video, created using IPlanty snapshot module (newly created).
For those interested the module opens up a Windows IOT headed app and takes a snapshot. This is a workaround as my Logitech webcam C210 needs time to warm up and if I try to take a snapshot immediately, then I get black images as a result. The workaround for this is that I start the image preview mode (not available in WinRT due to com issues) and then capture a photo in between. Code for this is attached.
I think this workaround is fine and hope that this trick is not removed in future versions of Windows IOT.
The project seems to be going good for now, I have increased the duration that the pump stays on.
Also in the code, I have included a test mode function so that whenever the app starts all the circuits can be inspected visually by me!
Checking time! The plant seems to be holding fine. Also, my 9v battery which gives 10v according to my multimeter is showing a drop of 0.18 voltage drop (total: 9.82V) which means my fix of adding a transistor to shut off the circuit is working! :-)
Its been a long time but the wait will be worth it as i have now developed a Xamarin android app to remotely control the IPlanty project .The results are spectacular !(Switching the pump on/off via remote has a totally different feel to it). I've borrowed from my previous MQTT project so for eager minds please check out my MQTT project ! I shall do more improves on this in coming days Stay tuned!