Back to projects
Feb 01, 2026
6 min read

Auto Watering

Building a custom ESP-controlled water pump powered by a single power supply. The ESP microcontroller acts as the main controller for the pump and also functions as a web server. A Flutter application is used to control and monitor the pump, providing a user-friendly interface for remote operation.

Why ❓

Every summer I face the same problem: my parents go on vacation, and I inherit the noble responsibility of remembering to water their balcony flowers. And since I also have plants of my own that are sometimes drier than the Sahara Desert 🌵☀️, it was time to automate things.

When I started looking for a solution, I found plenty of projects using an ESP and a water pump, but almost all of them required separate power supplies for the ESP and the pump. As a total beginner in electronics, I decided to build my own custom setup from scratch, just to learn a thing or two along the way.

I also wanted to try building it with Flutter instead of Ionic/Angular. Since the ESP would be controlling the pump and acting as a web server, I needed a way to easily turn the pump on and off from my device.

Electronics 💡

Like I mentioned before, I’m a complete beginner in electronics, so this is just a straightforward explanation of what I used. I’m definitely not giving any advice here, so please do your own research if you’re thinking about building something similar.

  • The entire system is powered by a single 12V power supply. To safely power the ESP8266, a 7805 voltage regulator steps this 12V down to 5V.

  • The TIP122 transistor acts as a switch controlled by the ESP to turn the water pump on and off.

  • Multiple capacitors are used to smooth out voltage fluctuations and keep the power stable.

  • Resistors control the current flowing to different parts of the circuit, protecting components and ensuring proper operation.

  • Finally, LEDs provide simple visual feedback, showing when the pump is powered or when the circuit is active.

Here are all the components that made this little project possible—though a few of them ended up changing as the project evolved

Start Components

After connecting all the electronics and testing everything, the prototype finally came to life, better yet, came to life in a plastic meal container 😆, so it could safely stay outside without getting damaged by moisture

Finished Project

Coding & How It Works 💻

Here’s the big picture of how the system works:

The ESP8266 is the brain of the operation. It controls the water pump and also acts as a web server.

The Flutter app connects to the ESP’s web server over home Wi-Fi, letting you to controll the pump.

Features

Flutter App Features

  • Test the ESP connection
  • Manually toggle the pump
  • Set Scheduler

ESP8266 Features

  • Listens to requests from the Flutter app
  • Saves and loads settings from EEPROM
  • Controls the pump
  • Sends responses back to Flutter
  • Automaticaly starts the pump if scheduled

Flow Description

  1. Flutter App → ESP8266: User toggles pump or sets scheduler in the app.
  2. ESP8266 → EEPROM: Settings like start day, time, intervals, and duration are saved, so in case of shutdown they are restored from the storage.
  3. ESP8266 → Pump: ESP switches the TIP122 transistor to turn the pump on or off.
  4. ESP8266 → Flutter App: ESP sends back confirmation or status updates

Thats how it should be, but … ⬇️

Current Challenges with the Scheduler ⏰

Here’s how the scheduler works so far:

  • When the ESP starts, the Flutter app sends the current time. The ESP stores this time in EEPROM, so the internal clock is always in sync with the app.
  • From Flutter, the user can successfully save all the scheduler data, start day, intervals, time, and duration, which is also stored in the ESP’s EEPROM.

However, I’m currently facing some issues with the ESP scheduler itself. Scheduling the pump to run automatically at the right times is still tricky.

For now, manual control works perfectly, and the scheduler feature is a work in progress.

Flutter App 📱

At first, the app had a very simple structure, but I quickly realized that passing data around widgets would be a huge pain in the ass 😅.

To solve this, I implemented Riverpod, which made state management much easier—but also made my project explode into a lot of files and folders, totaly worth it.

There’s still a lot of work to do: improving the design, fixing some bugs, and polishing the user experience, because now it looks like this.

Status Page

Next Steps / To-Do ✅

Before moving on, here’s what’s definitely on my list:

  • Clean up and improve the code 💻
  • Improve design and user experience 📱
  • Make the scheduler fully functional
  • Build for other platforms 📱

Future Improvements 🚀

Here are some features and enhancements I’m considering for the project:

  • Optimize ESP Performance
    Improve memory usage, make the scheduler more reliable, and ensure the firmware runs efficiently.
  • Wi-Fi Provisioning / Easy Setup 📶
    Allow the ESP to connect to new networks without hardcoding credentials, for easier setup.
  • MQTT Integration 🌐
    Add an MQTT broker for real-time communication and better scalability, especially if adding more devices or sensors.
  • Add Sensors 🌡️💧
    • Soil moisture sensor – water plants only when they actually need it.
    • Temperature sensor – monitor environmental conditions.
    • Water level sensor – detect if the pump is running low on water.
  • Over-the-Internet Control 🌍
    Enable secure remote access so you can check status or control the pump from anywhere.
  • Logging & Notifications 📝🔔
    Keep track of watering history and receive alerts if something goes wrong, like pump failure or low water level.

Conclusion ✨

Now I almost have my lazy way of watering the plants, and at the same time, an interesting project to improve and expand over time.

You don’t even want to know about my hydroponics project 😆💧