A plant soil moisture management application using Arduino MKR 1000, moisture sensor and 5V pump.
This project contains the Arduino sketch in the arduino folder and the Django REST framework-based API. There is also example configuration files to deploy the application using nginx and gunicorn in etc. It is up to you to learn how to deploy a Web service using Django, nginx and gunicorn but feel free to open issues if you have questions, suggestions or (constructive) critics on this project itself.
This project was realized using this kit available from Amazon. I had two problems using it. Firstly, the relay was open when HIGH on the Arduino pin and closed when LOW. Secondly, the pump was creating important electric perturbations, causing strange characters to appear on the screen and changes on the analog moisture measures.
Thanks to this page and the Electronique/Dépannage/Mécanique/Physique/Chimie/Informatique/Modélisme Facebook group (thanks Olivia!), I was able to make it work as I wanted. You can see on the upper right the filtering part and on the lower right the transistor-based inverser.
After testing on the above breadboard, I made this perfboard schema:
I made some little changes during the soldering itself and got this result:
Starting the service in deploy mode:
$ sudo service gunicorn start
Starting the service in debug mode:
$ source /home/gael/miniconda3/bin/activate moisture
$ python manage.py runserver