It is intended to automate the irrigation process of your plants
- 0.01 - Read configuration file and set-up objects
- 0.02 - Add logging
- Document where to start when starting to use the system.
- Document serial protocol with examples
- Implement serial protocol in python environment
- Implement serial protocol in arduino environment
- [ ]
The system consists of:
-
Onboard environment
- Arduino
- Temperature and humidity sensor
- Ampient light sensor
- Soil moisture sensors
- Power supply unit
- Water pump
- Relays controlling ball valves
-
PC/Raspberry PI, Offboard environment *
Arduino Nano Rev3, arduino-nano.
The MCU (Arduino) is connected to peripherals with 4 different electrical interfaces, I2C, PWM, “Digital & Analog” and Serial. Design wise the MCU is aimed to be as simple as possible offering sensor data and executing watering commands. Needed configuration, calibration and transformation are targeted for implementation in off board environment (PC/Raspberry PI).
L298 Dual H-Bridge Motor Driver L298-motor-driver
Water flow sensor YFS 401 flow-sensor-yfs-401
Signal name | range | Comment |
---|---|---|
["a0"] | [0 1023] | Analog input 0 |
["a1"] | [0 1023] | Analog input 1 |
["d0"] | [0 1] | Digital input 0 |
["i2c_0x75_0x04"] | [-] | I2C address 0x75, register 0x04 |
Example of raw_data:
{
"a0": 345,
"a1": 94,
"d0": 0,
"i2c_0x75_0x04": 4621
}
Install python 3:
$ sudo apt-get install python3
Go to the repo root and install the required packages:
$ python3 -m pip install -r requirements.txt
If python is installed for all users in Users/Program Files/ then the command above needs to be executed in a shell that has been started with "Run as administrator".
Go to Python folder and run main_process.py
$ cd Python
$ python3 main_process.py --help
For python code PEP 8 is followed. Look at the example How to Write Beautiful Python Code With PEP 8.
Enforce your coding style using eg. Flake8.
$ python -m pip install flake8
and run:
$ flake8 path/to/code/
To generate this documentation in html, install grip
$ python -m pip install grip
To export to html run:
$ python -m grip README.md --export README.html
To render directly:
$ grip -b README.md