Monday, 20 July 2026

AI-Based Smart Poultry Farm Monitoring System

Yes. Below is the same complete Smart Poultry Farm project documentation converted into PHP file format. You can save the content below as: poultry_farm_documentation.php Each line is valid PHP output syntax. "; ""; ""; ""; ""; "AI-Based Smart Poultry Farm Monitoring System"; ""; ""; ""; "
"; "

🐔 AI-Based Smart Poultry Farm Monitoring System

"; "

ESP32 + AI Agent + n8n + Telegram + Google Sheets + ThingSpeak + PHP Dashboard

"; "

Agentic IoT Poultry Farm Monitoring and Automation Platform

"; "
"; "
"; "

1. Full Project Description

"; "

"; "The AI-Based Smart Poultry Farm Monitoring System is an advanced IoT and Artificial Intelligence based solution designed to monitor and automate poultry farm environmental conditions."; "

"; "

"; "The system uses an ESP32 microcontroller to collect real-time data from temperature, humidity, gas, light, water-level, feed-level, motion and power sensors."; "

"; "

"; "The ESP32 sends the collected sensor data through Wi-Fi to an n8n automation platform. The n8n workflow analyzes the data, communicates with an AI Agent, stores information in Google Sheets, updates ThingSpeak cloud dashboards and sends Telegram text and voice alerts."; "

"; "

"; "The system can automatically control poultry farm fans, lighting systems, water pumps and other actuators."; "

"; "
"; "
"; "

2. Main Objectives

"; "
    "; "
  • Monitor poultry farm temperature.
  • "; "
  • Monitor poultry farm humidity.
  • "; "
  • Detect harmful gases and ammonia.
  • "; "
  • Monitor lighting conditions.
  • "; "
  • Monitor water tank level.
  • "; "
  • Monitor poultry feed level.
  • "; "
  • Detect poultry movement.
  • "; "
  • Monitor electrical power consumption.
  • "; "
  • Automatically control ventilation fans.
  • "; "
  • Automatically control poultry lighting.
  • "; "
  • Automatically control water pumps.
  • "; "
  • Use AI for farm condition analysis.
  • "; "
  • Predict future power consumption.
  • "; "
  • Send Telegram text notifications.
  • "; "
  • Send Telegram voice notifications.
  • "; "
  • Store data in Google Sheets.
  • "; "
  • Display data using ThingSpeak.
  • "; "
  • Provide a PHP and MySQL web dashboard.
  • "; "
"; "
"; "
"; "

3. System Architecture

"; "
";

  "
                    POULTRY FARM
                         |
                         v
              +----------------------+
              |      IoT SENSORS     |
              |----------------------|
              | Temperature          |
              | Humidity             |
              | Gas / Ammonia        |
              | Light                |
              | Water Level          |
              | Feed Level           |
              | Motion               |
              | Power Consumption    |
              +----------+-----------+
                         |
                         v
              +----------------------+
              |        ESP32         |
              |----------------------|
              | Sensor Collection    |
              | Local Automation     |
              | Relay Control        |
              | Wi-Fi Communication  |
              +----------+-----------+
                         |
                         v
                    INTERNET
                         |
                         v
              +----------------------+
              |        n8n            |
              |----------------------|
              | Webhook              |
              | Data Processing      |
              | AI Agent             |
              | Alert Automation     |
              | Google Sheets        |
              | Telegram             |
              | ThingSpeak           |
              +----------+-----------+
                         |
          +--------------+---------------+
          |                              |
          v                              v
   +--------------+               +-------------+
   | AI AGENT     |               | TELEGRAM    |
   | Farm Analysis|               | Text Alert  |
   | Prediction   |               | Voice Alert |
   +--------------+               +-------------+
          |
          v
   +----------------------+
   | Cloud Dashboard      |
   | Google Sheets        |
   | ThingSpeak           |
   | PHP / MySQL Website  |
   +----------------------+
";

  "
"; "
"; "
"; "

4. Components List

"; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; "
ComponentPurpose
ESP32 DevKitMain IoT controller
DHT22Temperature and humidity monitoring
MQ-135 / MQ-137Gas and ammonia detection
LDRLight intensity measurement
HC-SR04 / JSN-SR04TWater and feed level measurement
PIR SensorMotion detection
PZEM-004T / ACS712Power consumption monitoring
Relay ModuleFan, light and pump control
BuzzerLocal emergency warning
Wi-Fi RouterInternet connectivity
"; "
"; "
"; "

