Smart Hydroponic System
by UoP_SmartAgri in Workshop > Hydroponics
97 Views, 2 Favorites, 0 Comments
Smart Hydroponic System

Hydroponics is a modern method of cultivating plants without the use of soil, where nutrients are delivered directly to the plant roots through a water-based solution. Instead of relying on traditional soil, plants grow in an inert medium such as perlite, coco coir, clay pellets, or rockwool, while the nutrient-rich water provides all the essential minerals required for growth.
This system is highly efficient because it allows precise control of water, nutrients, and environmental conditions, resulting in faster plant growth, higher yields, and reduced resource usage compared to conventional farming. Hydroponics also minimizes the risk of soil-borne diseases and enables farming in areas with poor or no arable land, including urban environments and indoor spaces.
As the global demand for sustainable food production increases, hydroponic systems are becoming an innovative solution to address challenges such as limited land availability, water scarcity, and the need for year-round cultivation. Whether for small-scale home gardening or large commercial farms, hydroponics represents a key step toward the future of agriculture.
Types of Hydroponic Systems
- Deep Water Culture (DWC)
- Plants float on a nutrient-rich water solution, and their roots are submerged directly in the water. An air pump provides oxygen to the roots.
- Nutrient Film Technique (NFT)
- A thin film of nutrient solution constantly flows over the plant roots inside a sloped channel or tube. This gives roots access to water, nutrients, and air at the same time.
- Ebb and Flow (Flood and Drain)
- The grow tray is periodically flooded with nutrient solution and then drained back into a reservoir. This cycle provides both nutrients and oxygen to the roots.
- Drip System
- Nutrient solution is dripped slowly onto the base of each plant using tubes, ensuring precise feeding and minimal waste.
- Wicking System
- The simplest type: a wick (like rope or cloth) pulls nutrient solution up from the reservoir to the plant roots through capillary action. No pumps required.
- Aeroponics
- Plant roots hang in the air and are misted with nutrient solution. This gives maximum oxygen and rapid growth, but requires careful control.
Here we are propsing a NFT System.
In this project, we are going to show you how to build a smart water pump system using a Wemos D1 mini (ESP8266), an ultrasonic distance sensor, and Home Assistant.
The system automatically turns Pump ON when the water level (distance measured by the ultrasonic sensor) is in according to your measures , and turns it OFF otherwise.
This project is perfect for hydroponics, aquaponics, gardening, or smart farming.
Supplies







.png)
- Wemos D1 Mini (ESP8266 board)
- Ultrasonic Sensor (HC-SR04 or JSN-SR04T for waterproof)
- 5V Water Pump
- Relay Module or MOSFET driver (to switch the pump safely)
- Jumper wires
- Breadboard or PCB
- 5V Power Supply (USB adapter or power bank)
- Home Assistant (running on Raspberry Pi or server)
- ESPHome add-on installed in Home Assistant

There are few units in this innovation.They are plant growing section,water supply section, fertilizer section,mixing section,pesticiding section
Lets focus on Plant Growing section first
You should build a stucture in order to grow your plants according to your preference. The diameter of the holes in the structure can be determined according to the types of the plant that you are going to grow. And the length and size of the plant growing basement can be decided by you but then you should consider the water storage capacity,the valves sizes and the power of motors
Now lets see about the water supply section
You should select water storing method according to the plants you are going to cultivate in here.Beacuse the amount of water needed here is different by the type of the plant.Then you need to install a motor and the valves in there to get the water out and to provide them into the plant growing section.Here we are proposing a water circulation method the water we have provided can be used for the plant growing section again .
Its time to focus on the fertilizer section
In here we have developed this project for 3 types of fertilizers. But you are free to get any type of fertilizers as you like(but they should be in almost liquid type else if you going to use solid type you have to convert them into liquid form) but if you are going to use many fertilizers you have to pay attention to the power of the motor you are going to use in the mixing section.
<Extra Acknowledgement>
Hydroponic fertilizers are liquid or water-soluble nutrients specially made for plants grown without soil. Since hydroponic systems use water instead of soil, these fertilizers provide all the nutrition the plants would normally absorb from the ground. They are mixed directly into the water that circulates around the roots, making nutrient uptake faster and more efficient.
Unlike traditional fertilizers, hydroponic fertilizers are designed to stay stable and balanced in water, preventing blockages or nutrient imbalances. They help ensure steady plant growth, higher yields, and healthier crops in controlled environments like greenhouses, indoor farms, and hydroponic gardens.
Now the mixing section
All the fertilzer carrying valves are connected here for the mixing purpose , there we have used 12V motor for that purpose , then the mixed fertilizers are carried out by the valves for the plant growing section.
Now you can connect the valves accoding the refference image we have provided. You should remember the valve type can be determined by your preference but you should consider the denisity of the liquids that you are going to use, the power the motors you use in each section and you should install them in a way to avoid any blockage .
We have provided a reference image how the system works
(Stucture of the system image)
Wiring
Connect Ultrasonic Sensor:
- VCC → 5V
- GND → GND
- TRIG → D1
- ECHO → D2
Connect Relay Module (Pump control):
- Relay IN → D5
- Relay VCC → 5V
- Relay GND → GND
- Relay COM & NO → in series with pump’s +5V line
Connect Pump:
- Pump + → Relay NO → Relay COM → +5V
- Pump – → GND

ESPHome Firmware
Setting up ESPHome
Here is a referrence source : https://youtu.be/7PoUWszwaFk?si=9_E8mE6hyvVIt9Ad
#Disclaimer: Learn fast make things (Youtube Creator)
Flash this ESPHome YAML to your Wemos D1 mini:
https://www.home-assistant.io/ here you can get the Home Assistant
Add Device to Home Assistant
- In Home Assistant → Settings → Devices & Services → Add Integration → ESPHome.
- Enter the IP address of your Wemos D1 mini.
- HA will discover:
- sensor.ultrasonic_distance_1
- switch.pump_01

Automation in Home Assistant
Now create an automation so the pump runs only when the ultrasonic distance is between the values you are going to provide
Here is the code

Testing
- Place the ultrasonic sensor above your water container.
- When water level changes so the measured distance is between the values you are going to provide , the pump will turn on
- Outside this range, the pump stays off
Future Improvements
- Add multiple pumps and sensors.
- Add notification when water is low.
- Integrate with Google Home or Alexa.
- Add manual override button in Home Assistant UI.
Conclusion
With just a few components and ESPHome + Home Assistant, you’ve built a smart pump automation system for your garden, hydroponics, or smart home.