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.
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.
- 3 moisture sensor. OSOYOO moisture sensor.
- 3 12v water pumps. Amazon JP item
- 3 relays. OSOYOO relay
- 3 100Ω potentiometers for moisture setting. Amazon JP item
- 2 100Ω potentiometers for watering amount setting.
- 1 Arduino Nano. Amazon JP item
- 1 LoRa UART module. OSOYOO LoRa module
- USB charger plug. You can find anywhere.
- AC 110v to DC 12v power supply converter. I recicled from my old router.
- Wires, board, sprinkles, hoses, soldering stuff,...
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.
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.
I used LoRa device to send the moisture readings and the watering amount settings to the cloud.
- The LoRa serial communication transmits some bytes through low radio to another LoRa device installed on a RaspberryPi.
- The RaspberryPi is connected by wire to internet, converts the bytes into a request to record a metric into AWS CloudWatch.
- I configured the dashboard with the history chart of them and also some Alarms to get noticed when something unexpected is happening.
You can find the very basic script installed on RaspberryPi as a service in /rpilora_service.
Jaume Mila <[email protected]>