5. Circuit Schematic Diagram

"; "
";

  "
                         +-------------------+
                         |       ESP32       |
                         |                   |
       DHT22 DATA ------| GPIO 4            |
                         |                   |
       MQ-135 AO -------| GPIO 34           |
                         |                   |
       LDR AO ----------| GPIO 35           |
                         |                   |
       Water TRIG ------| GPIO 5            |
       Water   ------| GPIO 18           |
                         |                   |
       Feed TRIG -------| GPIO 19           |
       Feed   -------| GPIO 21           |
                         |                   |
       PIR OUT ---------| GPIO 27           |
                         |                   |
       Fan Relay <------| GPIO 25           |
       Light Relay <----| GPIO 26           |
       Pump Relay <-----| GPIO 33           |
                         |                   |
       Buzzer <----------| GPIO 14           |
                         +---------+---------+
                                   |
                                   | Wi-Fi
                                   v
                             +-----------+
                             | INTERNET  |
                             +-----+-----+
                                   |
                                   v
                             +-----------+
                             |    n8n    |
                             +-----+-----+
                                   |
                   +---------------+---------------+
                   |                               |
                   v                               v
             +-----------+                   +-----------+
             | AI AGENT  |                   | TELEGRAM  |
             +-----------+                   +-----------+
";

  "
"; "
"; "Safety Note: AC mains powered fans, pumps and lights must use proper electrical isolation, fuses, enclosures and qualified electrical installation procedures."; "
"; "
"; "
"; "

6. ESP32 Pin Configuration

"; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; "
DeviceESP32 Pin
DHT22 DataGPIO 4
Gas Sensor AnalogGPIO 34
LDRGPIO 35
Water Ultrasonic TriggerGPIO 5
Water Ultrasonic GPIO 18
Feed Ultrasonic TriggerGPIO 19
Feed Ultrasonic GPIO 21
PIR SensorGPIO 27
Fan RelayGPIO 25
Light RelayGPIO 26
Pump RelayGPIO 33
BuzzerGPIO 14
"; "
"; "
"; "

7. Complete ESP32 Source Code

