Live-updating rain-sensor dashboard powered by an ESP32 + FreeRTOS back-end and a React / Vite / Tailwind front-end.
Shows current moisture %, a liquid-fill gauge, and a rolling spark-line โ refreshed every 5 s.
Check it out at: https://esp-32-web-rain-sensor.vercel.app/
Part | Notes |
---|---|
ESP32 DevKit-C | Any ESP32-WROOM / WROVER board |
MH-RD (YL-83) rain-sensor kit | Detector plate + LM393 board |
3 ร Dupont jumpers | VCC โ 3 V3 ยท GND โ GND ยท AO โ GPIO 34 |
optional Raspberry Pi / always-on PC | Runs cloudflared for a permanent public URL |
idf.py set-target esp32
idf.py menuconfig # Component โ HTTP Server โ Max header = 4096
idf.py build flash monitor
GET /api/rain โ {"rain": 83.1}
Access-Control-Allow-Origin: *
)cloudflared tunnel --url http://192.168.2.211:80
# prints e.g. https://happy-fox-abcd1234.trycloudflare.com
Use that address during prototyping.
cloudflared tunnel login # one-time auth
cloudflared tunnel create rain-tunnel
cloudflared tunnel run rain-tunnel # URL: https://<UUID>.cfargotunnel.com
npm run dev
) โ Vite proxies /api/*
to the tunnel host. VITE_API_BASE
in project settings.# .env (optional for local dev)
VITE_API_BASE=https://happy-fox-abcd1234.trycloudflare.com
cd rain-ui
npm install
npm run dev # http://localhost:8080
Push rain-ui/ to GitHub.
Vercel โ New Project โ Import Repo.
Settings โ Environment Variables
VITE_API_BASE = https://<your-tunnel>
Click Deploy โ site lives athttps://<project>.vercel.app
dark
mode)