A full-stack IoT-inspired smart plant health dashboard with real-time sensor monitoring, AI-based health analysis, automation controls, and trend visualization.
| Feature | Details |
|---|---|
| š Live Dashboard | Soil moisture, temperature, humidity with progress bars |
| šØ Smart Alerts | Color-coded warnings (š¢ Healthy / š” Moderate / š“ Critical) |
| š§ AI Decisions | Stress level analysis with actionable suggestions |
| āļø Automation | Auto watering & cooling fan toggle controls |
| š Trend Chart | Line graph of last 20 readings (Chart.js) |
| šļø Architecture | System diagram showing full IoT data flow |
| š” REST API | POST sensor data from real Arduino/ESP32 |
Rendering mermaid diagram...
plant-health-monitor/
āāā main.ts # HTTP entrypoint
āāā backend/
ā āāā index.ts # Hono routes
ā āāā database.ts # SQLite queries
āāā shared/
ā āāā types.ts # Types + AI health analysis
āāā frontend/
āāā index.html # HTML shell
āāā style.css # Green eco theme
āāā app.tsx # React dashboard
Returns latest sensor reading + AI health analysis + automation state.
Returns last N readings for chart rendering.
Ingest real sensor data from Arduino/ESP32:
{ "soilMoisture": 45, "temperature": 28, "humidity": 60 }
Generate a simulated sensor reading (for demo/testing).
Read or update watering/fan automation state.
| Condition | Score | Alert |
|---|---|---|
| Moisture < 20% | +3 | šØ Critical dry |
| Moisture < 40% | +1 | ā ļø Low moisture |
| Temp > 38°C | +3 | š„ Critical heat |
| Temp > 32°C | +1 | š”ļø Too warm |
| Temp < 10°C | +2 | š„¶ Too cold |
| Humidity < 30% | +1 | šØ Dry air |
| Humidity > 85% | +1 | š§ļø Fungal risk |
// Arduino / ESP32 snippet #include <WiFi.h> #include <HTTPClient.h> HTTPClient http; http.begin("https://your-val-endpoint.web.val.run/api/reading"); http.addHeader("Content-Type", "application/json"); String body = "{\"soilMoisture\":" + String(moistureVal) + ",\"temperature\":" + String(tempVal) + ",\"humidity\":" + String(humidityVal) + "}"; int code = http.POST(body);