Dashboard Real-time overview
Notifications
No notifications yet.
FA
🥚 Total eggs today
Loading…
🌾 Feed level (avg)
62%
Refill Hopper B
🌡 Coop temperature
Loading…
📡 System status
Loading…
Egg production — last 7 days
Loading chart…
Egg size distribution
Loading chart…
🌾 Feed hoppers
Auto
Hopper A62%
Hopper B21%
7-day hopper trend
📡 Live sensors
Live
Ultrasonic A 18.4 cm
Ultrasonic B 34.1 cm
IR Lane 1 (S) 42 OK
IR Lane 2 (M) 89 OK
IR Lane 3 (L) 76 OK
IR Lane 4 (XL) 41 OK
Ultrasonic trend (6h)
🔔 Alerts
Loading alerts…
Small (≤48g)
42
Lane 1 · IR Sensor
Medium (49–56g)
89
Lane 2 · IR Sensor
Large (57–64g)
76
Lane 3 · IR Sensor
Extra Large (≥65g)
41
Lane 4 · IR Sensor
🥚 Size breakdown
Live counts
Small
42
≤ 48g
Medium
89
49–56g
Large
76
57–64g
Extra Large
41
≥ 65g
Lane 1 (Small)42
Lane 2 (Medium)89
Lane 3 (Large)76
Lane 4 (XL)41
📊 Weekly segregation trend
📋 Segregation log (today)
#TimeLaneCategoryWeight range
108:47 AMLane 2Medium49–56g
208:32 AMLane 3Large57–64g
308:10 AMLane 1Small≤48g
407:55 AMLane 4Extra Large≥65g
Hopper A level
62%
OK
Hopper B level
21%
Low — refill
Next auto-feed
Loading...
Feeds today
of — scheduled
🌾 Hopper status
Hopper A (Ultrasonic: 18.4 cm)62%
Hopper B (Ultrasonic: 34.1 cm)21%
Motor control
Motor A (Hopper A)
Idle
Motor B (Hopper B)
Idle
⏰ Feeding schedule
--:--

Loading schedule...

Low-level threshold
Alert when level below 25%
Auto-notify farm operator Enabled
📊 Feed consumption (last 7 days)
📡 Ultrasonic sensors
Live
Ultrasonic A (Hopper A) 18.4 cm Normal
Ultrasonic B (Hopper B) 34.1 cm Low
Sampling interval 5 sec
Sensor type HC-SR04
Interface GPIO (RPi)
🔴 IR sensors (egg lanes)
Live
IR Lane 1 — Small (≤48g) 42 eggs OK
IR Lane 2 — Medium (49–56g) 89 eggs OK
IR Lane 3 — Large (57–64g) 76 eggs OK
IR Lane 4 — XL (≥65g) 41 eggs OK
Sensor type E18-D80NK / TCRT5000
Interface ESP32 → Pi (Wi-Fi)
🖥 Raspberry Pi status
IP Address192.168.1.10
CPU temp
RAM usage
Disk usage
Uptime
OS
Python version
📶 Arduino / ESP32 status
DeviceESP32 (Node 1)
ConnectionChecking…
ProtocolHTTP / Wi-Fi
IP
Last ping
Firmware
Signal strength
📈 Sensor readings over time
This week total
1,642
↑ 8% vs last week
This month total
6,890
↑ 5% vs last month
Daily average
234
eggs / day
Top category
Medium
36% of total
📊 Monthly production
📋 Daily production records
DateSmallMediumLargeXLTotalvs prev
Loading production records…
📄 Generate report
📥 Saved reports
NameDateAction
Loading saved reports…
📈 Report activity
Total saved
all time
Generated this month
vs last month
Most requested
 
Last generated
 
🗂 Reports by type
Report typeSaved countLast generated
Loading report activity…
🔍 Filter logs
📋 Activity log
Live
TimestampModuleEventValueStatus
Loading activity log…
👥 User accounts
NameRoleEmailLast loginStatusAction
Loading users…
🔑 Pending password change requests
NameEmailRequestedAction
Loading requests…
🔐 Role permissions
PermissionSystem AdministratorFarm Operator
View dashboard
View sensor data
Manual feed trigger
Modify feed schedule
Export reports
Change own password✅ (immediate)✅ (needs admin approval)
Manage users
System settings
API access
🔒 Change Password
As a Farm Operator, your password change needs approval from a System Administrator before it takes effect. You'll get a notification once it's reviewed.
Enter a new password
  • At least 8 characters
  • One uppercase letter (A–Z)
  • One lowercase letter (a–z)
  • One number (0–9)
  • One special character (!@#$%...)
🔌 Arduino / ESP32 integration
HTTP API

Your ESP32 or Arduino (with Ethernet shield) should POST sensor data to these endpoints running on the Raspberry Pi. Copy the endpoints below into your Arduino/ESP32 sketch.

POST/api/sensor/ir — Submit IR egg count per lane
POST/api/sensor/ultrasonic — Submit hopper feed level
GET/api/feeder/status — Get feeder schedule and status
GET/api/system/status — System health check
POST/api/feeder/trigger — Trigger manual feed dispense
📟 ESP32 Arduino sketch (example)
#include <WiFi.h>
#include <HTTPClient.h>

const char* ssid     = "YOUR_WIFI";
const char* password = "YOUR_PASS";
const char* piIP     = "192.168.1.10";

// IR pins (one per lane)
const int IR_LANE[4] = {34, 35, 36, 39};
int eggCount[4]      = {0, 0, 0, 0};
bool lastState[4]    = {HIGH,HIGH,HIGH,HIGH};

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) delay(500);
  for (int i = 0; i < 4; i++)
    pinMode(IR_LANE[i], INPUT);
}

