Sonoff Watering Timer

by marco.sillano in Circuits > Tools

90 Views, 1 Favorites, 0 Comments

Sonoff Watering Timer

cablata.png

Tired of changing the terrace irrigation timer every 2 years, I decided to design a timer: obviously IoT and based on MQTT.

The result is this complete DIY project of an irrigation timer, better than many commercial timers, designed and manufactured according to the state of the art.

This timer contains a STA (WIFI client), an AP (not used), a MQTT client and a MQTT server (broker), provided with programmable logic (script): in practice a mini mosquitto + node-red on-board! So in this project the operating logic is all internal: an external MQTT server 24/7 is not required (in fact I think a server 24/7 is too much to water a terrace!).

The timer is totally autonomous, but at the same time always compatible with external standard MQTT clients and brokers. A probe monitors the state of the soil (dry/soaked, with adjustable threshold) and conditions the watering. Monitoring and configuration of the timer are performed with MQTT clients with dashboards, both on a PC and on a smartphone. Access is local via WIFI, but can be made Internet global using a free dynamic DNS service (example noip: https://www.noip.com/).

While using updated and quality components, this timer is very cheap: total cost less than € 15 (US$ 18)!

All this is made possible by the happy union of two phenomenal products:

Sonoff basic, economic WIFI card with power supply, microprocessor EPS8266 and relay

esp_MQTT, a firmware for EPS8266 created by Martin-ger, which transforms the Sonoff-basic into a tank.

For the full story, see watering-sonoff-enXX.pdf (english version) or watering-sonoff-itXX.pdf (versione italiana).

2018-05-21.050436.shot.png

Performances:

  • Two times: T1 and T2 (hh:mm)
  • Operating mode:
  1. manual (ON, OFF)
  2. cycle at T1 every 48 hours,
  3. start at T1, end at T2 every 24 hours
  4. cycles at T1 and T2 every 24 hours
  5. cycle at T1 every 24 hours

✔ cycle ( 2, 3. 4) start only if dry soil

✔ interval (5): ON when dry soil OFF when soaked soil

  • Duration of the watering cycle: 1 min...3 hours (1...180 min)
  • Commands: ON, OFF (unconditional) CYCLE (immediate, conditioned)

Features:

Autonomous: contains an MQTT server with the operating logic (script)..

Compatible: can be used with standard MQTT client and MQTT server, has a complete set of commands and information via MQTT

Autostart: preserves status and configuration in flash ROM: in case of reset or blackout restores the previous status autonomously.

NTP-client: requires connection to the domestic WIFI, with access to the Internet, to have the correct time. Commands for summer/winter time.

Serial console: for installation and debugging, via WIFI (telnet) or COM

OTA update: the operating logic (script) can be updated via OTA (Over The Air), without moving or opening the timer.

MQTT client: currently 2 options for monitoring and configuration: • Full client on PC (node-red) • Reduced client on Android (IOT MQTT Dashboard app)

Power supply: (90-250) 220V AC, 220 V solenoid valve (attention !!!)

Stand-by consumption: not measurable (<1 W)

Consumption ON: 6 W (220 V)

Case: waterproof and transparent, 3 LEDs: power on, irrigation on, wet ground

Notes:

  1. Depending on the type of watering system, short times or very long times are available (drip systems).
  2. The positioning of the hygrometer probe affects the operations: I have positioned it in a point not watered but wet by rain. It is also possible to place it in a watered place, to create a sort of feedback (mode 4).
  3. It is possible to control a small pump (max 500 W) instead of the solenoid valve.