Skip to content
Water-Powered Farming

Firebase Cloud Integration for Hydroponics: When Google’s Infrastructure Meets Your Greenhouse

18 min read January 26, 2026 Water & Irrigation
High-quality visualization of firebase cloud integration for hydroponics: when google's infrastructure meets your greenhouse featuring advanced farming techniques, hydroponics, and sustainable agriculture.

Meta Description: Complete guide to Firebase cloud integration for hydroponic systems using ESP32. Learn real-time database setup, web dashboard creation, mobile access, and unlimited data storage for smart farming.

Introduction: The Dashboard That Updated Before She Looked

The phone notification arrived as Anna Petrov stepped off the plane in Mumbai, 1,247 km from her greenhouse: “Dashboard updated: pH 6.2, EC 1180 ppm, Temp 21.4°C – All systems optimal.” Opening her browser, she saw her complete hydroponic operation displayed in real-time: 12 zones, 2,400 plants, 47 sensors, all synchronized instantly through Firebase Cloud powered by Google’s global infrastructure. The data she was viewing had traveled from her ESP32 controller in her greenhouse to Google’s servers and back to her phone in under 247 milliseconds—faster than she could blink.

Traditional cloud platforms meant expensive monthly subscriptions (₹2,000-8,000/month), limited data storage, vendor lock-in, and complex setup requiring weeks of configuration. Anna’s Firebase फ्री क्लाउड प्रणाली (free cloud system) eliminated all these barriers through Google’s generous free tier: unlimited real-time database connections, 1 GB storage (enough for 10+ years of sensor data), 10 GB monthly downloads, automatic scaling to millions of users, and most remarkably—₹0 monthly cost for her operation while delivering professional-grade reliability used by companies like Spotify, The New York Times, and Alibaba.

In the 11 months since deploying Firebase integration across her ESP32 monitoring network, Anna had solved agriculture’s cloud dilemma: professional infrastructure without professional costs. Her system logged 8.7 million data points, synchronized across 4 devices (phone, tablet, laptop, field display), maintained 99.95% uptime (Google’s SLA), enabled real-time collaboration with her agronomist 847 km away, and most remarkably—cost exactly ₹0 while commercial alternatives would have charged ₹26,400-88,000 for equivalent service.


Why Firebase for Hydroponics?

The Traditional Cloud Problem

Commercial IoT Platforms:

Most cloud platforms designed for IoT charge based on:

  • Number of devices connected
  • Data points stored
  • API calls made
  • User accounts
  • Dashboard features

Example Costs (Typical):

  • Blynk: ₹0-1,800/month (limited free tier)
  • ThingSpeak: ₹0-4,200/month (limited channels)
  • AWS IoT: ₹2.5/million messages (unpredictable)
  • Azure IoT Hub: ₹1,680/month minimum
  • Custom hosting: ₹800-3,000/month (VPS + maintenance)

The Problem:

  • Expensive at scale
  • Limited free tiers
  • Vendor lock-in
  • Complex pricing
  • Data ownership concerns

The Firebase Advantage

Firebase Real-time Database is Google’s NoSQL cloud database designed for mobile/web apps but perfect for IoT:

Why It’s Perfect for Hydroponics:

1. Generous Free Tier

  • 1 GB stored data (≈10 years of sensor readings)
  • 10 GB/month downloads (100,000+ dashboard views)
  • 100 simultaneous connections
  • Unlimited database operations

2. Real-Time Synchronization

  • Data syncs automatically across all devices
  • <300ms typical latency worldwide
  • Offline support (works without internet, syncs when reconnected)
  • No polling needed (push updates instantly)

3. Zero Configuration Scaling

  • Handles 1 device or 1,000,000 devices
  • Google’s infrastructure (same as Gmail, YouTube)
  • Automatic load balancing
  • No server management

4. Built-in Security

  • Firebase Authentication (email, Google, anonymous)
  • Granular access rules (who can read/write what)
  • HTTPS encryption by default
  • No database exposed to public

5. Multi-Platform

  • Web dashboard (any browser)
  • iOS app
  • Android app
  • ESP32/Arduino (native library)
  • Any device with internet

6. Developer-Friendly

  • Excellent documentation
  • Active community (Stack Overflow)
  • Official ESP32 library
  • JSON-based (easy to understand)

Cost Comparison (1 Year):

FeatureFirebaseBlynk ProAWS IoTCustom VPS
Setup cost₹0₹0₹0₹2,500
Monthly fee₹0₹1,800₹2,500₹1,200
Annual total₹0₹21,600₹30,000₹16,900
Data storage1 GB1 yearPay per useUnlimited
Devices100UnlimitedPay per useUnlimited
Historical dataForever1 yearForeverForever

Verdict: Firebase = Professional infrastructure at hobby costs


Architecture Overview

System Components

┌──────────────────────────────────────────────────────────┐
│              Physical Layer (Greenhouse)                 │
│  ┌───────┐  ┌───────┐  ┌───────┐  ┌───────┐            │
│  │  TDS  │  │   pH  │  │  Temp │  │ Level │  ... (47)  │
│  │Sensor │  │Sensor │  │Sensor │  │Sensor │            │
│  └───┬───┘  └───┬───┘  └───┬───┘  └───┬───┘            │
│      └──────────┴──────────┴──────────┘                 │
└──────────────────┬───────────────────────────────────────┘
                   │
            ┌──────▼──────┐
            │  ESP32 Dev  │ (WiFi enabled)
            │   Module    │ - Reads sensors every 30s
            │ (The Brain) │ - Processes data
            └──────┬──────┘ - Sends to Firebase
                   │
            [WiFi Connection]
                   │
┌──────────────────▼───────────────────────────────────────┐
│            Firebase Cloud (Google Servers)               │
│  ┌────────────────────────────────────────────────────┐ │
│  │  Realtime Database (NoSQL JSON structure)         │ │
│  │  {                                                 │ │
│  │    "hydroponics": {                               │ │
│  │      "zone1": {                                   │ │
│  │        "current": { "pH": 6.2, "tds": 1180 ... }│ │
│  │        "history": { "1696723847": {...} ... }    │ │
│  │      }                                            │ │
│  │    }                                              │ │
│  │  }                                                 │ │
│  └────────────────────────────────────────────────────┘ │
│                                                          │
│  ┌────────────────────────────────────────────────────┐ │
│  │  Authentication (User Management)                  │ │
│  └────────────────────────────────────────────────────┘ │
│                                                          │
│  ┌────────────────────────────────────────────────────┐ │
│  │  Cloud Functions (Serverless Code - Optional)     │ │
│  └────────────────────────────────────────────────────┘ │
└──────────────────┬───────────────────────────────────────┘
                   │
    ┌──────────────┴──────────────┬─────────────┐
    │                             │             │
┌───▼────┐  ┌─────────────────▼────┐  ┌───────▼──────┐
│  Web   │  │   Mobile Apps        │  │   Desktop    │
│Dashboard│  │ (iOS/Android)        │  │   Monitor    │
│(Laptop)│  │ - Real-time updates  │  │  (Control    │
│        │  │ - Push notifications │  │   Room)      │
└────────┘  └──────────────────────┘  └──────────────┘

All devices see same data instantly (real-time sync)

Step-by-Step Implementation Guide

Phase 1: Firebase Project Setup (20 minutes)

Step 1: Create Firebase Project

  1. Go to: https://console.firebase.google.com
  2. Click “Add Project”
  3. Enter project name: “MyHydroponicFarm”
  4. Disable Google Analytics (not needed, click Continue)
  5. Click “Create Project” (takes 30 seconds)
  6. Project ready!

Step 2: Create Realtime Database

  1. In Firebase Console, click “Realtime Database” in left sidebar
  2. Click “Create Database”
  3. Select location: “United States” (or closest to you)
    • Note: Location affects latency slightly but Firebase is fast globally
  4. Security rules: Start in test mode (public read/write for 30 days)
    • We’ll secure this later
  5. Click “Enable”

Step 3: Get Database URL

Your database URL appears at top: https://myhydroponicfarm-default-rtdb.firebaseio.com

Copy this – you’ll need it in ESP32 code!

Step 4: Get API Key (Legacy/Database Secret)

  1. Click gear icon (⚙️) → Project Settings
  2. Go to “Service Accounts” tab
  3. Click “Database secrets”
  4. Copy the secret key (long string like: ABcdEF123ghIJK...)

Important: This is your database password – keep it secret!

Step 5: Test Database (Browser)

Open this URL in browser:

https://myhydroponicfarm-default-rtdb.firebaseio.com/.json

You should see: null (empty database – perfect!)

Phase 1 Complete! ✅ Firebase project ready for ESP32 connection


Phase 2: ESP32 Code Implementation

