A real-time dashboard for monitoring pressure sensor data from an ESP32 device, designed to help prevent pressure injuries.
Just open the HTML file in your browser:
open public/index.htmlOr double-click public/index.html in Finder.
- Install Node.js: https://nodejs.org
- Install Firebase CLI:
npm install -g firebase-tools
- Login to Firebase:
firebase login
- Run locally:
firebase serve
- Deploy:
firebase deploy
Edit public/index.html and find the configuration section near the top of the <script>:
// DEMO MODE - Set to true to simulate fake sensor data
const DEMO_MODE = true;
// Device filter - set to your ESP32 device ID
const DEVICE_FILTER = "esp32-01";
// Pressure thresholds (adjust based on your sensor)
const PRESSURE_THRESHOLDS = {
low: 1000,
moderate: 2500
};DEMO_MODE = true— Shows simulated data (no sensor needed)DEMO_MODE = false— Shows real data from Firebase
Go to Firebase Console → Your Project → Firestore Database → Rules, and set:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}Click Publish to save.
The dashboard reads from a readings collection. Each document should have:
{
deviceId: "esp32-01", // String: device identifier
raw: 1850, // Number: raw ADC pressure value
zone: "center", // String: sensor zone (optional)
ts: Timestamp // Firestore Timestamp
}| Error | Solution |
|---|---|
| "Missing or insufficient permissions" | Update Firestore rules (see above) |
| No data showing | Check DEVICE_FILTER matches your ESP32's deviceId |
| Chart not updating | Verify ESP32 is posting to the readings collection |
├── public/
│ └── index.html # Dashboard (all-in-one HTML/CSS/JS)
├── functions/ # Firebase Cloud Functions (if needed)
├── firebase.json # Firebase configuration
└── .firebaserc # Firebase project settings
MIT