Public
Likeplant-health-monitor
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);