ESP32 Automated Irrigation Control System Project - PART 3 - The main Sprinkler Class @rubin-tech
ESP32 Automated Irrigation Control System Project - PART 3 - The main Sprinkler Class  @rubin-tech
Uploaded April 2021 | Updated September 2026, 2 weeks ago
We now arrive at the third chapter in the series. The first two were dedicated to the development of libraries for hardware needed for the project. With libraries completed for the water meter and the valve we can continue designing the architecture that ties everything together while incoperating the quad relay module into our to be developed sprinklersystem library a small support application will be written along with this activity. It stands to reason our sprinklersystem library and overarching project will depend upon the two libraries created in chapter one and two, they will be included in the library for sprinklersystem and compiled in.


As there is no vectoring in esp32 an array will be created to store zone objects called storedzones, allowing for easy manipulation addition and removal of zones form the sprinklersystem object. the array can handle 30 zones which is way overkill but acceptable. Each zone has attributes that I mad add remove or change later in development, but this will get us off the ground. Attributes from the valve and meter are already defined and probably wont change much.


Within the sprinklersystem class, the overarching object is the class Zone and its attributes, as well as the zone array itself with associated helper functions, open close remove, and whatnot. The is no function to add sprinklersystem the app were creating does that. The addzone function provides an opportunity to allow for any required validation of supplied parameters as demonstrated.


The main program provided is simply a demonstration to create an object and demonstrate all of the functionality thus far. This includes bad data to demonstrate errors.

5 Wire Motorized Ball valve
amzn.to/3Tr81yf

Buck Converter
amzn.to/3n1WZ6o

Power Transformer 120vac
amzn.to/3Jsqg1I

Water Meter
amzn.to/42mNRd1

AC/DC Converter
amzn.to/3mY6OCx

DPDT Relay
amzn.to/3lluL6d

2.4G WiFi Antenna for FPV TX Antenna with RP-SMA Female Cable Dipole Whip
amzn.to/3FvAhtI

HiLetgo ILI9341 2.8" SPI TFT LCD Display Touch Panel 240X320 with PCB 5V/3.3V STM32
amzn.to/3TqgW3e

Knurled Insert Nuts - 50Pcs M4 x 6mm Length x 6.4mm OD Female
amzn.to/3JiCObY

I2C TWI Serial LCD 2004 20x4 Display Module with I2C Interface Adapter Blue Backlight
amzn.to/3lmS6oa

HiLetgo ESP-WROOM-32 ESP32 ESP-32S Development Board
amzn.to/3Fv4KZ5

Screw Terminal Block Breakout Module Board for ESP32-DevKitC
amzn.to/3yLGr5q

2Pin Panel Mount 13mm Waterproof Power Connector IP67
amzn.to/3n1DDhH

SP13 6pin Waterproof Aviation Cable Connectors Plug Socket IP67
amzn.to/3n3cR8H

360 Degree Rotary Encoder Module KY-040 Brick Sensor
amzn.to/3ljdPgD

KUOYUH Circuit Breaker 91 Series 50VDC 125/250VAC (1A-2A) (2.0A)
amzn.to/3YQZ42l

5PCS Green AC/DC12-24V LED Indicator Lights
amzn.to/3YXiLWl

3pcs PCF8575 IO Expander Board Module I2C to 16IO IIC I2C I/O Extension
amzn.to/40f9jhZ

4pcs 2A 5V Charge Discharge Integrated Module 3.7V/4.2V PCB Board Module for 18650 Lithium Battery
amzn.to/3yTPkK1

10pcs AMS1117-3.3 DC-DC Step-Down Power Module AMS1117-3.3V Buck Module LDO 800MA
amzn.to/3n3JYti

As an Amazon Associate I earn from qualifying purchases. If you choose to purchase any of these items the links above provide a small commission that I use towards the making of these videos at no additional cost to you.
ESP32 Automated Irrigation Control System Project - PART 3 - The main Sprinkler ClassAntique Car Stereo Bluetooth Audio Retrofit with ESP32 - Part 4 of 4Unboxing & Resurrecting a Brand New 50-Year-Old Heathkit Auto Tester!Coleman Stove Model 425 Teardown Maintenance Rebuild and Leak RepairCraftsman T110 Riding Mower Deck Removal and Blade SwapoutYamaha VSTAR 1100 Baron Oil Filter Relocation Kit Installation ORKWhirlpool Dryer - Maintenance and Repair for Optimum PerformanceRock Island Slide Disassembly, Cleaning and Reassembly as Performed on a Rock Island 1911Soundcore Life Q20 - Noise Cancelling Headphones Battery swap and UpgradeJura S8 Automatic Coffee Machine - Unbox, Setup, Operation, Customize, Maintenance,  4 Month ReviewJohn Deere Model E130 Riding Mower - Setup, Test, ReviewBME280 Vs. DHT22 Temperature Sensor Shootout as Tested on the TTGO T-Display ESP32
Rubintech |

ESP32 Automated Irrigation Control System Project - PART 3 - The main Sprinkler Class

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER