westial / waterarmy

Embedded program to water some plants according their moisture level with an example implementation for Arduino.
GNU General Public License v3.0
2 stars 0 forks source link

waterarmy

Firmware for watering my office plants according their moisture level. In this Readme file I'm going to give some details about the prototype and also about the software architecture used on.

System

Introduction

There are 3 plants in my workspace and during some periods I cannot waterthem properly. Vacation, travel, etc. I needed some kind of automated watering system.

Moreover personal motivations like going deep into IoT and LoRa appliances and so on.

Prototype

Prototype

Parts and circuit

Circuit Schema

How it works

Every 4h it asks for moisture to every plant. If a plant is under its moisture setting it runs the watering pump according to its watering amount setting.

I included 2 watering amount setting potentiometers only. The first plant it's the biggest one and the one which needs more water. So the first plant is te 100% watering amount, and the other ones take it as a reference to measure their potentiometer values.

Software architecture

It's composed by two parts: the abstracted use case and the Arduino implementation.

The abstracted use case uses some interfaces to get the business work in the main use case Watering.cpp. This part is located in /waterarmy_lib directory. The component interfaces are available for implementation in the same directory.

The Arduino implementation takes every Watering use case dependency interface and provides its implementation for Arduino Nano. After it injects the dependencies into the use case constructor and invokes it every interval. There is only a little logic in the Arduino loop() method.

Cloud logging

I used LoRa device to send the moisture readings and the watering amount settings to the cloud.

Log

You can find the very basic script installed on RaspberryPi as a service in /rpilora_service.

Log

Author

Jaume Mila [jaume@westial.com](mailto:jaume@westial.com)