Controller for watering your plants powered by an ESP8266. Controlls soil humidity with a capacitive soil moisture sensor and waters plants accordingly. Watering and soil humidity can be supervised in the browser.
Schematic diagram:
How to run:
- Install Arduino IDE (in this case 1.8.5) and add ESP8266FS in the Arduino tools folder (create it if it does not exist: 'Arduino/tools/ESP8266FS/tool/esp8266fs.jar'). This way after a restart of the Arduino IDE "ESP8266 Sketch Data Upload" should show up in tools.
- Libraries needed for running 'flowers of things'.
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <FS.h>
#include <pins_arduino.h>
- Provide SSID and password for internet connection (needed for timestamp) in the sketch. Don't forget to change the OTA password.
- Set parameters for watering in '/data/config.json'
- 'humiditylimit' - humidity threshold triggering watering
- 'waitingtime' - waiting time to next watering
- 'waterduration' - watering time for one cycle
- Transfer files in data folder by pressing "ESP8266 Sketch Data Upload" in the tools menu. This can be tricky sometimes. If uploading fails try to unplug USB and start "ESP8266 Sketch Data Upload" immediately after you plug it in again.
- Compile and flash ESP, check serial monitor for IP address.
- Direct your browser to the IP address or choosen DNS (in this example http://esp8266.local) and see if the graph is working.
- Measurement parameters can also be extracted via HTTP GET (example in Debug):
- soil humidity: curl --request GET --url http://YOUR-IP-or-DNS/soil
- air temperature: curl --request GET --url http://YOUR-IP-or-DNS/temp
- air humidity: curl --request GET --url http://YOUR-IP-or-DNS/hum
Exemplary plot:
Component list:
- Europlatine Hartpapier
- Zettler Electronics AZ822-2C-3DSE Printrelais 3 V/DC 2 A 2 Wechsler 1 St.Artikelnr. 507428
- Kapazitiver Analog Boden-Feuchtigkeitssensor Capacitive Soil Moisture Sensor
- 12V Wasser Pumpe Wasserpumpe Trinkwasserpumpe Frischwasserpumpe
- Standarddiode Vishay 1N4148-TAP DO-204AH 75 V 300 mA Artikelnr. 564851
- GS12E12-P1I :: Steckernetzteil, 12 W, 12 V, 1 A, stabilisiert
- LM2596
- DHT22
- 12V Magnetventil
- WEMOS D1 Mini
- Schlauch
- Micro USB 2.0 Kabel, USB St. A / USB Micro St. B,
- Delock Adapter DC 2,1 x 5,5 mm Buchse
- Micro-Drip-System rohrhalter
- Nylon Y-Stück 3fach Schlauchtülle 6mm
- Nylon Schlauchverbinder Reduzierung 6 x 4mm
- PVC Schlauch transparent 4/6mm Meterware
- resistors (330 Ohm, 4.7 kOhm)
- ESP8266 Test Board Burn Unterstützung ESP-12S/12F/12E/07S Module BAF
Alternative components:
- PMIC - Spannungsregler - Linear (LDO) Microchip Technology MCP1700-3302E/TO Positiv, Fest TO-92-3
- Teapo SY 100uF/35V 6,3x11mm Elektrolyt-Kondensator radial bedrahtet 2.5 mm 100 µF 35 V 20 % (Ø x L) 6.3 mm x 11 mm 1 St
- Esp8266 Esp-12e Wireless Remote Serial Wifi Transceiver Board Modul Ap
- USB ESP8266 ESP01 Seriell Adapter Programmierer ESP 01 UART Arduino
- 5PCS ESP8266 Mount
- ESP8266 Developerboard
References:
- sketch adapted from https://github.com/tttapa/ESP8266
- many thanks to the very helpul guys from FabLab Neckar-Alb e.V.
Icons used for favicon:
- Plant by rivercon from the Noun Project
- drop by Creative Stall from the Noun Project
ToDo:
- save input boxes for wrong input/make more userfriendly
- interactive plots (Zoom, Ajax, websocket etc.)
- MQTT/NiFi
- password from web useage without VPN
- initialize sensor before measurement so its not always on
- horizontal and vertical lines in plots to mark thresholds and watering time
- only keep the last X days in memory instead of deleting when file is too big
- water height sensor for tank
- BME280
- write about OTA