Skip to content

phinduz/wateringSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watering system

It is intended to automate the irrigation process of your plants

Short description

Roadmap

  • 0.01 - Read configuration file and set-up objects
  • 0.02 - Add logging

Tasks

Documentation

  • Document where to start when starting to use the system.
  • Document serial protocol with examples

Python

  • Implement serial protocol in python environment

MCU

  • Implement serial protocol in arduino environment

Known issues, decide on actions

  • [ ]

System overview

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 *

Onboard environment

Arduino

Arduino Nano Rev3, arduino-nano.

arduino-nano-pinout

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).

Motor driver

L298 Dual H-Bridge Motor Driver L298-motor-driver

Flow sensor

Water flow sensor YFS 401 flow-sensor-yfs-401

Interface Onboard - Offboard

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
}

PC, Offboard environment

Getting Started

Install Python with modules

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".

Python Environment

Go to Python folder and run main_process.py

$ cd Python
$ python3 main_process.py --help

Coding style tests

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/

Generate documentation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages