Designing a Fuzzy Logic–Based Automatic Irrigation System with IoT Monitoring
Efficient irrigation requires adaptive decision-making rather than simple threshold-based switching. In this project, a fuzzy logic–based automatic irrigation system was developed using NodeMCU ESP8266, soil moisture sensing, environmental monitoring, and IoT-based supervision through Blynk.
Unlike conventional systems that rely on fixed moisture limits, this implementation applies fuzzy inference to regulate irrigation duration dynamically, improving water efficiency and plant stability.
System Architecture
The system integrates sensing, processing, actuation, and cloud monitoring in a single architecture.
Main components:
- NodeMCU ESP8266
- Soil Moisture Sensor (FC-28)
- Temperature Sensor (BME280)
- Relay Module
- 12V Solenoid Valve
- LM2596 Step-down Converter (3.3V output)
The soil moisture sensor measures ground humidity levels, while BME280 provides ambient temperature data. The ESP8266 processes both inputs using fuzzy logic and drives the relay module to control the irrigation valve.

Fuzzy Logic Control Strategy
Instead of binary ON/OFF logic, fuzzy logic enables gradual decision-making.
Input Variables
- Soil Moisture
- Dry
- Medium
- Wet
- Temperature
- Low
- Normal
- High
Output Variable
- Valve Activation Duration
- Short
- Medium
- Long
Example Rule Base
- IF Soil is Dry AND Temperature is High → Valve = Long
- IF Soil is Medium → Valve = Short
- IF Soil is Wet → Valve = OFF
This rule-based inference produces smoother control transitions and prevents overwatering.
Membership Function Engineering
Membership functions were defined using experimental calibration data.
Soil Moisture Membership
The ADC value from the soil sensor is mapped into three overlapping fuzzy sets:
- Dry → High membership at low moisture percentage
- Medium → Peak around optimal plant humidity
- Wet → Dominant at saturated conditions
Triangular and trapezoidal curves were used to ensure smooth transitions between states.

Temperature Membership
Temperature is classified into:
- Cold
- Normal
- Hot
Overlapping membership regions prevent abrupt switching and provide stability during environmental fluctuations.

Output Duration Membership
The output fuzzy variable determines solenoid valve activation time:
- Short duration → minimal irrigation
- Medium duration → moderate watering
- Long duration → extended watering
Defuzzification converts fuzzy results into real-time valve activation intervals.

IoT Monitoring and Manual Override
The system integrates Blynk for remote supervision.
Available features:
- Auto (Fuzzy) / Manual mode selection
- Real-time soil moisture display
- Temperature monitoring
- Valve status indicator
- Adjustable delay check timer
- Historical graph visualization
If WiFi is unavailable, the system continues operating locally in autonomous mode.

Control Stability Features
To ensure reliable operation:
- Minimum activation delay prevents rapid relay switching
- WiFi auto-reconnect routine is implemented
- Offline fallback logic ensures continuous irrigation control
- Separate fuzzy inference loop and IoT communication loop
This separation prevents cloud latency from affecting irrigation timing.
Prototype Implementation
The physical prototype includes:
- NodeMCU board
- Relay module
- Soil moisture probe
- BME280 sensor
- External 12V valve supply

Conclusion
This fuzzy logic–based irrigation system demonstrates how adaptive control improves agricultural automation. By integrating calibrated membership functions, structured rule bases, and IoT monitoring, the system achieves:
- Improved water efficiency
- Stable environmental response
- Remote monitoring capability
- Reduced mechanical stress on valves
The design can be extended to greenhouse automation or large-scale irrigation networks.
#IoTProject#
#FuzzyLogic#
#SmartIrrigation#
#ESP8266#
#EmbeddedSystem#
#Automation#
Sign In Or Register Comment after
No comments yet. Be the first to comment!