Install Firebase Library

  1. Open Arduino IDE
  2. Go to: Sketch → Include Library → Manage Libraries
  3. Search: “Firebase ESP32”
  4. Install: “Firebase Arduino Client Library for ESP8266 and ESP32” by Mobizt
  5. Wait for installation to complete

Complete ESP32 + Firebase Code:

/*
 * ESP32 Hydroponic Monitor with Firebase Cloud Integration
 * By Agriculture Novel - www.agriculturenovel.com
 * 
 * Reads sensors every 30 seconds and uploads to Firebase
 */

#include <WiFi.h>
#include <Firebase_ESP_Client.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include "addons/TokenHelper.h"  // Provide token generation
#include "addons/RTDBHelper.h"   // Provide RTDB payload

// ===== WiFi Credentials =====
#define WIFI_SSID "YourWiFiName"
#define WIFI_PASSWORD "YourWiFiPassword"

// ===== Firebase Configuration =====
#define DATABASE_URL "https://myhydroponicfarm-default-rtdb.firebaseio.com"
#define API_KEY "YourDatabaseSecretHere"  // From Firebase console

// ===== Sensor Pin Definitions =====
#define TDS_PIN 34
#define PH_PIN 35
#define TEMP_PIN 4
#define TRIG_PIN 5
#define ECHO_PIN 18

// ===== Firebase Objects =====
FirebaseData fbdo;
FirebaseAuth auth;
FirebaseConfig config;

// ===== Temperature Sensor =====
OneWire oneWire(TEMP_PIN);
DallasTemperature tempSensor(&oneWire);

// ===== Global Variables =====
unsigned long sendDataPrevMillis = 0;
bool signupOK = false;

// ===== Calibration Constants =====
float tdsCalibration = 833.33;
float phSlope = -3.5;
float phIntercept = 21.0;

void setup() {
  Serial.begin(115200);
  
  // Initialize sensors
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  tempSensor.begin();
  
  // Connect to WiFi
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  Serial.print("Connecting to WiFi");
  
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(300);
  }
  
  Serial.println();
  Serial.print("Connected! IP: ");
  Serial.println(WiFi.localIP());
  
  // Configure Firebase
  config.database_url = DATABASE_URL;
  config.signer.tokens.legacy_token = API_KEY;
  
  // Initialize Firebase
  Firebase.begin(&config, &auth);
  Firebase.reconnectWiFi(true);
  
  // Set buffer size (optional, default 4096)
  fbdo.setResponseSize(4096);
  
  Serial.println("Firebase initialized successfully!");
  signupOK = true;
}

void loop() {
  // Send data every 30 seconds
  if (Firebase.ready() && signupOK && (millis() - sendDataPrevMillis > 30000 || sendDataPrevMillis == 0)) {
    sendDataPrevMillis = millis();
    
    // Read all sensors
    float tds = readTDS();
    float ph = readPH();
    float temperature = readTemperature();
    float waterLevel = readWaterLevel();
    unsigned long timestamp = millis() / 1000;  // Convert to seconds
    
    // Print to serial for debugging
    Serial.println("===== Sensor Readings =====");
    Serial.printf("TDS: %.0f ppmn", tds);
    Serial.printf("pH: %.2fn", ph);
    Serial.printf("Temperature: %.1f °Cn", temperature);
    Serial.printf("Water Level: %.1f cmn", waterLevel);
    Serial.println("===========================");
    
    // Upload current readings to Firebase
    uploadCurrentData(tds, ph, temperature, waterLevel);
    
    // Upload to historical data
    uploadHistoricalData(timestamp, tds, ph, temperature, waterLevel);
    
    // Check thresholds and send alerts if needed
    checkThresholds(tds, ph, temperature, waterLevel);
    
    Serial.println("Data uploaded to Firebase successfully!n");
  }
}

// ===== Sensor Reading Functions =====
float readTDS() {
  int rawValue = analogRead(TDS_PIN);
  float voltage = rawValue * (3.3 / 4095.0);
  return tdsCalibration * voltage;
}

float readPH() {
  int rawValue = analogRead(PH_PIN);
  float voltage = rawValue * (3.3 / 4095.0);
  float phValue = (phSlope * voltage) + phIntercept;
  return constrain(phValue, 0, 14);
}

float readTemperature() {
  tempSensor.requestTemperatures();
  float temp = tempSensor.getTempCByIndex(0);
  return (temp == -127.0) ? 20.0 : temp;  // Return safe default if error
}

float readWaterLevel() {
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);
  
  long duration = pulseIn(ECHO_PIN, HIGH, 30000);
  return (duration == 0) ? 0 : (duration * 0.034 / 2);
}

// ===== Firebase Upload Functions =====
void uploadCurrentData(float tds, float ph, float temp, float level) {
  // Upload to /hydroponics/zone1/current/
  String path = "hydroponics/zone1/current";
  
  Firebase.RTDB.setFloat(&fbdo, path + "/tds", tds);
  Firebase.RTDB.setFloat(&fbdo, path + "/ph", ph);
  Firebase.RTDB.setFloat(&fbdo, path + "/temperature", temp);
  Firebase.RTDB.setFloat(&fbdo, path + "/waterLevel", level);
  Firebase.RTDB.setInt(&fbdo, path + "/lastUpdate", millis() / 1000);
}

void uploadHistoricalData(unsigned long timestamp, float tds, float ph, float temp, float level) {
  // Upload to /hydroponics/zone1/history/{timestamp}/
  String path = "hydroponics/zone1/history/" + String(timestamp);
  
  // Create JSON object
  FirebaseJson json;
  json.set("tds", tds);
  json.set("ph", ph);
  json.set("temperature", temp);
  json.set("waterLevel", level);
  
  // Upload entire object at once (more efficient)
  Firebase.RTDB.setJSON(&fbdo, path, &json);
}

void checkThresholds(float tds, float ph, float temp, float level) {
  // Define thresholds
  const float TDS_MIN = 800, TDS_MAX = 1400;
  const float PH_MIN = 5.5, PH_MAX = 6.5;
  const float TEMP_MIN = 18.0, TEMP_MAX = 24.0;
  const float LEVEL_MAX = 15.0;  // cm from sensor to water
  
  String alerts = "";
  
  if (tds < TDS_MIN) alerts += "TDS LOW (" + String(tds, 0) + " ppm) | ";
  if (tds > TDS_MAX) alerts += "TDS HIGH (" + String(tds, 0) + " ppm) | ";
  if (ph < PH_MIN) alerts += "pH LOW (" + String(ph, 2) + ") | ";
  if (ph > PH_MAX) alerts += "pH HIGH (" + String(ph, 2) + ") | ";
  if (temp < TEMP_MIN) alerts += "TEMP LOW (" + String(temp, 1) + "°C) | ";
  if (temp > TEMP_MAX) alerts += "TEMP HIGH (" + String(temp, 1) + "°C) | ";
  if (level > LEVEL_MAX) alerts += "WATER LOW | ";
  
  // Upload alert status to Firebase
  if (alerts.length() > 0) {
    Firebase.RTDB.setString(&fbdo, "hydroponics/zone1/alerts/message", alerts);
    Firebase.RTDB.setBool(&fbdo, "hydroponics/zone1/alerts/active", true);
    Firebase.RTDB.setInt(&fbdo, "hydroponics/zone1/alerts/timestamp", millis() / 1000);
    
    Serial.println("⚠️  ALERT: " + alerts);
  } else {
    Firebase.RTDB.setBool(&fbdo, "hydroponics/zone1/alerts/active", false);
  }
}

Upload to ESP32:

  1. Edit WiFi credentials (lines 18-19)
  2. Edit Firebase URL and API key (lines 22-23)
  3. Connect ESP32 via USB
  4. Select Board: ESP32 Dev Module
  5. Select Port: COMx or /dev/ttyUSB0
  6. Click Upload
  7. Open Serial Monitor (115200 baud)
  8. Watch connection and data upload!

Expected Serial Output:

Connecting to WiFi....
Connected! IP: 192.168.1.47
Firebase initialized successfully!

===== Sensor Readings =====
TDS: 1180 ppm
pH: 6.20
Temperature: 21.4 °C
Water Level: 12.3 cm
===========================
Data uploaded to Firebase successfully!

Phase 3: Viewing Data in Firebase Console

Real-Time Monitoring:

  1. Open Firebase Console: https://console.firebase.google.com
  2. Select your project
  3. Click “Realtime Database” in sidebar
  4. You’ll see your data structure updating live!

Database Structure You’ll See:

{
  "hydroponics": {
    "zone1": {
      "current": {
        "tds": 1180,
        "ph": 6.2,
        "temperature": 21.4,
        "waterLevel": 12.3,
        "lastUpdate": 1696723847
      },
      "history": {
        "1696723847": {
          "tds": 1180,
          "ph": 6.2,
          "temperature": 21.4,
          "waterLevel": 12.3
        },
        "1696723877": { ... },
        "1696723907": { ... }
      },
      "alerts": {
        "active": false,
        "message": "",
        "timestamp": 0
      }
    }
  }
}

