# mayanksh0311/smart-waste-segregation-system architecture

> Architecture diagram of the GitHub repository mayanksh0311/smart-waste-segregation-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mayanksh0311/smart-waste-segregation-system
- Repository: https://github.com/mayanksh0311/smart-waste-segregation-system

## Overview

This Raspberry Pi system detects an item, captures and classifies it locally, then moves servos to sort it. The README also describes Firebase-backed monitoring through a web dashboard. The main runtime is shown from its source; cloud upload and dashboard behavior are included only as documented capabilities, since their wiring is not shown in the sampled Python. Note that the checked-in model.tflite and labels.txt differ from the filenames main.py expects.

Main entry points: [`main.py`](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/main.py) (Main controller), [`model.tflite`](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/model.tflite) (TFLite model), [`labels.txt`](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/labels.txt) (Class labels), [`dashboard.html`](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/dashboard.html) (Live dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Detection and classification"]
  node_controller["Main controller<br/>[main.py]"]
  node_classifier["Image classifier<br/>[main.py]"]
  node_model["TFLite model<br/>[model.tflite]"]
  node_labels["Class labels<br/>[labels.txt]"]
end

subgraph group_sorting["Physical sorting"]
  node_sorting["Sorting sequence<br/>[main.py]"]
end

subgraph group_monitoring["IoT monitoring"]
  node_firebase[("Firebase database")]
  node_dashboard["Live dashboard<br/>[dashboard.html]"]
end

node_item(("Waste item"))
node_sensor{{"IR sensor"}}
node_camera["Pi camera"]
node_servos["Servo motors"]

node_item -->|"triggers"| node_sensor
node_sensor -->|"signals detection"| node_controller
node_controller -->|"captures image"| node_camera
node_controller -->|"requests classification"| node_classifier
node_classifier -->|"runs inference"| node_model
node_classifier -->|"resolves class"| node_labels
node_controller -->|"sorts prediction"| node_sorting
node_sorting -->|"moves"| node_servos
node_controller -.->|"uploads classification"| node_firebase
node_firebase -.->|"provides live data"| node_dashboard

click node_controller "https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/main.py"
click node_classifier "https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/main.py"
click node_model "https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/model.tflite"
click node_labels "https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/labels.txt"
click node_sorting "https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/main.py"
click node_dashboard "https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/dashboard.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controller,node_classifier,node_model,node_labels toneBlue
class node_sorting toneAmber
class node_firebase,node_dashboard toneMint
class node_item,node_sensor,node_camera,node_servos toneIndigo
```

## Components

### Detection and classification

- [Main controller](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/main.py): `main.py`
- [Image classifier](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/main.py): `main.py`
- [TFLite model](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/model.tflite): `model.tflite`
- [Class labels](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/labels.txt): `labels.txt`

### Physical sorting

- [Sorting sequence](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/main.py): `main.py`

### IoT monitoring

- **Firebase database**
- [Live dashboard](https://github.com/mayanksh0311/smart-waste-segregation-system/blob/main/dashboard.html): `dashboard.html`

### Other components

- **Waste item**
- **IR sensor**
- **Pi camera**
- **Servo motors**

## Connections

- Waste item → IR sensor: triggers (evidence: `README.md`)
- IR sensor → Main controller: signals detection (evidence: `main.py`)
- Main controller → Pi camera: captures image (evidence: `main.py`)
- Main controller → Image classifier: requests classification (evidence: `main.py`)
- Image classifier → TFLite model: runs inference (evidence: `main.py`)
- Image classifier → Class labels: resolves class (evidence: `main.py`)
- Main controller → Sorting sequence: sorts prediction (evidence: `main.py`)
- Sorting sequence → Servo motors: moves (evidence: `main.py`)
- Main controller → Firebase database: uploads classification (evidence: `README.md`)
- Firebase database → Live dashboard: provides live data (evidence: `README.md`)
