I have this drip irrigation system (See Image 1), which has 16 programmable schedules with start time and run duration for each program. It has a few push buttons and C-Type LCD to schedule the programs and to turn ON and OFF the pump. DC motor is used to turn ON and OFF the water flow. Whole system powered up with 2 AAA batteries. My goal is to connect ESP32 to it so that I can control it over cloud (MQTT) and with Google Home Assistant.
I opened up the device to look for debug/UART headers but found none. The main microcontroller is masked (See image 3), and the PCB part number doesn’t yield any results online. The components I can identify are:
Power supply circuit
H-bridge motor driver circuit
Push buttons
C-type LCD
Microcontroller (masked)
Battery connector and
DC motor connector (See Image 2)
After extensive searching and reverse engineering attempts, I failed to identify any interface to connect ESP32.
So, I've decided to connect motor directly to ESP32 with external H-Bridge motor driver board. Instead of 2 AAA battery, I've decided use 9V alkaline battery with dc power supply converter to convert 9V to 5V & 3.3V and power up the ESP32 and motor driver board. Also, I'm thinking to connect two pushbuttons, ON & OFF to ESP32 to turn on and off manually later.
Since the mounting had a place for 2 AAA batteries, I could manage to fit 9V battery there (See Image 8).
Image 1: Automatic drip irrigation system.
Image 2: Motor and battery interface
Image 3, Masked MCU and pushbutton interface
I'm using ESP32 WROOM-32 dev kit and DRV8833 dual channel H-Bridge motor driver board, and Aliexpress Power supply with dual outputs to convert 9V to 5V and 3.3V (See Images 4, 5 & 6 respectively).
Image 4: ESP32 Devkit
Image 5: Motor driver board
Image 6: DC power supply
Image 7: Circuit connection
Image 7 shows how the circuit is assembled. DC power supply is powered by 9V alkaline battery and two puts are selected 5V to power-up ESP32 and 3.3V to power motor driver board. Image 8 shows the final assembly.
ESP32 is programmed in Arduino IDE and used ArduinoIOTCloud client framework to talk to Arduino Cloud App.
For Arduino IOT cloud, I followed their "Getting Started with Arduino Cloud for ESP32" guide. I created a "Thing" (device), defined its variables, and built a dashboard for setting/getting those variables. The credentials required to talk to Arduino Cloud from the ESP32 were generated when creating the device in the cloud; I stored that information and Wi-Fi credentials needed to connect the ESP32 to my local network directly in the source code. You can see the full project files in my GitHub repo.
To compile the project, simply download the project from git repo and open the project in Arduino IDE and hit compile and program the binaries onto ESP32 devkit.
Once Arduino cloud is configured, add the device to Google Home by following the guide, "Google Home, Arduino Documentation".
After configuring Arduino Cloud, integrating it with Google Home, and programming the ESP32, the final step is to test everything.
Image 9 & 10 shows the Arduino IoT cloud dashboard from where the pump is controlled.
Image 8, final assembly
Image 9, Arduino IoT cloud dashboard with Pump control interface
Image 10, Arduino IoT cloud dashboard showing Pump ON
I loved how the whole setup turned out and how seamlessly the integration between Arduino Cloud and Google Home, and the ESP32 worked. I'm really glad I chose to build my own solution - it feels great to see the project completed and functioning in real life. It's incredibly satisfying to use something I built from scratch in my daily routine.