BLOO
SmartFarm IoT Monitoring & Automated Control
A smart agriculture IoT system that monitors environmental conditions and automatically controls irrigation and a protective roof through ESP32 and Firebase.

Plant care becomes difficult when environmental conditions change constantly.
Maintaining delicate greenhouse plants manually requires round-the-clock vigilance. Temperature fluctuations, unpredictable precipitation, and inconsistent soil moisture frequently lead to stressed root systems, over-watering, or sudden water-logging damage without automated safeguards.
IRREGULAR WATERING
Manual watering is inherently inconsistent, resulting in severe moisture stress, root dehydration, or fungal rot from accidental over-watering.
UNMONITORED CONDITIONS
Ambient temperature, relative humidity, soil moisture, and sudden rain are impossible to assess continuously without dedicated telemetry sensors.
WEATHER EXPOSURE
Torrential downpours cause physical leaf damage and wash away soil nutrients unless protective greenhouse shutters close instantaneously.
REMOTE ACCESS
Caregivers lack real-time visibility and cannot trigger immediate irrigation or roof override actions when off-site or away from the farm.
An IoT system that senses, decides, and acts.
BLOO transforms manual plant husbandry into an autonomous, closed-loop feedback system. Powered by an ESP32 microcontroller, BLOO continuously samples multiple environmental sensors, executes localized automation thresholds, triggers high-torque actuators, and streams telemetry to the cloud.
SENSE
Continuous analog & digital sampling across all physical interfaces.
PROCESS
Onboard signal calibration, noise filtering, and edge evaluation.
DECIDE
Threshold comparison algorithms determining actuator states.
ACT
Direct relay switching and PWM pulse-width position control.
SYNC
Sub-second bidirectional telemetry and remote command sync.
HARDWARE INTEGRATION
Selected, wired, and integrated all physical modules: ESP32 microcontroller, DHT22 sensor, soil moisture probe, raindrop plate, 5V relay module, DC water pump, SG90 servo motor, and 16x2 I2C LCD.
EMBEDDED LOGIC
Authored robust C++ firmware for the ESP32. Implemented analog-to-digital sensor reading loops, debouncing, threshold evaluations, device state management, and reliable fail-safe recovery routines.
AUTOMATION
Programmed autonomous irrigation activation when soil moisture drops below 30% and immediate motorized roof closure upon raindrop detection, protecting plants with zero human latency.
FIREBASE INTEGRATION
Engineered the two-way communication protocol between ESP32 and Firebase Realtime Database. Structured live JSON telemetry pushes and implemented asynchronous event listeners for mobile app commands.
SYSTEM INTEGRATION
Bridged physical hardware states with the mobile application interface via Firebase, validating seamless command execution and sub-second telemetry feedback in field-style bench testing.
The physical system behind BLOO.
A modular embedded architecture engineered for reliable continuous operation. The system balances 3.3V logic for the ESP32 and sensitive digital sensors alongside 5V power rails for inductive relay loads and high-draw servo actuation.

ESP32 Microcontroller
Dual-core Xtensa 32-bit MCU with integrated 2.4 GHz Wi-Fi. Executes local threshold loops and maintains persistent TCP sockets to Firebase.
DHT22 Sensor
Calibrated capacitive humidity sensor and thermistor providing high-accuracy ambient readings (Temp ±0.5°C, Humidity ±2% RH).
Soil Moisture Sensor
Measures soil dielectric permittivity to accurately calculate volumetric water content and trigger irrigation when moisture < 30%.
Raindrop Sensor Plate
Nickel-coated serpentine trace sensor detecting water droplet conductivity for instantaneous automated roof shutter closure.
Mini Water Pump
5V DC submersible centrifugal pump providing targeted drip irrigation directly to plant root zones upon relay contact closure.
Electromechanical Relay
Optocoupler-isolated relay module providing galvanic isolation between the sensitive ESP32 GPIOs and the inductive pump motor.
SG90 Micro Servo
High-torque miniature servo receiving 50 Hz PWM position pulses to physically rotate the acrylic roof shutter between 0° and 90°.
16x2 I2C LCD Display
On-device alphanumeric display rendering real-time temperature, humidity, and soil moisture metrics for immediate offline inspection.
Connecting physical sensors to a remote control layer.
BLOO unites embedded hardware with a reactive cloud data layer. By treating Firebase as the central synchronization bus, sensor telemetry flows effortlessly from edge devices to mobile clients while remote commands reach the ESP32 in real time.