void loop() {
  for (int i = 0; i < 4; i++) {
    bool state = digitalRead(IR_LANE[i]);
    if (lastState[i] == HIGH && state == LOW) {
      eggCount[i]++;
      sendCount(i+1, eggCount[i]);
    }
    lastState[i] = state;
  }
  delay(50);
}

void sendCount(int lane, int count) {
  HTTPClient http;
  String url = "http://" + String(piIP) + "/api/sensor/ir";
  http.begin(url);
  http.addHeader("Content-Type","application/json");
  String body = "{\"lane\":" + String(lane) +
                ",\"count\":" + String(count) + "}";
  http.POST(body);
  http.end();
}
🐍 Python Flask API (Raspberry Pi)
from flask import Flask, request, jsonify
import mysql.connector, datetime

app = Flask(__name__)

def db():
    return mysql.connector.connect(
        host="localhost", user="poultry",
        password="yourpassword", database="poultrydb"
    )

@app.route('/api/sensor/ir', methods=['POST'])
def ir_sensor():
    data = request.json
    lane  = data['lane']
    count = data['count']
    con = db(); cur = con.cursor()
    cur.execute(
        "INSERT INTO egg_counts (lane, count, timestamp)"
        " VALUES (%s,%s,%s)",
        (lane, count, datetime.datetime.now())
    )
    con.commit(); con.close()
    return jsonify({"status":"ok"})

@app.route('/api/sensor/ultrasonic', methods=['POST'])
def ultrasonic():
    data   = request.json
    hopper = data['hopper']   # 'A' or 'B'
    dist   = data['distance'] # cm
    con = db(); cur = con.cursor()
    cur.execute(
        "INSERT INTO feed_levels (hopper, distance_cm, timestamp)"
        " VALUES (%s,%s,%s)",
        (hopper, dist, datetime.datetime.now())
    )
    con.commit(); con.close()
    return jsonify({"status":"ok"})

@app.route('/api/system/status', methods=['GET'])
def status():
    return jsonify({"status":"online","uptime":"14h22m"})

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80, debug=False)
🗄 MySQL database schema
CREATE DATABASE IF NOT EXISTS poultrydb;
USE poultrydb;

CREATE TABLE egg_counts (
  id         INT AUTO_INCREMENT PRIMARY KEY,
  lane       TINYINT NOT NULL,          -- 1=Small 2=Medium 3=Large 4=XL
  count      INT     NOT NULL,
  timestamp  DATETIME DEFAULT NOW()
);

CREATE TABLE feed_levels (
  id          INT AUTO_INCREMENT PRIMARY KEY,
  hopper      CHAR(1) NOT NULL,          -- 'A' or 'B'
  distance_cm FLOAT   NOT NULL,          -- ultrasonic reading
  level_pct   FLOAT,                     -- computed percentage
  timestamp   DATETIME DEFAULT NOW()
);

CREATE TABLE feeder_events (
  id         INT AUTO_INCREMENT PRIMARY KEY,
  hopper     CHAR(1) NOT NULL,
  duration_s INT     NOT NULL,           -- seconds motor ran
  trigger    ENUM('auto','manual') DEFAULT 'auto',
  timestamp  DATETIME DEFAULT NOW()
);

CREATE TABLE system_logs (
  id        INT AUTO_INCREMENT PRIMARY KEY,
  module    VARCHAR(50),
  event     VARCHAR(255),
  value     VARCHAR(100),
  status    ENUM('ok','warning','error') DEFAULT 'ok',
  timestamp DATETIME DEFAULT NOW()
);

CREATE TABLE users (
  id           INT AUTO_INCREMENT PRIMARY KEY,
  name         VARCHAR(100),
  email        VARCHAR(100) UNIQUE,
  password     VARCHAR(255),              -- bcrypt hashed
  role         ENUM('admin','operator') DEFAULT 'operator',
  created_at   DATETIME DEFAULT NOW()
);
FA
Farm Admin
Farm Operator