A live safety dashboard for underground mines.
Watches gas, air quality, temperature and humidity, and raises an alert before conditions turn dangerous.
Underground mines are dangerous in ways you can't always see: a gas level creeps up, the air gets warm and thin, and by the time someone notices it's late. PitGuard is a learning project that explores how a monitoring system could catch this early, using two layers of checks: clear rules for known limits, and machine learning for readings that simply look wrong.
Sensor data in this project is simulated. PitGuard is a portfolio project, not a certified safety system.
- Tracks gas, air quality, temperature and humidity for each mine zone in real time.
- Classifies every reading with rule-based risk logic.
- Flags unusual patterns with an Isolation Forest anomaly detector, even when no single threshold is crossed.
- Raises alerts and keeps a history of them.
- Has user accounts, plus a cinematic drilling animation with sound on the login page.
- Rules first.
risk_logic.pycompares each reading against safe limits and labels it by risk level. - Then anomaly detection. I used Isolation Forest, an unsupervised model, rather than a supervised classifier. The only labels I could have trained on were the ones my own rules produce, so a supervised model would just have copied the rules. Isolation Forest finds readings that don't look like normal data without needing labels.
I designed the MySQL schema by hand:
| Table | Holds |
|---|---|
zones |
The mine areas being monitored |
workers |
People assigned to zones |
sensor_readings |
Every reading, per zone and time |
alerts |
Alerts raised from risk logic or anomaly detection |
users |
Dashboard accounts |
| Layer | Tools |
|---|---|
| Backend | Python, Flask, Flask-SQLAlchemy |
| Database | MySQL (Aiven, managed) |
| ML | scikit-learn (Isolation Forest) |
| Frontend | HTML, Tailwind CSS, vanilla JavaScript |
| Hosting | Render |
git clone <YOUR-REPO-LINK>
cd <repo-folder>
pip install -r requirements.txtCreate a MySQL database, set your connection details as environment variables (see the config file), then:
flask run- Sensor data is simulated.
- The app is hosted on free tiers, so the first load can be slow while the server wakes up.
Yashmit Katekar, as a solo project to learn Flask, MySQL and applied ML.