Skip to content

Musawir456/smart-manufacturing-iot-dashboard

Repository files navigation

๐Ÿญ Smart Manufacturing IoTโ€‘Cloud Monitoring Dashboard

Python Streamlit Pandas scikit-learn License

A smart manufacturing monitoring dashboard powered by IoT sensor data.

Real-time machine health tracking, anomaly detection, and maintenance risk analysis โ€” all in one place.


๐Ÿ“Œ Table of Contents


๐Ÿง  Overview

In modern smart factories, machines generate continuous streams of sensor data. Without proper monitoring, anomalies go unnoticed and unexpected breakdowns cost time and money. This project tackles that problem by building an interactive monitoring dashboard using historical IoT sensor data from multiple manufacturing machines.

Key highlights:

  • Live machine-wise sensor trend visualization
  • Anomaly summary across all machines
  • Recent health flag table per machine
  • Rule-based maintenance risk checker (demo)
  • Optional ML model integration (RandomForest) for predictive maintenance

๐Ÿ“ธ Dashboard Preview

Add a screenshot of your running Streamlit dashboard here.

![Dashboard Screenshot](assets/dashboard_screenshot.png)

๐Ÿ›  Tech Stack

Category Tools
Language Python 3.x
Dashboard UI Streamlit
Data Handling pandas, numpy
Visualization matplotlib
ML (Optional) scikit-learn (RandomForest)
Model Persistence pickle
Environment Jupyter Notebook, VS Code

๐Ÿ“‚ Dataset

File: smart_manufacturing_data.csv

Column Description
timestamp Date and time of the reading
machine_id Unique machine identifier
temperature Machine temperature
vibration Vibration level
humidity Ambient humidity
pressure System pressure
energy_consumption Energy usage during interval
anomaly_flag 0 = Normal, 1 = Anomaly detected
failure_type Type of failure (Normal, Overheating, Vibration Issue, Pressure Drop, etc.)
predicted_remaining_life Estimated remaining useful life
downtime_risk Continuous risk score for possible downtime
maintenance_required 0 = No maintenance, 1 = Maintenance needed

๐Ÿ—‚ Project Structure

smart-manufacturing-iot-monitoring/
โ”‚
โ”œโ”€โ”€ ๐Ÿš€ app.py                        # Streamlit dashboard (main app)
โ”œโ”€โ”€ ๐Ÿ“Š smart_manufacturing_data.csv  # IoT manufacturing dataset
โ”œโ”€โ”€ ๐Ÿ““ PROJECT.ipynb                 # Jupyter notebook for EDA & experiments
โ”œโ”€โ”€ ๐Ÿค– rf2_model.pkl                 # (Optional) Saved RandomForest model
โ”œโ”€โ”€ โš–๏ธ  scaler.pkl                   # (Optional) Saved feature scaler
โ””โ”€โ”€ ๐Ÿ“„ README.md                     # Project documentation

โœจ Features

1. ๐Ÿ“ˆ Machine-wise Sensor Monitoring

  • Sidebar lets you select any machine_id
  • Time-series line chart of temperature, vibration, and pressure
  • Quickly spot abnormal spikes, trends, and outliers

2. ๐Ÿฅ Recent Health Flags

  • Table showing the latest records for the selected machine
  • Columns: timestamp, anomaly_flag, maintenance_required, downtime_risk
  • Instant snapshot of machine health status

3. โš ๏ธ Overall Anomaly Summary

  • Aggregates anomaly counts across all machines
  • Ranked table of top machines by anomaly frequency
  • Helps maintenance teams prioritize inspections

4. ๐Ÿ”ง Simple Maintenance Risk Check (Demo)

  • Manually adjust Temperature, Vibration, and Pressure using sliders
  • Rule-based logic compares values to historical quantiles
  • Returns risk classification:
Risk Level Meaning
๐ŸŸข LOW Maintenance not urgent
๐ŸŸก MEDIUM Keep machine under observation
๐Ÿ”ด HIGH Maintenance recommended immediately

This demo logic can be replaced by the trained ML model (rf2_model.pkl) for production use.


๐Ÿš€ Getting Started

1. Clone the Repository

git clone https://github.com/Musawir456/smart-manufacturing-iot-monitoring.git
cd smart-manufacturing-iot-monitoring

2. (Optional) Create a Virtual Environment

python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Run the Streamlit Dashboard

streamlit run app.py

5. Open in Browser

http://localhost:8501

๐Ÿ”ฎ Future Improvements

  • ๐Ÿค– ML Integration โ€” Replace rule-based logic with the trained rf2_model.pkl RandomForest model for real predictions
  • ๐Ÿ“ก Real-time Streaming โ€” Connect live IoT streams via MQTT or HTTP instead of static CSV
  • ๐Ÿ” Authentication โ€” Add role-based access for operators, engineers, and managers
  • โ˜๏ธ Cloud Deployment โ€” Deploy Streamlit app to AWS / GCP / Streamlit Cloud for remote access
  • ๐Ÿ“ง Alert System โ€” Automated email/SMS alerts when HIGH risk is detected

๐Ÿ—ƒ Optional ML Artifacts

File Description
rf2_model.pkl Trained RandomForest model to predict maintenance_required from sensor data
scaler.pkl Feature scaler used during model training

These artifacts are trained and ready โ€” they can be loaded into app.py for real-time predictive maintenance with minimal code changes.


๐Ÿ–ผ๏ธ Screenshots

Dashboard

Dashboard

Upload Page

Upload

Page

Upload

Results

Results


๐Ÿ‘จโ€๐Ÿ’ป Author

Abdul Musawir BS IT / Computer Scienc AI/ML Engineer & Data Scientist ๐ŸŽ“ The Superior University, Lahore ๐Ÿ“ง abdulmusawir8191456@gmail.com

LinkedIn GitHub


โญ If you found this project useful, please give it a star! โญ

Made with โค๏ธ by Abdul Musawir โ€” The Superior University Lahore

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages