WiFI Grass Watering Manager working in Home Automation system (I use mySensors)
I wanted to show you my irrigation controller, which I built using the ESP8266 on a WemosD1 clone board. It's integrated with home automation using the MySensors library.
In short, the idea is for all devices to be managed from a single application (whether it’s air conditioning, ventilation, heat pumps, blinds, curtains, lighting, water, cameras, etc.), and that’s the approach I’m sticking to. This controller was intended to be a replacement for the Hunter controller, which didn't support integration with home automation (the WiFi module needed to be purchased separately, and there were additional compatibility issues with my system and requirements).
The irrigation controller can be housed in two Kradex enclosure models: Z101 and ZD1006, with the PCB drilled for both types.
Features
The device includes the following features:
- Powering the entire device with 24V AC (using an LM2675 converter to lower it to 3.3V DC, which is necessary for the ESP8266 WiFi module).
- Controlling three 24V AC valves (with optoMOS for galvanic isolation).
- Rain sensor to stop watering (disconnecting one of the valve supply poles using a reed switch in the rain sensor).
- Monitoring if current is actually flowing through the valves (using the ACS711).
- User interface (three backlit buttons and two indicator LEDs).
- MySensors interface for exchanging information and commands with the controller via WiFi.
Details of the Solution and Individual Functions
Power Supply
The power module is based on the LM2675M-3.3, a commonly used component. I saw it used in several projects on forums.
The goal of the module was to convert 24V AC to 3.3V DC for powering the ESP8266. The device uses 24V AC because that is the nominal power requirement for the solenoid valves.
The power module includes two safeguards. The first is a 1A polyfuse on the path to the bridge rectifier, to prevent excess current from reaching the converter.
The second safeguard is a 1A cylindrical fuse protecting the solenoid valves. I don’t expect to use more than one valve at a time, so this is more than sufficient (the solenoid valve coil current shouldn’t exceed 0.5A at start and 0.2A during operation). Another safeguard is a software restriction that prevents more than one valve from being activated at once.
Controlling Three 24V AC Valves
Control is managed using SSR optoMOS relays (Panasonic AQY212). I chose these because they ensure galvanic isolation between the board circuit and the valve circuit.
Control is achieved through three pins on the ESP8266. These pins also illuminate the buttons, so a high state on a pin lights up the relay’s LED (activating the valve) and the button LED on the enclosure – a nice visual effect.
Stopping Irrigation with the Rain Sensor
This feature is based on the Hunter controller. The rain sensor includes a normally closed (NC) reed switch, which opens the circuit when it rains. Without going into details, I kept this function as it was. The 24V AC power to the valves flows through the wire with the reed switch. If sprinklers are activated and it’s raining, the reed switch opens the circuit, and the sprinklers turn off. The function works, but with today’s integration with weather forecasting, I wouldn’t implement it again (if rain is predicted, watering won’t occur).
Monitoring Current Flow Through the Valves (Using ACS711)
As mentioned, a situation can occur where watering is triggered, but the solenoid circuit is disconnected by the rain sensor. This is detected with the Hall effect sensor (ACS711), which measures the current flowing through the solenoid circuit. The analog signal from this sensor is sent to the ESP8266, which reads it using an ADC-enabled pin (A0).
This function detects the "RAIN STOP" situation, meaning watering stops due to rainfall (logic: IF the solenoid valve is open AND there is no current flowing, THEN signal RAIN STOP).
User Interface
The user interface includes three backlit buttons and two indicator LEDs.
The three backlit buttons allow manual activation/deactivation of the valves. The backlight indicates that the valve is open (meaning: the section is being watered). You can turn off a section by pressing its button when it’s active. I kept the buttons in case the connection to the control system is unavailable (the controller itself isn’t very "smart" and doesn’t have schedules).
From the device's perspective, the buttons are connected to ESP8266 input pins, each pulled up to 3.3V with a 10k resistor. Pressing a button grounds the input pin, which the ESP interprets.
Since the buttons are connected to the board with wires, there’s a risk of interference (the wires could act as antennas). I added 100nF capacitors on the ESP8266 input pins as a safeguard.
The watering duration for a section is stored in the ESP8266’s EEPROM, so this information is retained even if the connection to the controller is lost. This prevents a situation where watering is triggered, the connection is lost, and water continues to flow indefinitely – an example of basic "intelligence" in the device.
There are two indicator LEDs. One (RX CMD) indicates the receipt of a command from either the button or the control device, while the other signals stopping watering due to rain sensor detection ("RAIN STOP").
MySensors Interface
The device communicates externally via TCP/IP on a designated port (e.g., 5003), using the MySensors library.
Currently, the device "exposes" an interface for eight logical devices (section switch, watering duration per section – 3 sections mean 6 devices), a "RAIN STOP" flag, and the current flowing through the ACS711 circuit. Communication is, of course, bidirectional.
Thanks to efficient and reliable communication, all watering logic resides within the home automation control system. The integration itself is quite interesting but somewhat extensive and separate from the device construction.
As an example, I’m including a screenshot below showing what watering looks like in my controller (Domoticz). With everything in one place, it's easy to achieve interesting results quickly (e.g., prevent watering if rain is forecasted for the day).
WiFI Grass Watering Manager working in Home Automation system (I use mySensors)
- Comments(0)
- Likes(1)
- Prasanna K Nov 05,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Jacek jr
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
53 0 0 -
-
-
-
Sega Master System RGB Encoder Switcher Z80 QSB v1.2
55 0 0 -
18650 2S2P Battery Charger, Protection and 5V Output Board
77 0 0 -
High Precision Thermal Imager + Infrared Thermometer | OpenTemp
406 0 6 -
Sony PlayStation Multi Output Frequency Oscillator (MOFO) v1
128 0 2