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: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_7-X8"
id: x8
pin:
sn74hc595: sn74hc595_hub
number: 7
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_8-X9"
id: x9
pin:
sn74hc595: sn74hc595_hub
number: 8
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_9-X10"
id: x10
pin:
sn74hc595: sn74hc595_hub
number: 9
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_10-X11"
id: x11
pin:
sn74hc595: sn74hc595_hub
number: 10
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_11-X12"
id: x12
pin:
sn74hc595: sn74hc595_hub
number: 11
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_12-X13"
id: x13
pin:
sn74hc595: sn74hc595_hub
number: 12
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_13-X14"
id: x14
pin:
sn74hc595: sn74hc595_hub
number: 13
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_14-X15"
id: x15
pin:
sn74hc595: sn74hc595_hub
number: 14
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_15-X16"
id: x16
pin:
sn74hc595: sn74hc595_hub
number: 15
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_16-X17"
id: x17
pin:
sn74hc595: sn74hc595_hub
number: 16
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_17-X18"
id: x18
pin:
sn74hc595: sn74hc595_hub
number: 17
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_18-X19"
id: x19
pin:
sn74hc595: sn74hc595_hub
number: 18
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_19-X20"
id: x20
pin:
sn74hc595: sn74hc595_hub
number: 19
inverted: false
interlock: *interlock_group
restore_mode: RESTORE_DEFAULT_OFF
interlock_wait_time: 3000ms
- platform: gpio
name: "sn74hc595_20-BUZZER"
pin:
sn74hc595: sn74hc595_hub
number: 20
inverted: false
- platform: gpio
name: "sn74hc595_21_LED1"
pin:
sn74hc595: sn74hc595_hub
number: 21
inverted: false
- platform: gpio
name: "sn74hc595_22-LED2"
pin:
sn74hc595: sn74hc595_hub
number: 22
inverted: false
status_led:
pin:
sn74hc595: sn74hc595_hub
number: 23
inverted: false
This config is pretty basic as of now.
The 20 valves are interlocked, meaning it is not possible to have more than 1 enabled at a time (due to the weak water pressure).
Home Assistant implementation
(text will follow)