Ajit Kumar

Backend Developer

My setup
SSR-40A(solid state relay) and ESP8266 Lonin for Pump Control

GitHub Link

Wi-Fi based pump automation by water %

Manually turning water pumps on and off often leads to overflow, dry running, and water wastage. To solve this, I built a Wi-Fi–based smart pump automation system using an ESP8266 NodeMCU, ultrasonic sensor, and SSR-40A relay. The system automatically controls the pump based on the water level percentage in the tank and integrates with Home Assistant for remote monitoring and manual control.


Components Used

  • ESP8266 NodeMCU → Wi-Fi microcontroller running ESPHome for automation and communication.
  • Ultrasonic Sensor (JSN-SR04T / HC-SR04) → Measures distance to water surface and converts it into tank water percentage.
  • SSR-40A Solid-State Relay → Safely switches the water pump ON/OFF based on ESP8266 signals.
  • Water Pump → The load being controlled to fill the tank automatically.
  • Home Assistant → Smart home platform for real-time monitoring, alerts, and manual pump control via Wi-Fi.

🔹 Working Principle

  • Water Level Detection → The ultrasonic sensor measures the distance from the tank top to the water surface.
  • Data Processing → ESP8266 running ESPHome converts this distance into a percentage value.
  • Pump Control → Based on set thresholds, ESP8266 triggers the SSR-40A relay to switch the water pump ON or OFF.
  • Wi-Fi Monitoring → The data is sent over Wi-Fi to Home Assistant for live tracking.
  • Manual Override → Users can control the pump manually through the Home Assistant dashboard if required.

🔹 Features

  • Automatic Control → Pump turns ON/OFF based on water % levels.
  • Prevents Water Wastage → Stops overflow and avoids dry running.
  • Real-Time Monitoring → View tank % and pump status in Home Assistant.
  • Manual Override → Control the pump remotely from any device.
  • Safe Operation → SSR relay ensures reliable and durable switching.

🔹 Benefits

  • Saves Water → Eliminates overflow and reduces wastage.
  • Energy Efficient → Pump operates only when required.
  • Convenient → No more manual switching.
  • Smart Control → Monitor and operate via Home Assistant app.
  • Scalable → Can be extended with sensors like flow meters, TDS, or pressure sensors.

Products Link