Prelude:

I started with this project about 3 years ago. This summer, 2023, it will be finished (hopefully).

This is the third take (V1 and V2 using an arduino and a generic relay module).
With the arduino approach I had the problem, that somehow I had to implement inputs and outputs,
like setting when and how long to water channel X.

This was rather complicated because I had to make sure, that the buttons and display were at least somewhat water resistant.

For this third, final approach, I decided to built it 'headless', meaning no buttons or displays.
It will be completely controllable via ESPHome (thus Home Assistant)


Water distribution:

For the distribution I have used basic 12V magnet valves. These are pretty cheap and work reliable.
In our garden we have a pretty low water pressure, thus this many channels (9 sprinklers -> 9 channels for the lawn alone).
Everything is plumbed together with brass fittings. The valve on top is for bleeding the system during winter, so the
pipes and hoses dont get damaged from the freezing water.


The control board:

I planned and designed this PCB using Autodesk EAGLE.
It is a pretty basic schematic:

  • An ESP32 Wroom 32U (U for the Ipex connector)
  • CH340G USB to UART controller for programming and debugging
  • USB C YYEEEAAAHHH
  • 3 Status LEDs
  • 3 Buttons, 1 of them being reset, the other for user input and/or boot strapping (IO0)
  • 12V input fuse, from there using linear regulators for 5V and 3.3V
  • a buzzer for good measures, this will be removed tho. Pointless in a garden system
  • 3 daisy-chained shift registers to controll 3x8 outputs (20 mosfets, 3 LEDs, 1 buzzer)
  • All (buffer) capacitors are tantalum for better heat and cold resistance
  • 1 IIC (I²C) interface for future use (soil humidity, rain sensor?)
  • 1 analog input (for future use)
  • lots of screw terminals


Housing / case:

(text will follow)


ESPHome script running on the ESP32:

esphome:
  name: gartenhub

esp32:
  board: nodemcu-32s
  framework:
    type: arduino

logger:

api:
  encryption:
    key: [redacted]

ota:
  password: [redacted]

wifi:
  ssid: [redacted]
  password: [redacted]

  ap:
    ssid: "Gartenhub Fallback Hotspot"
    password: [redacted]

captive_portal:

sensor:
  - platform: adc 
    pin: 34
    name: "ADC" #not used as of now
    update_interval: 60s

binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO27
      inverted: true
    name: "s-use"
  - platform: gpio
    pin: 
      number: GPIO0
      inverted: true
    name: "s-fl"


sn74hc595:
  - id: 'sn74hc595_hub'
    data_pin: GPIO13
    clock_pin: GPIO14
    latch_pin: GPIO15
    sr_count: 3

switch:
  - platform: gpio
    name: "sn74hc595_0-X1"
    id: x1
    pin:
      sn74hc595: sn74hc595_hub
      number: 0
      inverted: false
    interlock: &interlock_group [x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20]
    restore_mode: RESTORE_DEFAULT_OFF
    interlock_wait_time: 3000ms
    
  - platform: gpio
    name: "sn74hc595_1-X2"
    id: x2
    pin:
      sn74hc595: sn74hc595_hub
      number: 1
      inverted: false
    interlock: *interlock_group
    restore_mode: RESTORE_DEFAULT_OFF
    interlock_wait_time: 3000ms
    
  - platform: gpio
    name: "sn74hc595_2-X3"
    id: x3
    pin:
      sn74hc595: sn74hc595_hub
      number: 2
      inverted: false
    interlock: *interlock_group
    restore_mode: RESTORE_DEFAULT_OFF
    interlock_wait_time: 3000ms
    
  - platform: gpio
    name: "sn74hc595_3-X4"
    id: x4
    pin:
      sn74hc595: sn74hc595_hub
      number: 3
      inverted: false
    interlock: *interlock_group
    restore_mode: RESTORE_DEFAULT_OFF
    interlock_wait_time: 3000ms
    
  - platform: gpio
    name: "sn74hc595_4-X5"
    id: x5
    pin:
      sn74hc595: sn74hc595_hub
      number: 4
      inverted: false
    interlock: *interlock_group
    restore_mode: RESTORE_DEFAULT_OFF
    interlock_wait_time: 3000ms
    
  - platform: gpio
    name: "sn74hc595_5-X6"
    id: x6
    pin:
      sn74hc595: sn74hc595_hub
      number: 5
      inverted: false
    interlock: *interlock_group
    restore_mode: RESTORE_DEFAULT_OFF
    interlock_wait_time: 3000ms
    
  - platform: gpio
    name: "sn74hc595_6-X7"
    id: x7
    pin:
      sn74hc595: sn74hc595_hub
      number: 6
      inverted: false
 interlock:...
Read more »