"; "
";

  htmlspecialchars('
#include 
#include 
#include 
#include "DHT.h"

#define DHTPIN 4
#define DHTTYPE DHT22

#define GAS_PIN 34
#define LDR_PIN 35

#define WATER_TRIG 5
#define WATER_  18

#define FEED_TRIG 19
#define FEED_  21

#define PIR_PIN 27

#define FAN_RELAY 25
#define LIGHT_RELAY 26
#define PUMP_RELAY 33

#define BUZZER_PIN 14

const char* WIFI_SSID = "YOUR_WIFI_NAME";
const char* WIFI_PASSWORD = "YOUR_WIFI_PASSWORD";

const char* N8N_WEBHOOK =
"https://YOUR_N8N_DOMAIN/webhook/poultry-data";

DHT dht(DHTPIN, DHTTYPE);

float temperature;
float humidity;

int gasValue;
int lightValue;

long waterDistance;
long feedDistance;

int motionStatus;

bool fanStatus = false;
bool lightStatus = false;
bool pumpStatus = false;

long readUltrasonic(int trigPin, int  Pin)
{
    digitalWrite(trigPin, LOW);

    delayMicroseconds(2);

    digitalWrite(trigPin, HIGH);

    delayMicroseconds(10);

    digitalWrite(trigPin, LOW);

    long duration =
    pulseIn( Pin, HIGH, 30000);

    long distance =
    duration * 0.034 / 2;

    return distance;
}

void connectWiFi()
{
    Serial.print("Connecting to WiFi");

    WiFi.begin(
        WIFI_SSID,
        WIFI_PASSWORD
    );

    while (
        WiFi.status()
        != WL_CONNECTED
    )
    {
        delay(500);

        Serial.print(".");
    }

    Serial.println();

    Serial.println(
        "WiFi Connected"
    );

    Serial.println(
        WiFi.localIP()
    );
}

void readSensors()
{
    temperature =
    dht.readTemperature();

    humidity =
    dht.readHumidity();

    gasValue =
    analogRead(GAS_PIN);

    lightValue =
    analogRead(LDR_PIN);

    waterDistance =
    readUltrasonic(
        WATER_TRIG,
        WATER_ 
    );

    feedDistance =
    readUltrasonic(
        FEED_TRIG,
        FEED_ 
    );

    motionStatus =
    digitalRead(PIR_PIN);
}

void localControl()
{
    if (
        temperature > 30
        ||
        gasValue > 1800
    )
    {
        digitalWrite(
            FAN_RELAY,
            LOW
        );

        fanStatus =
        true;
    }
    else
    {
        digitalWrite(
            FAN_RELAY,
            HIGH
        );

        fanStatus =
        false;
    }

    if (
        lightValue < 1000
    )
    {
        digitalWrite(
            LIGHT_RELAY,
            LOW
        );

        lightStatus =
        true;
    }
    else
    {
        digitalWrite(
            LIGHT_RELAY,
            HIGH
        );

        lightStatus =
        false;
    }

    if (
        waterDistance > 30
    )
    {
        digitalWrite(
            PUMP_RELAY,
            LOW
        );

        pumpStatus =
        true;
    }
    else
    {
        digitalWrite(
            PUMP_RELAY,
            HIGH
        );

        pumpStatus =
        false;
    }

    if (
        gasValue > 2500
    )
    {
        digitalWrite(
            BUZZER_PIN,
            HIGH
        );
    }
    else
    {
        digitalWrite(
            BUZZER_PIN,
            LOW
        );
    }
}

void sendDataToN8N()
{
    if (
        WiFi.status()
        != WL_CONNECTED
    )
    {
        connectWiFi();
    }

    HTTPClient http;

    http.begin(
        N8N_WEBHOOK
    );

    http.addHeader(
        "Content-Type",
        "application/json"
    );

    StaticJsonDocument<1024>
    doc;

    doc["device_id"] =
    "POULTRY_ESP32_001";

    doc["temperature"] =
    temperature;

    doc["humidity"] =
    humidity;

    doc["gas_value"] =
    gasValue;

    doc["light_value"] =
    lightValue;

    doc["water_distance"] =
    waterDistance;

    doc["feed_distance"] =
    feedDistance;

    doc["motion"] =
    motionStatus;

    doc["fan"] =
    fanStatus;

    doc["light"] =
    lightStatus;

    doc["pump"] =
    pumpStatus;

    doc["timestamp"] =
    millis();

    String jsonData;

    serializeJson(
        doc,
        jsonData
    );

    int responseCode =
    http.POST(
        jsonData
    );

    Serial.print(
        "n8n Response: "
    );

    Serial.println(
        responseCode
    );

    http.end();
}

void setup()
{
    Serial.begin(
        115200
    );

    pinMode(
        WATER_TRIG,
        OUTPUT
    );

    pinMode(
        WATER_ ,
        INPUT
    );

    pinMode(
        FEED_TRIG,
        OUTPUT
    );

    pinMode(
        FEED_ ,
        INPUT
    );

    pinMode(
        PIR_PIN,
        INPUT
    );

    pinMode(
        FAN_RELAY,
        OUTPUT
    );

    pinMode(
        LIGHT_RELAY,
        OUTPUT
    );

    pinMode(
        PUMP_RELAY,
        OUTPUT
    );

    pinMode(
        BUZZER_PIN,
        OUTPUT
    );

    digitalWrite(
        FAN_RELAY,
        HIGH
    );

    digitalWrite(
        LIGHT_RELAY,
        HIGH
    );

    digitalWrite(
        PUMP_RELAY,
        HIGH
    );

    dht.begin();

    connectWiFi();
}

void loop()
{
    readSensors();

    localControl();

    sendDataToN8N();

    delay(
        60000
    );
}
', ENT_QUOTES);

  "
"; "
"; "
"; "

8. ESP32 JSON Data Format

"; "
";

  htmlspecialchars('{
    "device_id": "POULTRY_ESP32_001",
    "temperature": 32.5,
    "humidity": 75.4,
    "gas_value": 2100,
    "light_value": 850,
    "water_distance": 42,
    "feed_distance": 15,
    "motion": 1,
    "fan": true,
    "light": true,
    "pump": true,
    "timestamp": 123456
}', ENT_QUOTES);

  "
"; "
"; "
"; "

9. Complete System Flowchart

"; "
";

  "
START
  |
  v
ESP32 POWER ON
  |
  v
CONNECT TO Wi-Fi
  |
  +---- FAILED ----> RETRY
  |
  v
READ ALL SENSORS
  |
  +---- Temperature
  +---- Humidity
  +---- Gas
  +---- Light
  +---- Water
  +---- Feed
  +---- Motion
  +---- Power
  |
  v
LOCAL CONTROL
  |
  +---- Temperature HIGH --> FAN ON
  |
  +---- Gas HIGH ---------> FAN ON
  |
  +---- Water LOW --------> PUMP ON
  |
  +---- Light LOW --------> LIGHT ON
  |
  v
SEND JSON TO n8n
  |
  v
n8n WEBHOOK
  |
  v
AI AGENT ANALYSIS
  |
  +---- NORMAL
  |
  +---- WARNING
  |
  +---- CRITICAL
  |
  v
SAVE DATA
  |
  +---- Google Sheets
  +---- ThingSpeak
  +---- MySQL
  |
  v
SEND ALERT
  |
  +---- Telegram Text
  |
  +---- Telegram Voice
  |
  v
REPEAT
";

  "
"; "
"; "
"; "

10. n8n Automation Workflow

"; "
";

  "
ESP32
  |
  v
WEBHOOK
  |
  v
DATA VALIDATION
  |
  v
AI AGENT
  |
  v
RISK ANALYSIS
  |
  +---- NORMAL ------> Google Sheets
  |
  +---- WARNING -----> Telegram Message
  |
  +---- CRITICAL ----> Telegram Text
                         |
                         v
                    Voice Alert
                         |
                         v
                    Google Sheets
                         |
                         v
                    ThingSpeak
";

  "
"; "
"; "
"; "

11. n8n Workflow JSON

"; "
";

  htmlspecialchars('{
  "name": "AI Poultry Farm Monitoring",

  "nodes": [

    {
      "parameters": {
        "httpMethod": "POST",
        "path": "poultry-data",
        "responseMode": "onReceived"
      },

      "name": "ESP32 Webhook",

      "type": "n8n-nodes-base.webhook",

      "typeVersion": 2
    },

    {
      "parameters": {

        "jsCode":

        "const data = $json.body || $json;\\n\\nlet risk = \\'NORMAL\\';\\nlet message = \\'Poultry farm conditions are normal.\\';\\n\\nif (data.temperature > 35) {\\n risk = \\'CRITICAL\\';\\n message = \\'Critical temperature detected.\\';\\n}\\n\\nif (data.gas_value > 2500) {\\n risk = \\'CRITICAL\\';\\n message = \\'Critical harmful gas level detected.\\';\\n}\\n\\nif (data.water_distance > 40) {\\n risk = \\'WARNING\\';\\n message = \\'Water level is low.\\';\\n}\\n\\nreturn [{ json: { ...data, risk_level: risk, ai_message: message } }];"

      },

      "name": "Farm Risk Analysis",

      "type": "n8n-nodes-base.code"

    },

    {

      "parameters": {

        "chatId": "YOUR_TELEGRAM_CHAT_ID",

        "text": "POULTRY FARM ALERT"

      },

      "name": "Telegram Alert",

      "type": "n8n-nodes-base.telegram"

    }

  ]

}', ENT_QUOTES);

  "
"; "
"; "
"; "

12. Telegram Bot Setup

"; "
    "; "
  1. Open Telegram.
  2. "; "
  3. Search for BotFather.
  4. "; "
  5. Send /newbot.
  6. "; "
  7. Enter the poultry farm bot name.
  8. "; "
  9. Copy the generated BOT TOKEN.
  10. "; "
  11. Create Telegram credentials in n8n.
  12. "; "
  13. Send a message to your bot.
  14. "; "
  15. Find your Telegram Chat ID.
  16. "; "
  17. Configure the Telegram node.
  18. "; "
"; "

Example Telegram Alert

"; "
";

  "🚨 POULTRY FARM CRITICAL ALERT 🚨

Temperature: 38 °C

Humidity: 82 %

Gas Level: HIGH

Fan: ACTIVATED

Please inspect the poultry farm immediately.";

  "
"; "
"; "
"; "

13. Telegram Voice Notification Workflow

"; "
";

  "
CRITICAL SENSOR DATA
        |
        v
      n8n
        |
        v
    AI AGENT
        |
        v
GENERATE ALERT TEXT
        |
        v
TEXT-TO-SPEECH
        |
        v
AUDIO FILE
        |
        v
TELEGRAM VOICE MESSAGE
        |
        v
FARMER MOBILE PHONE
";

  "
"; "
"; "
"; "

14. Google Sheets Integration

"; "

Create a Google Sheet with the following columns:

"; "
";

  "
Timestamp
Device ID
Temperature
Humidity
Gas Level
Light Level
Water Level
Feed Level
Motion
Fan Status
Light Status
Pump Status
Power Consumption
Risk Level
AI Recommendation
";

  "
"; "
"; "
"; "

15. ThingSpeak Dashboard Configuration

"; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; "
FieldData
Field 1Temperature
Field 2Humidity
Field 3Gas Level
Field 4Light Intensity
Field 5Water Level
Field 6Feed Level
Field 7Motion
Field 8Power Consumption
"; "
"; "
"; "

16. AI Farm Risk Classification

"; "
";

  "
IF temperature > 35
    RISK = CRITICAL

IF gas > 2500
    RISK = CRITICAL

IF humidity > 85
    RISK = WARNING

IF water_level < 25
    RISK = WARNING

IF feed_level < 20
    RISK = WARNING

IF motion = 0 FOR LONG TIME
    RISK = WARNING
";

  "
"; ""; ""; ""; ""; ""; ""; "
Risk ScoreCondition
0 - 2NORMAL
3 - 5WARNING
6 - 8HIGH
9+CRITICAL
"; "
"; "
"; "

17. AI Power Consumption Prediction

"; "

"; "The system records power consumption together with temperature, fan runtime, pump runtime and lighting operation."; "

"; "
";

  "
Temperature Increases
        |
        v
Fan Runtime Increases
        |
        v
Power Consumption Increases
        |
        v
AI Predicts Future Power Usage
";

  "
"; "

Example Prediction

"; "

"; "Current temperature is 34 degrees Celsius."; "

"; "

"; "Fan runtime is 70 percent."; "

"; "

"; "Current power consumption is 550 watts."; "

"; "

"; "AI Prediction: Expected power consumption may increase to approximately 650 watts if temperature continues to rise."; "

"; "
"; "
"; "

18. PHP Web Dashboard

"; "
";

  "
+--------------------------------------+
|       AI POULTRY FARM DASHBOARD      |
+--------------------------------------+
| Temperature       32.5 °C            |
| Humidity          72 %               |
| Gas Level         NORMAL             |
| Water Level       65 %               |
| Feed Level        80 %               |
| Power             480 W              |
+--------------------------------------+
| FAN               ON                 |
| LIGHT             OFF                |
| WATER PUMP        ON                 |
+--------------------------------------+
| AI STATUS: WARNING                    |
+--------------------------------------+
";

  "
"; "
"; "
"; "

19. PHP Project Folder Structure

"; "
";

  "
poultry-farm/
|
|-- index.php
|
|-- dashboard.php
|
|-- config.php
|
|-- database.php
|
|-- api/
|   |-- sensor_data.php
|   |-- latest_data.php
|   |-- device_control.php
|
|-- ai/
|   |-- ai_analysis.php
|   |-- power_prediction.php
|
|-- assets/
|   |-- css/
|   |-- js/
|
|-- database/
|   |-- poultry.sql
|
|-- n8n/
|   |-- workflow.json
|
|-- documentation/
|   |-- poultry_farm_documentation.php
";

  "
"; "
"; "
"; "

20. MySQL Database

"; "
";

  htmlspecialchars("
CREATE DATABASE poultry_farm;

USE poultry_farm;

CREATE TABLE sensor_data (

    id INT AUTO_INCREMENT PRIMARY KEY,

    device_id VARCHAR(100),

    temperature FLOAT,

    humidity FLOAT,

    gas_value INT,

    light_value INT,

    water_distance FLOAT,

    feed_distance FLOAT,

    motion INT,

    fan_status BOOLEAN,

    light_status BOOLEAN,

    pump_status BOOLEAN,

    power_consumption FLOAT,

    risk_level VARCHAR(50),

    ai_message TEXT,

    created_at TIMESTAMP
    DEFAULT CURRENT_TIMESTAMP

);
", ENT_QUOTES);

  "
"; "
"; "
"; "

21. PHP Sensor Data API

"; "
";

  htmlspecialchars("
 35
    ||
    $gas > 2500
)
{
    $risk =
    'CRITICAL';
}
elseif (
    $temperature > 30
    ||
    $humidity > 80
)
{
    $risk =
    'WARNING';
}
else
{
    $risk =
    'NORMAL';
}

  json_encode(

    [

        'success' => true,

        'risk_level' =>
        $risk,

        'temperature' =>
        $temperature,

        'humidity' =>
        $humidity,

        'gas' =>
        $gas

    ]

);

?>
", ENT_QUOTES);

  "
"; "
"; "
"; "

22. Complete System Operation

"; "
";

  "
1. ESP32 starts.
        |
        v
2. ESP32 connects to Wi-Fi.
        |
        v
3. Sensors collect farm data.
        |
        v
4. ESP32 performs local control.
        |
        v
5. Sensor data becomes JSON.
        |
        v
6. JSON is sent to n8n.
        |
        v
7. n8n receives webhook data.
        |
        v
8. AI Agent analyzes farm conditions.
        |
        v
9. Risk level is calculated.
        |
        v
10. Data is saved to Google Sheets.
        |
        v
11. Data is sent to ThingSpeak.
        |
        v
12. PHP dashboard is updated.
        |
        v
13. Telegram alert is generated.
        |
        v
14. Critical condition generates voice alert.
        |
        v
15. System continues monitoring.
";

  "
"; "
"; "
"; "

23. Testing Procedure

"; "

Temperature Test

"; "

Increase the temperature reading and verify that the fan automatically turns ON.

"; "

Gas Test

"; "

Test the gas sensor using a safe test method and verify that the fan, buzzer and Telegram alert operate correctly.

"; "

Water Test

"; "

Reduce the water level and verify that the water pump activates.

"; "

Internet Failure Test

"; "

Disconnect Wi-Fi and verify that local ESP32 automation continues operating.

"; "
"; "
"; "

24. Future Enhancements

"; "
    "; "
  • AI-based poultry disease detection.
  • "; "
  • ESP32-CAM bird behavior monitoring.
  • "; "
  • Computer vision-based bird counting.
  • "; "
  • Automatic feed dispensing.
  • "; "
  • Solar-powered poultry farm system.
  • "; "
  • Predictive maintenance for fans and pumps.
  • "; "
  • Mobile Android application.
  • "; "
  • Advanced machine learning power prediction.
  • "; "
  • Cloud-based multi-farm management.
  • "; "
  • AI-based mortality detection.
  • "; "
"; "
"; "
"; "

25. Final Project Summary

"; "
"; "

"; "The AI-Based Smart Poultry Farm Monitoring System combines ESP32 IoT hardware, environmental sensors, AI analysis, n8n workflow automation, Telegram notifications, voice alerts, Google Sheets, ThingSpeak cloud monitoring and a PHP/MySQL web dashboard."; "

"; "

"; "The ESP32 performs real-time monitoring and local automation. n8n acts as the central automation engine. The AI Agent analyzes farm conditions and generates intelligent recommendations. Google Sheets stores historical information. ThingSpeak provides cloud visualization. Telegram sends text and voice alerts. The PHP and MySQL dashboard provides centralized monitoring."; "

"; "
"; "
";

  "
SENSORS
   |
   v
ESP32
   |
   v
Wi-Fi
   |
   v
n8n
   |
   v
AI AGENT
   |
   v
DECISION
   |
   +---- FAN
   |
   +---- LIGHT
   |
   +---- PUMP
   |
   +---- BUZZER
   |
   +---- TELEGRAM
   |
   +---- VOICE ALERT
   |
   +---- GOOGLE SHEETS
   |
   +---- THINGSPEAK
   |
   +---- PHP DASHBOARD
";

  "
"; "
"; "
"; "

"; "AI-Based Smart Poultry Farm Monitoring System | ESP32 + AI + n8n + Telegram + Google Sheets + ThingSpeak"; "

"; "
"; ""; ""; ?> Recommended project files For the actual working project, use separate PHP files rather than putting the entire documentation into one file: poultry-farm/ │ ├── index.php ├── dashboard.php ├── config.php ├── database.php ├── sensor_api.php ├── ai_analysis.php ├── power_prediction.php ├── telegram_alert.php ├── thingspeak.php ├── google_sheets.php │ ├── api/ │ ├── receive_sensor_data.php │ ├── get_latest_data.php │ └── control_device.php │ ├── database/ │ └── poultry.sql │ ├── n8n/ │ └── workflow.json │ └── documentation/ └── poultry_farm_documentation.php Important: The PHP file above is a documentation webpage. The ESP32 code remains Arduino/C++ code, while n8n uses JSON. A PHP application cannot directly execute ESP32 Arduino code or n8n workflow JSON; PHP acts as the web/API/dashboard layer.

No comments:

Post a Comment