Offline Configuration Guide

Complete guide to configuring the standalone smart farming system

Master every setting for optimal local operation

Step 1: Setup Type Selection

BASIC_SETUP

Minimal configuration with soil moisture sensor only

Features:
Soil moisture monitoring
No display
Fully automated
Lowest resource usage

STANDARD_SETUP

Basic setup with DHT22 sensor and LCD 1602 display

Features:
Temperature & humidity
LCD 1602 display
3 cycling screens
Manual monitoring

POTENTIOMETER_SETUP

Standard setup with real-time threshold control

Features:
All standard features
Potentiometer control
Real-time adjustment
Visual feedback

PROFESSIONAL_SETUP

Complete setup with all sensors and rotary encoder

Features:
All sensors included
LCD 2004 display
Rotary encoder menu
Professional control

CUSTOM_SETUP

Full manual configuration for advanced users

Features:
Complete control
Manual sensor selection
Custom display options
Advanced configuration

Step 2: Hardware Pin Configuration

ESP32 Pinout Diagram

ESP32 Dev Board
┌─────────────────┐
│  3.3V  ●    ●   │ VIN
│   GND  ●    ●   │ GND
│ GPIO36 ●    ●   │ GPIO19 ← Water Pump Relay
│ GPIO21 ●    ●   │ GPIO22 ← LCD SCL
│ GPIO22 ●    ●   │ GPIO23 ← Red LED
│ GPIO23 ●    ●   │ GPIO18 ← Green LED
│ GPIO18 ●    ●   │ GPIO5 ← DHT Sensor
│ GPIO19 ●    ●   │ GPIO39 ← LDR Sensor
│ GPIO5  ●    ●   │ GPIO34 ← Potentiometer
│ GPIO4  ●    ●   │ GPIO16 ← Encoder CLK
│ GPIO16 ●    ●   │ GPIO17 ← Encoder DT
│ GPIO17 ●    ●   │ GPIO4 ← Encoder Button
└─────────────────┘

Essential Pins

SOIL_MOISTURE_PIN GPIO 36 (ADC1_CH0)
RELAY_PIN GPIO 19
LED_GREEN_PIN GPIO 18
LED_RED_PIN GPIO 23

Optional Pins

DHT_PIN GPIO 5
LDR_PIN GPIO 39 (ADC1_CH3)
LCD_SDA_PIN GPIO 21
LCD_SCL_PIN GPIO 22

Step 3: Irrigation Settings

Soil Moisture Threshold

30%

Default threshold for starting irrigation

Plant Recommendations:
Succulents: 10-15% | Herbs: 20-25%
Vegetables: 30-40% | Tropical: 40-50%

Irrigation Duration

5000ms

How long the pump runs per irrigation cycle

Guidelines:
Small plants: 3-5 seconds
Large plants: 10-15 seconds

Cooldown Period

300000ms

Minimum time between irrigations

Recommendation:
5-30 minutes depending on plant needs

Sensor Configuration

Sensor Calibration

Soil Moisture Sensor

Calibrate by testing in dry air and water:
Dry Value: 4095
SOIL_MOISTURE_DRY_VALUE
Wet Value: 0
SOIL_MOISTURE_WET_VALUE

DHT Sensor Settings

Reading interval and validation:
Read Interval: 2000ms
DHT_READ_INTERVAL

Sensor Validation

Temperature Validation

Valid temperature range:
Min: -10.0°C
MIN_TEMPERATURE
Max: 60.0°C
MAX_TEMPERATURE

Humidity Validation

Valid humidity range:
Min: 0.0%
MIN_HUMIDITY
Max: 100.0%
MAX_HUMIDITY

Safety & Protection Features

Watchdog Timer

30s

Prevents system hangs and crashes

Config: WATCHDOG_ENABLED, WATCHDOG_TIMEOUT

Pump Protection

5min

Maximum continuous pump runtime

Config: MAX_PUMP_RUNTIME, PUMP_RUNTIME_PROTECTION

Emergency Stop

GPIO 0

Manual emergency shutdown capability

Config: EMERGENCY_STOP_ENABLED, EMERGENCY_STOP_PIN

System Behavior & Timing

Timing Configuration

Sensor Reading Interval 5000ms
Status Check Interval 1000ms
Heartbeat Interval 60000ms

Error Handling

Max Sensor Errors 5
Recovery Attempts 3
Recovery Delay 5000ms

EEPROM Configuration

Data Persistence

What Gets Saved

  • • Soil moisture threshold
  • • Daily irrigation count
  • • Last irrigation timestamp
  • • DHT sensor status
  • • System health flags

Save Triggers

  • • Periodic (every 5 minutes)
  • • On threshold changes
  • • On irrigation events
  • • On emergency stop

Complete Configuration Examples

Minimal Setup

// Minimal: Soil sensor only
#define DHT_SENSOR_TYPE DHT_NONE
#define DISPLAY_TYPE DISPLAY_NONE
#define CONTROL_TYPE CONTROL_NONE
#define LDR_SENSOR_TYPE LDR_NONE

Professional Setup

// All features enabled
#define DHT_SENSOR_TYPE DHT_TYPE_22
#define DISPLAY_TYPE DISPLAY_LCD_2004
#define CONTROL_TYPE CONTROL_ROTARY_ENCODER
#define LDR_SENSOR_TYPE LDR_TYPE_ENABLED