Continuous Environmental Streaming
The ESP32 samples connected sensors on scheduled intervals, packages readings into JSON payloads, and pushes structured telemetry to Firebase Realtime Database over secure Wi-Fi sockets.
Real-Time Actuator Command Dispatch
When a caregiver triggers a manual pump cycle or forces a roof shutter adjustment via the mobile application, commands are written to Firebase and consumed instantly by the ESP32 event listener.
Turning sensor readings into automatic actions.
The microcontroller evaluates deterministic environmental thresholds to preserve ideal botanical growth parameters. Below is the exact logical execution cycle programmed into the ESP32.
Poll Ambient Temperature & Relative Humidity
ESP32 communicates over single-bus protocol to read calibrated DHT22 metrics.
dht.readTemperature() · dht.readHumidity()Sample Soil Moisture Voltage
Analog pin samples resistive/capacitive voltage level, mapping raw ADC (0–4095) into calibrated percentage.
map(analogRead(SOIL_PIN), DRY_ADC, WET_ADC, 0, 100)Evaluate Irrigation Threshold (< 30%)
System assesses current hydration. If moisture is critically low (< 30%), the irrigation cycle engages.
if (soilMoisture < 30) -> PUMP_ON; else -> PUMP_OFF;Detect Precipitation & Adjust Roof Shutter
Raindrop plate detects water conductivity. If rain is detected, SG90 servo rotates to 90° (closed). When clear, roof resets to 0° (open).
if (isRaining) servo.write(90); else servo.write(0);Push Synchronized Telemetry to Firebase & Update LCD
Current metrics and actuator states are committed to cloud storage and refreshed on the local 16x2 character LCD.
Firebase.setJSON("/bloo/telemetry", payload) · lcd.print()Interactive Embedded Logic Simulator
Toggle environmental conditions to see how the ESP32 automation algorithm responds in real time.
The communication layer between hardware and application.
Firebase Realtime Database serves as the real-time synchronization broker. By leveraging WebSocket protocols, the physical ESP32 and remote application communicate bidirectionally with minimal overhead and zero public IP routing complications.
{
"timestamp": 1788532000,
"device_id": "esp32_smartfarm_01",
"sensors": {
"temperature_c": 28.4,
"humidity_pct": 65.2,
"soil_moisture_pct": 24.5,
"is_raining": true
},
"actuators": {
"pump_relay_active": true,
"roof_servo_deg": 90
}
}{
"manual_override": {
"force_pump": false,
"force_roof_open": false
},
"thresholds": {
"soil_trigger_pct": 30.0,
"auto_roof_enabled": true
},
"command_id": "cmd_82581e",
"issued_at": 1788532050
}From physical sensors to a remote control interface.
The mobile application interfaces directly with Firebase nodes, abstracting low-level micro-controller logic into an intuitive monitoring cockpit. Farmers and gardeners can inspect health metrics, view live status flags, and trigger physical actuators anytime, anywhere.
Real-Time Telemetry Dashboard
Renders live readings for ambient temperature (°C), air humidity (%), soil moisture percentage, and binary rain detection with clear visual status indicators.
Interactive Actuator Toggles
Allows users to manually command the water pump relay or override the roof position, writing immediate commands to Firebase that the ESP32 consumes.
Heartbeat & Connection Health
Monitors the ESP32 heartbeat timestamp in Firebase to confirm that the hardware system is actively connected and sampling the physical garden bed.
Complete end-to-end telemetry and actuation loop.
The complete cyclical data path connecting human intention, cloud persistence, embedded computation, and physical greenhouse actuators.
A connected system for monitoring and automated plant care.
The operational BLOO prototype validates that targeted embedded engineering and responsive cloud architectures can eliminate common agriculture failure points.
REAL-TIME MONITORING
Environmental parameters are synchronized continuously through Firebase, giving owners comprehensive visibility into crop climate stability.
AUTOMATED IRRIGATION
Pump activation responds autonomously to soil moisture conditions (< 30%), preventing both destructive dehydration and root suffocation.
AUTOMATED ROOF CONTROL
Roof shutter position reacts immediately to rain plate detection, automatically sheltering delicate flora from violent squalls.
REMOTE CONTROL
Users can issue manual override commands through the connected mobile application to adjust pump intervals or roof status at will.
CONNECTED IoT SYSTEM
Physical hardware and the digital application layer communicate cohesively through Firebase, creating a proven smart agriculture foundation.
Visual gallery & engineering artifacts.
Explore the physical build, circuit wiring, cloud architecture diagrams, and hardware components behind the BLOO SmartFarm project. Click any card to inspect in high resolution.





Explore the Implementation
View the BLOO SmartFarm IoT implementation and application integration on GitHub.