Watch Data Update Live:

Every 30 seconds, you’ll see numbers change in real-time! The Firebase console auto-refreshes.


Phase 4: Building Web Dashboard

Simple HTML Dashboard (Copy-Paste Ready):

<!DOCTYPE html>
<html>
<head>
  <title>Hydroponic Monitor</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  
  <!-- Bootstrap CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
  
  <!-- Chart.js -->
  https://cdn.jsdelivr.net/npm/chart.js
  
  <!-- Firebase SDK -->
  https://www.gstatic.com/firebasejs/9.0.0/firebase-app-compat.js
  https://www.gstatic.com/firebasejs/9.0.0/firebase-database-compat.js
  
  <style>
    .card { margin-bottom: 20px; }
    .reading { font-size: 2em; font-weight: bold; }
    .label { color: #666; font-size: 0.9em; }
    .alert-active { background-color: #fff3cd; border-left: 5px solid #ff9800; }
  </style>
</head>
<body>
  <div class="container mt-4">
    <h1>🌱 Hydroponic Monitor</h1>
    <p class="text-muted">Real-time data from Firebase Cloud</p>
    
    <!-- Alert Banner -->
    <div id="alertBanner" class="alert alert-active" style="display: none;">
      <strong>⚠️ Alert:</strong> <span id="alertMessage"></span>
    </div>
    
    <!-- Current Readings -->
    <div class="row">
      <div class="col-md-3">
        <div class="card">
          <div class="card-body text-center">
            <div class="label">TDS</div>
            <div class="reading text-primary" id="tds">--</div>
            <div class="label">ppm</div>
          </div>
        </div>
      </div>
      
      <div class="col-md-3">
        <div class="card">
          <div class="card-body text-center">
            <div class="label">pH</div>
            <div class="reading text-success" id="ph">--</div>
            <div class="label"></div>
          </div>
        </div>
      </div>
      
      <div class="col-md-3">
        <div class="card">
          <div class="card-body text-center">
            <div class="label">Temperature</div>
            <div class="reading text-warning" id="temperature">--</div>
            <div class="label">°C</div>
          </div>
        </div>
      </div>
      
      <div class="col-md-3">
        <div class="card">
          <div class="card-body text-center">
            <div class="label">Water Level</div>
            <div class="reading text-info" id="waterLevel">--</div>
            <div class="label">cm</div>
          </div>
        </div>
      </div>
    </div>
    
    <!-- Last Update -->
    <div class="text-muted">
      Last update: <span id="lastUpdate">Never</span>
    </div>
    
    <!-- Historical Chart -->
    <div class="card mt-4">
      <div class="card-body">
        <h5>pH History (Last 24 Hours)</h5>
        <canvas id="phChart"></canvas>
      </div>
    </div>
  </div>
  
  <script>
    // ===== Firebase Configuration =====
    const firebaseConfig = {
      databaseURL: "https://myhydroponicfarm-default-rtdb.firebaseio.com"
    };
    
    firebase.initializeApp(firebaseConfig);
    const database = firebase.database();
    
    // ===== Listen for Current Data Changes =====
    const currentRef = database.ref('hydroponics/zone1/current');
    currentRef.on('value', (snapshot) => {
      const data = snapshot.val();
      
      if (data) {
        document.getElementById('tds').textContent = data.tds.toFixed(0);
        document.getElementById('ph').textContent = data.ph.toFixed(2);
        document.getElementById('temperature').textContent = data.temperature.toFixed(1);
        document.getElementById('waterLevel').textContent = data.waterLevel.toFixed(1);
        
        const lastUpdate = new Date(data.lastUpdate * 1000);
        document.getElementById('lastUpdate').textContent = lastUpdate.toLocaleString();
      }
    });
    
    // ===== Listen for Alerts =====
    const alertRef = database.ref('hydroponics/zone1/alerts');
    alertRef.on('value', (snapshot) => {
      const alert = snapshot.val();
      
      if (alert && alert.active) {
        document.getElementById('alertBanner').style.display = 'block';
        document.getElementById('alertMessage').textContent = alert.message;
      } else {
        document.getElementById('alertBanner').style.display = 'none';
      }
    });
    
    // ===== Load Historical Data for Chart =====
    const historyRef = database.ref('hydroponics/zone1/history');
    
    // Get last 50 readings
    historyRef.orderByKey().limitToLast(50).once('value', (snapshot) => {
      const historyData = snapshot.val();
      
      const timestamps = [];
      const phValues = [];
      
      Object.keys(historyData).forEach(timestamp => {
        const date = new Date(parseInt(timestamp) * 1000);
        timestamps.push(date.toLocaleTimeString());
        phValues.push(historyData[timestamp].ph);
      });
      
      // Create Chart
      const ctx = document.getElementById('phChart').getContext('2d');
      new Chart(ctx, {
        type: 'line',
        data: {
          labels: timestamps,
          datasets: [{
            label: 'pH',
            data: phValues,
            borderColor: 'rgb(75, 192, 192)',
            backgroundColor: 'rgba(75, 192, 192, 0.2)',
            tension: 0.1
          }]
        },
        options: {
          responsive: true,
          scales: {
            y: {
              min: 5.0,
              max: 7.0,
              title: {
                display: true,
                text: 'pH Level'
              }
            }
          },
          plugins: {
            annotation: {
              annotations: {
                line1: {
                  type: 'line',
                  yMin: 5.5,
                  yMax: 5.5,
                  borderColor: 'rgb(255, 99, 132)',
                  borderWidth: 2,
                  borderDash: [5, 5],
                  label: {
                    content: 'Min pH',
                    enabled: true
                  }
                },
                line2: {
                  type: 'line',
                  yMin: 6.5,
                  yMax: 6.5,
                  borderColor: 'rgb(255, 99, 132)',
                  borderWidth: 2,
                  borderDash: [5, 5],
                  label: {
                    content: 'Max pH',
                    enabled: true
                  }
                }
              }
            }
          }
        }
      });
    });
  </script>
</body>
</html>

How to Use:

  1. Copy entire code above
  2. Save as dashboard.html on your computer
  3. Edit line 62: Replace with YOUR Firebase database URL
  4. Open file in web browser (Chrome, Firefox, etc.)
  5. Dashboard loads and updates in real-time!

Features:

  • ✅ Real-time updates (no refresh needed)
  • ✅ Current readings displayed as large numbers
  • ✅ Alert banner shows warnings
  • ✅ pH history chart (last 50 readings)
  • ✅ Responsive design (works on phone, tablet, desktop)
  • ✅ No server needed (runs entirely in browser)

Hosting Online (Optional):

Free Hosting Options:

  • Firebase Hosting: 10 GB storage, 360 MB/day bandwidth (free)
  • GitHub Pages: Free static hosting
  • Netlify: Free with automatic deployment

Advanced Features

1. Multiple Zones

Add Zone 2, 3, etc.:

// In ESP32 code, change upload path
String zoneID = "zone2";  // or "zone3", "zone4", etc.
String path = "hydroponics/" + zoneID + "/current";

Firebase.RTDB.setFloat(&fbdo, path + "/tds", tds);
// ... rest of uploads

Dashboard shows all zones:

// Loop through all zones
const zones = ['zone1', 'zone2', 'zone3', 'zone4'];

zones.forEach(zone => {
  database.ref(`hydroponics/${zone}/current`).on('value', (snapshot) => {
    const data = snapshot.val();
    // Update UI for this zone
  });
});

2. Email/SMS Alerts

Firebase Cloud Functions (serverless code that runs when data changes):

// Deploy this to Firebase Cloud Functions
const functions = require('firebase-functions');
const nodemailer = require('nodemailer');

exports.sendAlert = functions.database.ref('/hydroponics/{zone}/alerts/active')
  .onUpdate((change, context) => {
    const isActive = change.after.val();
    
    if (isActive) {
      // Get alert message
      return change.after.ref.parent.child('message').once('value').then(snap => {
        const message = snap.val();
        
        // Send email via Gmail
        const transporter = nodemailer.createTransport({
          service: 'gmail',
          auth: {
            user: 'your-email@gmail.com',
            pass: 'your-app-password'
          }
        });
        
        return transporter.sendMail({
          from: 'Hydroponic System <your-email@gmail.com>',
          to: 'your-phone@carrier-sms-gateway.com',  // SMS via email
          subject: '⚠️ Hydroponic Alert',
          text: message
        });
      });
    }
    return null;
  });

3. Historical Data Download

Export to CSV:

<button onclick="exportToCSV()">Download Data (CSV)</button>

<script>
function exportToCSV() {
  database.ref('hydroponics/zone1/history').once('value', (snapshot) => {
    const data = snapshot.val();
    
    let csv = 'Timestamp,TDS,pH,Temperature,WaterLeveln';
    
    Object.keys(data).forEach(timestamp => {
      const row = data[timestamp];
      const date = new Date(parseInt(timestamp) * 1000);
      csv += `${date.toISOString()},${row.tds},${row.ph},${row.temperature},${row.waterLevel}n`;
    });
    
    // Download
    const blob = new Blob([csv], { type: 'text/csv' });
    const url = window.URL.createObjectURL(blob);
    const a = document.createElement('a');
    a.href = url;
    a.download = 'hydroponic_data.csv';
    a.click();
  });
}
</script>

Security Implementation

Problem: Our database is currently PUBLIC (anyone can read/write)

Solution: Firebase Security Rules

Step 1: Setup Authentication (Optional)

If you want private dashboard:

// Add to dashboard HTML
const auth = firebase.auth();

// Sign in anonymously (no password needed)
auth.signInAnonymously().then(() => {
  console.log('Signed in!');
});

Step 2: Database Rules

In Firebase Console → Realtime Database → Rules:

{
  "rules": {
    "hydroponics": {
      // Anyone can read (for public dashboards)
      ".read": true,
      
      // Only authenticated devices can write
      ".write": "auth != null"
    }
  }
}

For Complete Privacy:

{
  "rules": {
    "hydroponics": {
      // Only authenticated users can read/write
      ".read": "auth != null",
      ".write": "auth != null"
    }
  }
}

ESP32 Authentication:

// Add to ESP32 code
auth.user.email = "esp32@hydroponic.com";
auth.user.password = "YourSecurePassword123";

// Firebase will authenticate ESP32 before allowing writes

Real-World Results: Anna’s Firebase Journey

11-Month Performance Metrics:

Data Volume:

  • Total readings: 8.7 million
  • Average per day: 791,000
  • Storage used: 427 MB (of 1 GB free tier)
  • Projected storage at this rate: 10+ years on free tier

Reliability:

  • Uptime: 99.95% (Google SLA)
  • Data loss incidents: 0
  • Sync failures: 0.003% (auto-retry successful)
  • Average latency: 247ms (India to Google servers to phone)

Multi-Device Access:

  • Anna’s phone (primary)
  • Tablet (field use)
  • Laptop (analysis)
  • Agronomist’s laptop (remote, 847 km away)
  • All devices synchronized in real-time

Cost Comparison (11 months):

PlatformCostData LimitDevicesFeatures
Firebase (actual)₹0427 MB usedUnlimitedFull access
Blynk Pro₹19,800UnlimitedUnlimitedLimited
AWS IoT Core₹27,500Pay per usePay per useComplex
Custom VPS₹13,20050 GBUnlimitedMaintenance

Total Savings: ₹13,200 – ₹27,500 (vs alternatives)

Real Incidents Where Firebase Proved Critical:

1. Remote Emergency Response (Month 4)

  • Location: Anna in client meeting, 847 km from farm
  • Alert: pH 8.1 detected via Firebase dashboard on phone
  • Action: Called farm worker, guided pH adjustment remotely
  • Resolution time: 18 minutes
  • Damage prevented: ₹2.4 lakh

2. Agronomist Collaboration (Month 7)

  • Shared Firebase dashboard with consulting agronomist
  • Agronomist analyzed 30 days historical data remotely
  • Identified subtle nutrient uptake pattern
  • Optimization: Adjusted EC schedule → +12% yield improvement
  • Value: ₹1.8 lakh additional revenue

3. Internet Outage Resilience (Month 9)

  • Farm WiFi down for 6 hours (ISP maintenance)
  • ESP32 cached 720 readings locally
  • Once WiFi restored, all data synced automatically to Firebase
  • Data loss: Zero
  • Manual intervention required: None

Troubleshooting Guide

Problem: ESP32 won’t connect to Firebase

Check:

  1. WiFi connected? (Check Serial Monitor for IP address)
  2. Database URL correct? (Should end in .firebaseio.com)
  3. API key correct? (Check Firebase Console → Settings)
  4. Firewall blocking? (Corporate networks may block Firebase)

Solution:

// Add detailed error logging
if (!Firebase.RTDB.setFloat(&fbdo, path, value)) {
  Serial.println("Upload failed:");
  Serial.println(fbdo.errorReason());
}

Problem: Data not appearing in Firebase Console

Check:

  1. ESP32 connected to internet? (ping 8.8.8.8)
  2. Database rules allow writes? (Check Rules tab)
  3. Path correct? (Case-sensitive: “zone1” ≠ “Zone1”)

Problem: Dashboard shows old data

Cause: Browser caching

Solution:

  • Hard refresh: Ctrl+F5 (Windows) or Cmd+Shift+R (Mac)
  • Or add to dashboard code:
database.goOffline();
database.goOnline();  // Force reconnect

Problem: Hitting free tier limits

Symptoms:

  • “Quota exceeded” error
  • Dashboard stops updating

Solutions:

  1. Reduce upload frequency: 30s → 60s (halves data)
  2. Delete old history: Keep only last 30 days
  3. Upgrade to Blaze plan: Pay only for what you use beyond free tier

Delete Old Data Script:

// Run once per day via Firebase Cloud Function
const cutoff = Date.now() / 1000 - (30 * 24 * 60 * 60);  // 30 days ago

database.ref('hydroponics/zone1/history')
  .orderByKey()
  .endAt(String(cutoff))
  .once('value', snapshot => {
    snapshot.ref.remove();  // Delete data older than 30 days
  });

Conclusion: Professional Cloud at Zero Cost

At 11:47 PM, as Anna reviewed her weekly analytics dashboard from her home laptop while her ESP32 hummed quietly in the greenhouse 200 meters away, the Firebase Cloud Platform displayed something extraordinary: 11 months of continuous operation, 8.7 million data points synchronized flawlessly across 4 devices in real-time, 99.95% uptime matching enterprise SLAs, zero data loss through internet outages and system updates, and most remarkably—₹0 cost while commercial alternatives would have charged ₹13,200-27,500 for equivalent service.

The Firebase Transformation Reality:

Modern agricultural monitoring isn’t about expensive IoT platforms charging monthly fees—it’s about leveraging professional infrastructure built by Google for billions of users and applying it to hydroponics with zero configuration overhead. Firebase represents the democratization of enterprise technology: the same real-time database powering apps with millions of users, now monitoring your greenhouse for free.

The Economic Victory:

Anna’s Firebase implementation required:

  • Capital: ₹0 (Google’s free tier)
  • Time: 2-3 hours (initial setup)
  • Skills: Basic HTML + Arduino (learnable in 1 week)
  • Ongoing: ₹0/month (within free limits)

The platform delivered:

  • Storage: 427 MB used (10+ years capacity remaining)
  • Devices: 4 synchronized (unlimited possible)
  • Uptime: 99.95% (Google infrastructure)
  • Savings: ₹13,200-27,500/year (vs paid platforms)
  • ROI: Infinite** (no cost, pure value)

The Strategic Insight:

Firebase transforms hydroponics from local monitoring limited by physical presence to global visibility enabled by cloud infrastructure. Check systems from anywhere with internet. Share dashboards with consultants 847 km away. Analyze years of historical data in browser. Receive instant alerts on phone. Scale from 1 greenhouse to 100 without changing anything. The result: professional monitoring capabilities previously accessible only to enterprises with IT budgets, now available free to every grower.

As Erik checked the evening sensor readings from his phone while commuting home 47 km away—noting pH 6.1, TDS 1180 ppm, temperature 21.4°C synced from Firebase 247 milliseconds ago—Anna reflected on the fundamental shift: “We’re no longer farmers constrained by physical location. We’re cloud-connected operators monitoring crops from anywhere on Earth through Google’s infrastructure. Firebase watches 24/7, we just check when we want.”

The cloud revolution isn’t coming to hydroponics. It’s already here, powered by Firebase, costing ₹0.


Technical Resources & Support

Official Documentation

Firebase:

  • Getting Started: https://firebase.google.com/docs/database/web/start
  • ESP32 Library: https://github.com/mobizt/Firebase-ESP32
  • Security Rules: https://firebase.google.com/docs/database/security

Example Projects

Open Source Firebase Hydroponics:

  • GitHub: Search “ESP32 Firebase hydroponics”
  • Agriculture Novel: www.agriculturenovel.com/firebase-examples

Agriculture Novel Support

Contact Information:

  • Firebase Consulting: firebase@agriculturenovel.com
  • Technical Support: +91-9876543210
  • WhatsApp: Get instant Firebase integration help
  • Website: www.agriculturenovel.com/firebase-cloud

Services Offered:

  • Pre-configured Firebase projects
  • Custom dashboard development
  • Multi-zone system setup
  • Data analytics integration
  • Training workshops
  • 24/7 technical support

Firebase Integration Packages:

  • Starter (₹2,500): Pre-configured project + basic dashboard
  • Professional (₹6,500): Multi-zone + mobile app + analytics
  • Enterprise (₹15,000+): Custom features + training + support

Tags: #FirebaseHydroponics #ESP32Cloud #RealTimeDatabase #GoogleCloud #IoTAgriculture #CloudMonitoring #FreeCloudStorage #SmartFarming #WebDashboard #MobileApp #RemoteMonitoring #AgTech #HydroponicAutomation #DataAnalytics #AgricultureNovel #CloudIntegration #ZeroCostMonitoring #ProfessionalInfrastructure #GlobalAccess #RealtimeSync

Next in this wing

Leave a Reply

Crop Intelligence

Every crop, one table

Sowing window, duration, spacing, soil pH, water need, temperature, seed rate, yield and key pests — across 163 crops and plants, from cereals to medicinals. Indicative planning ranges for Indian conditions; varieties and regions vary.

163 crops shown
Agronomic reference for common Indian crops
Group Season Sowing Spacing Soil pH Temp °C Seed / ha Yield / ha Watch for
Rice Cereal Kharif Jun–Jul 120–150 20 × 15 cm 5.5–6.5 1200–1800 22–32 40–50 kg 4–6 t Stem borer, blast, BPH
Wheat Cereal Rabi Nov–Dec 120–150 22 cm rows 6.0–7.5 400–650 15–25 100–125 kg 4–5 t Yellow rust, aphid, termite
Maize Cereal Kharif · Rabi Jun–Jul, Oct–Nov 90–110 60 × 20 cm 5.5–7.5 500–800 21–30 18–20 kg 5–8 t Fall armyworm, stem borer
Barley Cereal Rabi Nov–Dec 110–130 22 cm rows 6.5–8.0 300–450 12–25 75–100 kg 3–4 t Aphid, yellow rust
Oats Cereal Rabi Oct–Nov 100–120 22 cm rows 5.5–7.0 350–500 15–25 80–100 kg 2.5–3.5 t Rust, aphid
Buckwheat Cereal Rabi Sep–Oct 75–90 30 × 10 cm 5.0–7.0 300–450 15–25 40–50 kg 1–1.5 t Aphid, leaf spot
Grain Amaranth Cereal Kharif · Rabi Jun–Jul, Oct 90–110 45 × 20 cm 5.5–7.5 300–450 20–30 2–3 kg 1–1.5 t Stem weevil, leaf webber
Sorghum (Jowar) Millet Kharif · Rabi Jun–Jul, Sep–Oct 100–120 45 × 15 cm 6.0–7.5 400–600 26–32 10–12 kg 2.5–4 t Shoot fly, midge, downy mildew
Pearl Millet (Bajra) Millet Kharif Jun–Jul 75–90 45 × 15 cm 6.5–7.8 350–500 25–35 4–5 kg 2–3 t Downy mildew, ergot
Finger Millet (Ragi) Millet Kharif Jun–Jul 100–120 30 × 10 cm 5.0–7.5 400–600 20–30 10–12 kg 2–3 t Blast, stem borer
Foxtail Millet Millet Kharif Jun–Jul 70–90 25 × 10 cm 5.5–7.0 250–400 20–30 8–10 kg 1.5–2 t Blast, shoot fly
Kodo Millet Millet Kharif Jun–Jul 100–120 25 × 10 cm 5.5–7.5 300–450 25–32 10–12 kg 1–1.5 t Head smut, shoot fly
Little Millet Millet Kharif Jun–Jul 70–90 25 × 10 cm 5.5–7.5 250–400 22–32 8–10 kg 0.8–1.2 t Shoot fly, grain smut
Barnyard Millet Millet Kharif Jun–Jul 75–90 25 × 10 cm 5.5–7.0 250–400 22–30 10–12 kg 1–1.5 t Grain smut, shoot fly
Proso Millet Millet Kharif · Zaid Jun–Jul, Feb 60–75 25 × 10 cm 5.5–7.5 200–350 20–30 10–12 kg 1–1.5 t Shoot fly, head smut
Chickpea (Gram) Pulse Rabi Oct–Nov 95–120 30 × 10 cm 6.0–8.0 250–400 15–25 75–100 kg 1.5–2.5 t Pod borer, wilt
Pigeon Pea (Tur) Pulse Kharif Jun–Jul 150–180 60 × 20 cm 6.0–7.5 400–600 20–30 12–15 kg 1.5–2 t Pod borer, wilt, sterility mosaic
Green Gram (Moong) Pulse Kharif · Zaid Jun–Jul, Mar–Apr 60–75 30 × 10 cm 6.2–7.2 250–350 25–35 15–20 kg 0.8–1.2 t Yellow mosaic, thrips
Black Gram (Urad) Pulse Kharif Jun–Jul 70–90 30 × 10 cm 6.0–7.5 250–400 25–35 15–20 kg 0.8–1.2 t Yellow mosaic, powdery mildew
Lentil (Masur) Pulse Rabi Oct–Nov 100–120 25 × 5 cm 6.0–7.5 200–350 15–25 30–40 kg 1–1.5 t Rust, wilt, aphid
Cowpea Pulse Kharif · Zaid Jun–Jul, Feb–Mar 70–90 45 × 15 cm 5.5–7.5 250–400 25–35 20–25 kg 1–1.5 t Aphid, pod borer
Field Pea Pulse Rabi Oct–Nov 100–130 30 × 10 cm 6.0–7.5 250–400 13–23 75–100 kg 1.5–2.5 t Powdery mildew, pod borer
Horse Gram Pulse Kharif · Rabi Aug–Sep 110–130 30 × 10 cm 5.0–7.5 200–300 20–30 25–30 kg 0.6–1 t Leaf spot, pod borer
Moth Bean Pulse Kharif Jul 70–90 30 × 10 cm 6.0–8.0 150–300 25–35 10–12 kg 0.5–0.8 t Yellow mosaic, jassid
Rajma (Kidney Bean) Pulse Rabi Oct–Nov 110–130 40 × 15 cm 5.5–6.5 300–450 15–25 80–100 kg 1.5–2 t Anthracnose, bean fly
Faba Bean Pulse Rabi Oct–Nov 120–150 45 × 15 cm 6.0–7.5 350–500 12–22 100–120 kg 2–3 t Chocolate spot, aphid
Lablab (Sem) Pulse Kharif Jun–Jul 110–140 60 × 30 cm 5.5–7.5 300–450 20–30 15–20 kg 1–1.5 t Pod borer, aphid
Cluster Bean (Guar) Pulse Kharif Jun–Jul 90–110 45 × 20 cm 7.0–8.5 250–400 25–35 15–20 kg 1–1.5 t Bacterial blight, jassid
Groundnut Oilseed Kharif Jun–Jul 100–130 30 × 10 cm 6.0–7.0 500–700 25–30 100–120 kg 2–2.5 t Leaf miner, tikka leaf spot
Mustard Oilseed Rabi Oct–Nov 110–140 30 × 10 cm 6.0–7.5 250–400 10–25 4–5 kg 1.5–2 t Aphid, white rust, alternaria
Rapeseed (Toria) Oilseed Rabi Sep–Oct 85–100 30 × 10 cm 6.0–7.5 200–350 10–25 4–5 kg 1–1.5 t Aphid, alternaria blight
Soybean Oilseed Kharif Jun–Jul 90–110 45 × 5 cm 6.0–7.5 450–700 20–30 65–75 kg 2–2.5 t Girdle beetle, yellow mosaic
Sunflower Oilseed Rabi · Zaid Oct–Nov, Jan–Feb 90–110 60 × 30 cm 6.5–8.0 400–600 20–28 8–10 kg 1.5–2 t Head borer, necrosis, downy mildew
Sesame (Til) Oilseed Kharif · Zaid Jun–Jul, Feb–Mar 80–95 30 × 15 cm 5.5–8.0 300–450 25–32 4–5 kg 0.6–1 t Phyllody, leaf webber
Castor Oilseed Kharif Jun–Aug 150–180 90 × 60 cm 5.5–7.5 500–700 20–30 5–8 kg 1.5–2.5 t Semilooper, capsule borer, wilt
Safflower Oilseed Rabi Oct–Nov 120–140 45 × 20 cm 6.0–8.0 250–400 15–25 10–15 kg 1–1.5 t Aphid, wilt, alternaria
Linseed Oilseed Rabi Oct–Nov 110–130 25 × 5 cm 6.0–7.5 250–400 15–25 25–30 kg 1–1.5 t Bud fly, rust, wilt
Niger Oilseed Kharif Jul–Aug 90–110 30 × 10 cm 5.5–7.0 300–450 18–28 5–6 kg 0.4–0.6 t Leaf spot, capsule fly
Cotton Fibre Kharif May–Jun 160–200 90 × 60 cm 6.0–8.0 700–1200 21–30 1.5–2.5 kg (Bt) 2–3 t seed cotton Pink bollworm, whitefly, jassid
Jute Fibre Kharif Mar–May 110–140 25 × 7 cm 6.0–7.5 500–750 24–35 5–8 kg 2.5–3 t fibre Stem rot, semilooper
Mesta (Kenaf) Fibre Kharif Apr–Jun 120–150 30 × 10 cm 6.0–7.5 450–700 22–32 12–15 kg 2–2.5 t fibre Stem rot, spiral borer
Sunn Hemp Fibre Kharif Jun–Jul 100–120 30 × 10 cm 5.5–7.5 350–500 22–32 25–30 kg 1.5–2 t fibre Hairy caterpillar, wilt
Sugarcane Plantation Perennial Oct–Nov, Feb–Mar 300–365 90–120 cm rows 6.5–7.5 1500–2500 20–35 35–40 k setts 80–100 t Early shoot borer, red rot, woolly aphid
Tea Plantation Perennial Jun–Aug (planting) 3–4 yr to pluck 1.2 × 0.75 m 4.5–5.5 2000–2500 18–30 13 k plants 2–3 t made tea Red spider mite, blister blight
Coffee Plantation Perennial Jun–Jul (planting) 3–4 yr to bear 2.5 × 2.5 m 6.0–6.5 1500–2000 15–28 1,600 plants 1–1.5 t clean White stem borer, leaf rust
Rubber Plantation Perennial Jun–Jul (planting) 6–7 yr to tap 4.9 × 4.9 m 4.5–6.0 2000–3000 25–34 420 plants 1.5–2 t dry rubber Abnormal leaf fall, pink disease
Coconut Plantation Perennial Jun–Jul (planting) 5–6 yr to bear 7.5 × 7.5 m 5.5–7.5 1300–2300 20–32 175 palms 80–120 nuts/palm Rhinoceros beetle, red palm weevil, root wilt
Arecanut Plantation Perennial Jun–Jul (planting) 5–7 yr to bear 2.7 × 2.7 m 5.5–7.0 1500–2500 20–32 1,350 palms 2–3 t dry kernel Koleroga, yellow leaf disease
Cashew Plantation Perennial Jun–Jul (planting) 3–4 yr to bear 7.5 × 7.5 m 5.5–7.0 800–1200 20–35 175 plants 1–1.5 t nuts Tea mosquito bug, stem borer
Cocoa Plantation Perennial Jun–Jul (planting) 3–4 yr to bear 2.7 × 2.7 m 5.5–7.0 1500–2000 20–30 1,100 plants 1–1.5 t dry bean Black pod, tea mosquito bug
Oil Palm Plantation Perennial Jun–Sep (planting) 3–4 yr to bear 9 m triangular 5.0–7.0 2000–2500 24–32 143 palms 20–25 t FFB Rhinoceros beetle, bud rot
Tobacco Plantation Rabi Sep–Oct 110–130 90 × 60 cm 5.5–6.5 400–600 20–30 250–300 g 1.5–2.5 t cured Aphid, budworm, black shank
Tomato Vegetable Year-round Jun–Jul, Oct–Nov, Jan–Feb 110–140 60 × 45 cm 6.0–7.0 400–600 20–27 250–400 g 25–40 t Fruit borer, leaf curl virus, early blight
Onion Vegetable Rabi · Kharif Oct–Nov, Jun–Jul 120–150 15 × 10 cm 6.0–7.5 350–550 13–25 8–10 kg 25–35 t Thrips, purple blotch, basal rot
Potato Vegetable Rabi Oct–Nov 90–120 60 × 20 cm 5.5–6.5 450–650 15–22 2.5–3 t tubers 25–35 t Late blight, aphid, tuber moth
Brinjal Vegetable Year-round Jun–Jul, Oct–Nov, Feb–Mar 120–150 60 × 60 cm 5.5–6.8 400–600 22–30 400–500 g 25–35 t Shoot & fruit borer, wilt
Okra (Bhindi) Vegetable Kharif · Zaid Jun–Jul, Feb–Mar 55–70 45 × 30 cm 6.0–6.8 350–500 24–32 8–10 kg 10–15 t Yellow vein mosaic, shoot borer, jassid
Chilli Vegetable Kharif · Rabi Jun–Jul, Oct–Nov 150–180 60 × 45 cm 6.0–7.0 500–700 20–30 1–1.5 kg 2–3 t dry Thrips, leaf curl, anthracnose
Capsicum Vegetable Rabi Sep–Oct 110–130 45 × 30 cm 6.0–6.8 400–600 18–27 750 g–1 kg 20–30 t Thrips, mites, anthracnose
Cabbage Vegetable Rabi Sep–Oct 90–120 45 × 45 cm 6.0–6.5 350–500 15–21 400–500 g 25–35 t Diamondback moth, black rot
Cauliflower Vegetable Rabi Sep–Oct 90–120 45 × 45 cm 6.0–7.0 350–500 15–20 400–500 g 20–30 t Diamondback moth, downy mildew
Broccoli Vegetable Rabi Sep–Oct 90–110 45 × 45 cm 6.0–7.0 350–500 15–20 400–500 g 12–18 t Aphid, diamondback moth
Knol-khol Vegetable Rabi Sep–Oct 60–80 30 × 20 cm 6.0–7.0 300–450 15–22 1–1.5 kg 20–25 t Aphid, black rot
Cucumber Vegetable Zaid · Kharif Feb–Mar, Jun–Jul 50–70 150 × 60 cm 6.0–7.0 350–500 20–30 2–3 kg 15–20 t Downy mildew, fruit fly, red pumpkin beetle
Bottle Gourd Vegetable Zaid · Kharif Feb–Mar, Jun–Jul 60–80 250 × 60 cm 6.0–7.0 400–550 22–32 3–5 kg 20–25 t Fruit fly, downy mildew
Bitter Gourd Vegetable Zaid · Kharif Feb–Mar, Jun–Jul 55–75 150 × 60 cm 6.0–6.7 350–500 24–32 4–5 kg 12–18 t Fruit fly, mosaic virus
Ridge Gourd Vegetable Zaid · Kharif Feb–Mar, Jun–Jul 55–75 200 × 60 cm 6.0–7.0 350–500 24–32 3–4 kg 12–16 t Fruit fly, powdery mildew
Sponge Gourd Vegetable Zaid · Kharif Feb–Mar, Jun–Jul 55–75 200 × 60 cm 6.0–7.0 350–500 24–32 3–4 kg 12–16 t Fruit fly, downy mildew
Ash Gourd Vegetable Kharif Jun–Jul 90–120 250 × 90 cm 6.0–7.0 400–600 24–32 4–6 kg 25–35 t Fruit fly, mosaic
Pumpkin Vegetable Zaid · Kharif Feb–Mar, Jun–Jul 90–120 250 × 60 cm 6.0–7.0 400–600 20–30 4–6 kg 20–30 t Red pumpkin beetle, powdery mildew
Watermelon Vegetable Zaid Jan–Mar 80–100 200 × 60 cm 6.0–7.0 400–600 24–32 2.5–3.5 kg 25–35 t Fruit fly, anthracnose, wilt
Muskmelon Vegetable Zaid Jan–Mar 75–95 150 × 60 cm 6.0–7.0 350–550 24–32 2–2.5 kg 15–25 t Fruit fly, downy mildew
French Bean Vegetable Rabi · Zaid Oct–Nov, Feb 60–80 45 × 15 cm 5.5–6.5 300–450 16–24 60–80 kg 8–12 t Anthracnose, bean fly
Garden Pea Vegetable Rabi Oct–Nov 90–110 30 × 10 cm 6.0–7.5 300–450 13–22 80–100 kg 8–12 t Powdery mildew, pod borer
Radish Vegetable Rabi · Year-round Sep–Jan 40–60 30 × 10 cm 6.0–7.0 250–400 15–25 10–12 kg 20–30 t Aphid, white rust
Carrot Vegetable Rabi Aug–Nov 90–110 30 × 8 cm 6.0–7.0 350–500 15–22 5–6 kg 20–30 t Leaf blight, aphid, nematode
Beetroot Vegetable Rabi Sep–Nov 80–100 30 × 10 cm 6.0–7.5 300–450 15–24 7–8 kg 20–30 t Leaf spot, aphid
Turnip Vegetable Rabi Sep–Nov 55–75 30 × 10 cm 6.0–7.0 250–400 13–22 4–5 kg 20–25 t Aphid, white rust
Spinach (Palak) Vegetable Rabi · Year-round Sep–Feb 35–50 25 × 5 cm 6.0–7.5 200–350 15–25 25–30 kg 12–18 t Leaf spot, aphid
Fenugreek (Methi) Vegetable Rabi Oct–Nov 40–60 25 × 5 cm 6.0–7.5 200–350 15–25 25–30 kg 8–12 t Powdery mildew, aphid
Amaranth (Leafy) Vegetable Year-round Feb–Sep 30–45 20 × 10 cm 6.0–7.5 200–350 22–32 2–3 kg 10–15 t Leaf webber, stem weevil
Lettuce Vegetable Rabi Sep–Nov 60–80 30 × 30 cm 6.0–7.0 250–400 13–20 400–500 g 15–20 t Aphid, downy mildew
Celery Vegetable Rabi Sep–Oct 110–130 40 × 25 cm 6.0–7.0 400–600 15–22 2–3 kg 20–25 t Leaf spot, aphid
Sweet Potato Vegetable Kharif · Rabi Jun–Jul, Oct–Nov 100–130 60 × 20 cm 5.5–6.8 400–600 21–30 35–40 k vines 20–25 t Weevil, leaf curl
Colocasia (Arbi) Vegetable Kharif Jun–Jul 150–180 60 × 45 cm 5.5–7.0 800–1200 21–32 2–2.5 t corms 15–20 t Leaf blight, aphid
Elephant Foot Yam Vegetable Kharif Apr–May 210–240 90 × 90 cm 5.5–7.0 800–1200 25–35 10–12 t corms 30–40 t Collar rot, mosaic
Drumstick (Moringa) Vegetable Perennial Jun–Jul 180–240 2.5 × 2.5 m 6.0–7.5 500–800 25–35 600 g 25–30 t pods Hairy caterpillar, fruit fly
Banana Fruit Perennial Jun–Jul, Feb–Mar 300–365 1.8 × 1.8 m 6.0–7.5 1200–2000 20–35 3,000 suckers 50–70 t Sigatoka, panama wilt, weevil
Mango Fruit Perennial Jul–Aug (planting) 4–5 yr to bear 10 × 10 m 5.5–7.5 700–1000 24–30 100 grafts 8–12 t Hopper, powdery mildew, fruit fly
Papaya Fruit Year-round Feb–Mar, Jun–Jul 270–300 1.8 × 1.8 m 6.0–7.0 1000–1500 22–32 250–300 g 40–60 t Ring spot virus, mealybug
Guava Fruit Perennial Jul–Aug (planting) 2–3 yr to bear 6 × 6 m 6.0–7.5 800–1000 23–30 270 plants 20–25 t Fruit fly, wilt, anthracnose
Sweet Orange Fruit Perennial Jul–Aug (planting) 4–5 yr to bear 6 × 6 m 6.0–7.5 900–1200 20–32 270 plants 20–25 t Citrus canker, leaf miner, psylla
Mandarin (Kinnow) Fruit Perennial Jul–Aug (planting) 4–5 yr to bear 6 × 6 m 6.0–7.5 900–1200 18–30 270 plants 20–30 t Citrus canker, greening, leaf miner
Lemon Fruit Perennial Jul–Aug (planting) 3–4 yr to bear 5 × 5 m 6.0–7.5 800–1100 20–32 400 plants 15–20 t Canker, leaf miner, gummosis
Grapes Fruit Perennial Jan–Feb (planting) 2–3 yr to bear 3 × 2 m 6.5–7.5 600–900 15–35 1,650 vines 20–30 t Downy mildew, powdery mildew, thrips
Pomegranate Fruit Perennial Jul–Aug (planting) 2–3 yr to bear 5 × 5 m 6.5–7.5 600–900 20–35 400 plants 15–20 t Bacterial blight, fruit borer
Apple Fruit Perennial Dec–Jan (planting) 4–6 yr to bear 5 × 5 m 5.5–6.5 800–1200 10–24 400 plants 15–20 t Scab, codling moth, woolly aphid
Pear Fruit Perennial Dec–Jan (planting) 4–6 yr to bear 6 × 6 m 6.0–7.0 800–1100 10–25 270 plants 15–20 t Scab, leaf blight
Peach Fruit Perennial Dec–Jan (planting) 3–4 yr to bear 5 × 5 m 6.0–7.0 700–1000 12–26 400 plants 10–15 t Leaf curl, fruit fly
Plum Fruit Perennial Dec–Jan (planting) 3–4 yr to bear 5 × 5 m 6.0–7.0 700–1000 12–26 400 plants 10–15 t Brown rot, aphid
Litchi Fruit Perennial Jun–Sep (planting) 5–7 yr to bear 8 × 8 m 5.5–7.0 1200–1600 20–35 156 plants 8–12 t Fruit borer, mite, fruit cracking
Sapota (Chikoo) Fruit Perennial Jun–Jul (planting) 4–5 yr to bear 8 × 8 m 6.0–8.0 900–1300 20–32 156 plants 15–20 t Bud borer, leaf spot
Custard Apple Fruit Perennial Jun–Jul (planting) 3–4 yr to bear 5 × 5 m 6.5–7.5 600–800 23–32 400 plants 8–10 t Mealybug, anthracnose
Jackfruit Fruit Perennial Jun–Jul (planting) 5–7 yr to bear 10 × 10 m 6.0–7.5 1000–1500 22–35 100 plants 15–20 t Fruit rot, shoot borer
Pineapple Fruit Perennial Jul–Sep 450–540 60 × 30 cm 5.0–6.0 1000–1500 22–32 43 k suckers 50–60 t Mealybug, heart rot
Ber (Indian Jujube) Fruit Perennial Jul–Aug (planting) 2–3 yr to bear 6 × 6 m 6.0–8.5 400–600 20–35 270 plants 15–20 t Fruit fly, powdery mildew
Amla Fruit Perennial Jul–Aug (planting) 4–5 yr to bear 8 × 8 m 6.0–8.0 600–900 20–35 156 plants 10–15 t Rust, bark eating caterpillar
Fig Fruit Perennial Jun–Jul (planting) 2–3 yr to bear 5 × 5 m 6.0–7.5 600–800 20–32 400 plants 10–15 t Rust, stem borer
Date Palm Fruit Perennial Feb–Mar (planting) 5–7 yr to bear 8 × 8 m 7.0–8.5 1200–1800 25–40 156 palms 10–15 t Graphiola leaf spot, borer
Strawberry Fruit Rabi Sep–Oct 90–120 30 × 30 cm 5.5–6.5 400–600 15–25 55 k runners 10–15 t Grey mould, mite, leaf spot
Kiwi Fruit Perennial Dec–Jan (planting) 4–5 yr to bear 4 × 5 m 5.5–7.0 900–1200 10–25 500 vines 12–18 t Root rot, leaf spot
Avocado Fruit Perennial Jun–Jul (planting) 4–5 yr to bear 8 × 8 m 5.5–6.5 1000–1400 20–30 156 plants 8–12 t Anthracnose, root rot
Dragon Fruit Fruit Perennial Jun–Jul (planting) 18–24 mo to bear 3 × 3 m 5.5–7.0 600–900 20–35 1,100 posts 10–15 t Stem canker, mealybug
Almond Nut Perennial Dec–Jan (planting) 4–5 yr to bear 6 × 6 m 6.0–7.5 700–1000 10–28 270 plants 1.5–2 t Leaf blight, hairy caterpillar
Walnut Nut Perennial Dec–Jan (planting) 6–8 yr to bear 10 × 10 m 6.0–7.5 800–1200 10–25 100 plants 2–3 t Anthracnose, walnut blight
Pecan Nut Perennial Dec–Jan (planting) 6–8 yr to bear 10 × 10 m 6.0–7.0 900–1300 15–30 100 plants 1.5–2.5 t Scab, aphid, shuck decline
Pistachio Nut Perennial Jan–Feb (planting) 6–8 yr to bear 6 × 6 m 7.0–8.0 600–900 15–35 270 plants 1.5–2 t Alternaria blight, twig borer
Hazelnut Nut Perennial Dec–Jan (planting) 4–5 yr to bear 5 × 5 m 6.0–7.0 700–1000 10–24 400 plants 1.5–2 t Blight, filbert weevil
Turmeric Spice Kharif May–Jun 240–270 30 × 20 cm 5.5–7.5 1200–1500 20–30 2–2.5 t rhizome 25–30 t fresh Rhizome rot, leaf spot, shoot borer
Ginger Spice Kharif Apr–May 210–240 25 × 20 cm 5.5–6.5 1300–1800 20–30 1.5–2 t rhizome 15–20 t fresh Soft rot, bacterial wilt
Coriander Spice Rabi Oct–Nov 90–110 30 × 15 cm 6.0–8.0 250–400 15–25 10–15 kg 1–1.5 t Powdery mildew, aphid, wilt
Cumin Spice Rabi Nov–Dec 100–120 30 × 10 cm 6.8–8.3 250–350 15–25 12–15 kg 0.6–0.8 t Wilt, blight, aphid
Fennel Spice Rabi Oct–Nov 140–160 45 × 20 cm 6.5–8.0 350–500 15–25 8–10 kg 1.5–2 t Aphid, blight, wilt
Fenugreek (Seed) Spice Rabi Oct–Nov 120–140 25 × 10 cm 6.0–7.5 250–400 15–25 20–25 kg 1.2–1.8 t Powdery mildew, root rot
Garlic Spice Rabi Oct–Nov 130–160 15 × 10 cm 6.0–7.0 350–500 12–24 500–600 kg cloves 8–12 t Thrips, purple blotch, basal rot
Black Pepper Spice Perennial Jun–Jul (planting) 3–4 yr to bear 3 × 3 m 5.5–6.5 2000–3000 20–32 1,100 vines 2–3 t dry Quick wilt, pollu beetle
Cardamom (Small) Spice Perennial Jun–Jul (planting) 2–3 yr to bear 2 × 2 m 5.0–6.5 1500–2500 15–28 2,500 plants 150–250 kg dry Katte virus, thrips, rot
Cardamom (Large) Spice Perennial Jun–Jul (planting) 3 yr to bear 1.5 × 1.5 m 5.0–6.5 2000–3000 10–25 4,400 plants 200–300 kg dry Chirke, foorkey virus
Clove Spice Perennial Jun–Jul (planting) 6–8 yr to bear 6 × 6 m 5.5–7.0 1500–2500 20–30 270 plants 1–2 kg/tree Leaf rot, seedling wilt
Cinnamon Spice Perennial Jun–Jul (planting) 3–4 yr to harvest 2 × 2 m 5.0–7.0 1500–2500 20–30 2,500 plants 150–200 kg quill Leaf spot, stripe canker
Nutmeg Spice Perennial Jun–Jul (planting) 6–8 yr to bear 8 × 8 m 5.5–7.0 1500–2500 20–32 156 plants 500–1000 fruits/tree Fruit rot, die-back
Ajwain Spice Rabi Oct–Nov 140–160 45 × 20 cm 6.5–8.0 250–400 15–25 3–4 kg 0.8–1.2 t Powdery mildew, aphid
Dill Spice Rabi Oct–Nov 110–130 30 × 15 cm 6.0–7.5 250–400 15–25 8–10 kg 0.8–1 t Aphid, powdery mildew
Tamarind Spice Perennial Jun–Jul (planting) 6–8 yr to bear 10 × 10 m 6.0–8.0 700–1000 22–35 100 plants 150–200 kg/tree Fruit borer, scale
Vanilla Spice Perennial Jun–Jul (planting) 3 yr to bear 2 × 1.5 m 6.0–7.0 1500–2500 21–32 1,600 vines 300–500 kg green Bean rot, stem rot
Marigold Flower Year-round Jun, Sep, Jan 60–90 45 × 30 cm 6.0–7.5 350–500 18–30 1–1.5 kg 15–20 t Leaf spot, thrips, red spider mite
Rose Flower Perennial Sep–Oct (planting) 90–120 to flower 60 × 45 cm 6.0–7.0 600–900 15–28 37 k plants 8–10 lakh blooms Black spot, powdery mildew, thrips
Jasmine Flower Perennial Jun–Jul (planting) 1–2 yr to bear 1.5 × 1.5 m 6.5–7.5 700–1000 20–32 4,400 plants 8–12 t Bud worm, leaf webber, gall mite
Chrysanthemum Flower Rabi Jun–Jul 110–130 30 × 30 cm 6.0–7.0 400–600 15–25 1.1 lakh cuttings 15–20 t Leaf spot, aphid, thrips
Tuberose Flower Kharif Mar–Apr 90–120 30 × 20 cm 6.5–7.5 500–700 20–30 2–2.5 lakh bulbs 15–20 t spikes Aphid, thrips, stem rot
Gladiolus Flower Rabi Sep–Nov 90–120 30 × 20 cm 6.0–7.0 400–600 15–25 2–2.5 lakh corms 2–2.5 lakh spikes Fusarium wilt, thrips
Gerbera Flower Protected Year-round 90–100 to flower 30 × 30 cm 5.5–6.5 Drip fertigation 18–26 60 k plants 200–250 stems/m² Powdery mildew, whitefly, mite
Carnation Flower Protected Year-round 120–150 to flower 15 × 15 cm 6.0–7.0 Drip fertigation 13–22 2.5 lakh plants 250–300 stems/m² Fusarium wilt, thrips, mite
Orchid Flower Protected Year-round 18–24 mo to bear 30 × 30 cm 5.5–6.5 Misting 20–30 40 k plants 4–6 spikes/plant Black rot, scale, thrips
Anthurium Flower Protected Year-round 12–18 mo to bear 30 × 30 cm 5.5–6.5 Misting 18–28 60 k plants 6–8 blooms/plant Bacterial blight, mite
Aloe Vera Medicinal Perennial Jun–Jul 240–300 60 × 45 cm 6.0–8.0 400–600 20–35 25 k suckers 30–40 t leaf Leaf spot, mealybug
Ashwagandha Medicinal Kharif Jun–Jul 150–180 30 × 10 cm 6.5–8.0 300–450 20–32 10–12 kg 0.6–0.8 t root Leaf spot, aphid
Tulsi (Holy Basil) Medicinal Kharif Apr–May 90–110 45 × 45 cm 6.0–7.5 400–600 20–32 300–400 g 10–12 t herb Leaf roller, powdery mildew
Lemongrass Medicinal Perennial Jun–Jul 90 per cut 60 × 45 cm 5.5–7.5 800–1200 20–32 35 k slips 15–20 t herb Leaf blight, rust
Mentha (Menthol Mint) Medicinal Zaid Jan–Feb 110–130 45 × 30 cm 6.0–7.5 600–900 20–30 400–500 kg suckers 100–150 kg oil Leaf spot, hairy caterpillar
Stevia Medicinal Perennial Feb–Mar 90 per cut 45 × 30 cm 6.0–7.5 600–900 18–30 90 k plants 3–4 t dry leaf Leaf spot, wilt
Isabgol (Psyllium) Medicinal Rabi Nov–Dec 110–130 30 × 10 cm 7.0–8.5 250–350 15–25 4–5 kg 0.8–1.2 t Downy mildew, aphid
Senna Medicinal Kharif · Rabi Jul, Oct 110–130 45 × 30 cm 7.0–8.5 250–400 20–35 15–20 kg 1–1.5 t leaf Leaf spot, pod borer
Safed Musli Medicinal Kharif Jun–Jul 180–210 30 × 20 cm 6.0–7.5 600–900 20–32 5–6 q roots 2–2.5 t fresh root Root rot, leaf spot
Vetiver (Khus) Medicinal Perennial Jun–Jul 540–600 60 × 45 cm 5.5–8.0 800–1200 20–35 35 k slips 20–25 kg oil Root borer, leaf blight
Patchouli Medicinal Perennial Jun–Jul 150 per cut 60 × 60 cm 5.5–7.0 1500–2000 22–30 28 k cuttings 40–60 kg oil Leaf blight, wilt, nematode
Berseem Fodder Rabi Oct–Nov 50 per cut Broadcast 6.5–7.5 500–700 15–25 20–25 kg 80–100 t green Root rot, stem rot
Lucerne (Alfalfa) Fodder Perennial Oct–Nov 45 per cut 30 cm rows 6.5–7.5 600–900 15–30 12–15 kg 80–100 t green Wilt, aphid
Napier (Hybrid) Fodder Perennial Jun–Jul 60 per cut 90 × 60 cm 5.5–7.5 1000–1500 25–35 20 k slips 200–250 t green Leaf blight, stem borer
Fodder Maize Fodder Kharif · Zaid Jun–Jul, Feb 60–70 30 × 15 cm 6.0–7.5 400–600 21–30 50–60 kg 40–50 t green Stem borer, leaf blight
Fodder Sorghum Fodder Kharif Jun–Jul 60–75 30 × 10 cm 6.0–7.5 350–500 25–32 35–40 kg 40–50 t green Shoot fly, anthracnose
Fodder Cowpea Fodder Kharif Jun–Jul 55–70 30 × 10 cm 5.5–7.5 300–450 25–35 35–40 kg 25–30 t green Aphid, leaf spot
Oats (Fodder) Fodder Rabi Oct–Nov 60–70 25 cm rows 5.5–7.0 350–500 15–25 80–100 kg 35–45 t green Rust, aphid

Figures are planning ranges, not prescriptions. Confirm against your local KVK or state agricultural university before committing an acre to them.

Discover more from Agriculture Novel

Subscribe now to keep reading and get access to the full archive.

Continue reading

The Contributor Studio · Agriculture Novel

Publish your knowledge.
No account. A few taps.

Pick from 757,418 ready topics or write your own. Paste anything in any format — we tidy it, you preview it, editors approve it, your name carries it.

5Contributors
13Community articles
0Points awarded