Public
Smart Plant Health Monitoring System - IoT Dashboard
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
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 |
- Score 0 β Healthy π’
- Score 1β2 β Moderate π‘
- Score 3+ β Critical π΄
// 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);