Quantcast
Channel: Stories by Alex C.U. on Medium
Viewing all articles
Browse latest Browse all 4

Lessons Learned Creating a Plant-Watering IoT Device

$
0
0

…because you can’t code your way out of algae.

This is a follow-up to my previous article on the initial design & build process of the FloodBot. Admittedly, I left off on a bit of a cliffhanger with my results. What was meant to be just a short jump ended up becoming a bit longer thanks to life, but TL;DR — my plant is still alive! And I’ve already used the FloodBot a second time.

Since the first version was put to the test almost immediately after getting it working, I’ve had some time to both reflect on some design choices I didn’t think of at the time, as well as seeing how the initial design held up towards its goal. Seeing as how my plant is not dead and there were no major leaks or damage, I think it did pretty alright. That doesn’t mean there isn’t room for improvement, though…

Another set of eyes…

One of the things that bothered me the most during my time away from the house was that I could never “check up” on the FloodBot to see if it was actually working. My work-around during the first deployment was to use TeamViewer to get into my local Desktop, and then SSH from there into the RaspberryPi, and then check the system logs to see if my jobs had ran or not. Obviously, this was not at all an optimal solution for the paranoid.

My first addition came in the form of the RaspberryPi Camera module. While it’s true I could have used a USB webcam instead — the additional time to research and purchase a Linux-compatible USB camera (that won’t draw too much power) was not worth the trouble in my mind. The only issue now will be the waterproofing of the external module — but that’s much simpler with the small profile and thin ribbon-cable.

While we’re here, we can also take the time to refactor our logging to get the best out of our data. I opted for a simple dedicated CSV file with a scheme that uses keywords and time stamps to mark data points (in the format of: DATETIME,ACTION,DURATION). Below is a real example of the logging I generated during the FloodBot’s normal operation at home. It’s a simple enough scheme to extract any data needed in the future, as well as easily being expandable without making previous logs incompatible.

09/05/17–12:00AM,START
09/05/17–12:00AM,SPRAY,104
09/05/17–12:01AM,SIPHON,224
09/05/17–12:05AM,END

Physical systems can have bugs, too…

With an impending deadline approaching during my first build process, budgeting extended time for testing was just not be possible. Sure, we can run the process a couple times in a row to see any obvious problems, but we miss other issues that may appear a lot slower or less commonly.

In this project, the primary source of physical bugs comes from the “spray” side of the build. By not taking into account things like water exit force, UV exposure breakdown, and long-term stability — I came home to a contraption that was one or two days away from breaking down completely and possibly damaging my home. The final log of what “went wrong” on this side is as follows:

  • The force of the water expelling from the hose is enough to permanently move the position of the nozzle itself. Several days without correction had lead to the majority of the water stream missing the plant completely.
  • Along these same lines, the spray stream was directed at a particularly weak branch that eventually became damaged due to the recurring water force. This was “repaired” by wiring the branch and redirecting the spray, but it still should have been checked beforehand.
  • A lack of a “back-splash” in the plant receptacle allowed water to splash outside the container during normal watering periods. This problem was exacerbated once the nozzle had drifted from its original position as described above.
  • Intake filters for the diaphragm pumps were either not attached optimally, or were not durable enough to remain intact throughout their use period. This failure lead to F.O.D. entering the pump and damaging it beyond repair. (Luckily this looks to have happened only a day prior to my return)
  • The siphon intake was placed at the lower corner of the plant basin and secured with duct-tape. UV degradation of this tape (from direct sunlight) allowed the siphon intake to move under it’s own weight, and settle in a non-optimal position.

While some of these issues might have been mitigated with some more testing and longer observation periods, these lessons serve as a reminder that your assumptions of what can stand the test of time might not be correct.

The Green Menace

This next section won’t surprise anybody whose had their own hydroponic systems before — and I’m kind of surprised I was not called out on this in the original reddit posts. In my lack of experience with plant and water life cycles, I opted to use an opaque-white bucket to store my recycled water placed in direct sunlight. As a result, this was a great method for creating an algae farm in a high-rise apartment.

A microscopic image of one of the components of algae (c/o Wikipedia)

For those like me who were not aware — algae is a pretty much guaranteed outcome of any water system that contains water and fertilizer in sunlight. Do you know that unmistakable “pond smell” you get whenever you get near a large body of water? That’s algae, and that’s exactly what my water bucket smelled like.

You might be thinking: “Now, what’s so bad about having algae in your water? I always see other plants in and around pond water in nature so it must be fine…” And I admit I had this feeling as well when I first noticed it. Unfortunately, the local environment of a full lake ecosystem is a lot more providing than a simple water bucket. In this system, the algae can negatively affect your plant in a multitude of ways:

  • Lowered dissolved oxygen concentration
  • Clogging of physical pump systems
  • Reduced available fertilizer for your main plant
  • May promote root-algae growth to form easier-than-normal

That’s not so good for a slow-growing Juniper bonsai tree, so let’s get rid of it!

After scrubbing/tossing the parts with algae residue, a simple purging of the system with bleach-water for a day or so (along with a few water-rinses) should do the trick. This can definitely become a pain once your water system’s complexity grows, so it’s important to mitigate this growth sooner than later. Changing the opaque-white container to a sun-blocking container will be the largest improvement — and you can black-over all the external tubes as well if you really want to be proactive. A final step would be to disconnect your system during a period of adding fertilizer, and simply watering like normal until you believe the majority of fertilizer has been used.

Final Thoughts

The largest takeaway I’ve learned from this is that any successful design process will require knowledge of the environment and experiences at the border of a project’s scope. Before this endeavour, I never thought of looking up algae growth, or how long duct-tape will last in direct sunlight, or how cheesecloth handles in pond water for long periods; because these were not in my tunnel-vision of programming. Of course, more experience (and more testing) owning and designing projects will remove these uncertainties and unknown-unknowns; but for a first run I think this project can be considered a success.

If my foibles in plant ownership and lack of foresight has helped save you time in your own projects — I’d really appreciate applauding or recommending this article so other makers and coders can use it too! You can also follow me on twitter @au42 and on medium — the next part of this series will be posted along with the open-source implementation of the FloodBot project in C — and will go over the design and use of this code with a RaspberryPi.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images