Skip to content
Katekar3Public

About

Real-time safety monitoring dashboard for underground mines. Tracks gas, air quality, temperature and humidity, with rule-based risk levels and Isolation Forest anomaly detection. Flask, MySQL, Tailwind.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PitGuard

A live safety dashboard for underground mines.
Watches gas, air quality, temperature and humidity, and raises an alert before conditions turn dangerous.

Python Flask MySQL scikit-learn Tailwind

Live demo


Why this exists

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.

What it does

  • 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.

How the risk detection works

  1. Rules first. risk_logic.py compares each reading against safe limits and labels it by risk level.
  2. 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.

Database

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

Tech stack

Layer Tools
Backend Python, Flask, Flask-SQLAlchemy
Database MySQL (Aiven, managed)
ML scikit-learn (Isolation Forest)
Frontend HTML, Tailwind CSS, vanilla JavaScript
Hosting Render

Run it locally

git clone <YOUR-REPO-LINK>
cd <repo-folder>
pip install -r requirements.txt

Create a MySQL database, set your connection details as environment variables (see the config file), then:

flask run

Known limitations

  • Sensor data is simulated.
  • The app is hosted on free tiers, so the first load can be slow while the server wakes up.

Built by

Yashmit Katekar, as a solo project to learn Flask, MySQL and applied ML.

About

Real-time safety monitoring dashboard for underground mines. Tracks gas, air quality, temperature and humidity, with rule-based risk levels and Isolation Forest anomaly detection. Flask, MySQL, Tailwind.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages