# hhari1234/smartdustbin architecture

> Architecture diagram of the GitHub repository hhari1234/smartdustbin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hhari1234/smartdustbin
- Repository: https://github.com/hhari1234/smartdustbin

## Overview

Smart Dustbin classifies webcam frames, maps detected classes to bin commands, and sends the selected ID over serial for Arduino servo actuation. The graph follows the documented primary workflow and separates classification, visual presentation, and hardware control. Source evidence is limited to the excerpted Python files and README; the Arduino sketch is present in the tree but was not sampled, so its documented behavior is shown without source-level call detail.

Main entry points: [`Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`](https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py) (Python application), [`Smartbin-System-main/Smartbin-System-main/ardino code/trial1_copy_20250217213233.ino`](https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/ardino%20code/trial1_copy_20250217213233.ino) (Arduino controller), [`Smartbin-System-main/Smartbin-System-main/Resources/Model`](https://github.com/hhari1234/smartdustbin/tree/main/Smartbin-System-main/Smartbin-System-main/Resources/Model) (Keras model and labels), [`Smartbin-System-main/Smartbin-System-main/Resources`](https://github.com/hhari1234/smartdustbin/tree/main/Smartbin-System-main/Smartbin-System-main/Resources) (Bin and display assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Vision and routing"]
  node_python_app["Python application<br/>[main.py]"]
  node_classifier["Waste classifier<br/>[main.py]"]
  node_model["Keras model and labels"]
  node_bin_mapping["Class-to-bin mapping<br/>[main.py]"]
end

subgraph group_interface["Visual interface"]
  node_visual_composer["Visual composer<br/>[main.py]"]
  node_visual_assets["Bin and display assets"]
end

subgraph group_hardware["Hardware control"]
  node_serial_link["Serial link<br/>[main.py]"]
  node_arduino["Arduino controller"]
  node_servos["Three bin servos"]
end

node_camera(("Webcam"))

node_camera -->|"provides frames"| node_python_app
node_python_app -->|"classifies frames"| node_classifier
node_classifier -->|"loads model"| node_model
node_python_app -->|"maps class ID"| node_bin_mapping
node_python_app -->|"updates display"| node_visual_composer
node_visual_composer -->|"loads overlays"| node_visual_assets
node_python_app -->|"sends bin ID"| node_serial_link
node_serial_link -->|"transmits command"| node_arduino
node_arduino -->|"actuates bin"| node_servos

click node_python_app "https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py"
click node_classifier "https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py"
click node_model "https://github.com/hhari1234/smartdustbin/tree/main/Smartbin-System-main/Smartbin-System-main/Resources/Model"
click node_bin_mapping "https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py"
click node_serial_link "https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py"
click node_arduino "https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/ardino%20code/trial1_copy_20250217213233.ino"
click node_visual_composer "https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py"
click node_visual_assets "https://github.com/hhari1234/smartdustbin/tree/main/Smartbin-System-main/Smartbin-System-main/Resources"

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_python_app,node_classifier,node_model,node_bin_mapping toneBlue
class node_visual_composer,node_visual_assets toneAmber
class node_serial_link,node_arduino,node_servos toneMint
class node_camera toneIndigo
```

## Components

### Vision and routing

- [Python application](https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py): `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`
- [Waste classifier](https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py): `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`
- [Keras model and labels](https://github.com/hhari1234/smartdustbin/tree/main/Smartbin-System-main/Smartbin-System-main/Resources/Model): `Smartbin-System-main/Smartbin-System-main/Resources/Model`
- [Class-to-bin mapping](https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py): `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`

### Visual interface

- [Visual composer](https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py): `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`
- [Bin and display assets](https://github.com/hhari1234/smartdustbin/tree/main/Smartbin-System-main/Smartbin-System-main/Resources): `Smartbin-System-main/Smartbin-System-main/Resources`

### Hardware control

- [Serial link](https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py): `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`
- [Arduino controller](https://github.com/hhari1234/smartdustbin/blob/main/Smartbin-System-main/Smartbin-System-main/ardino%20code/trial1_copy_20250217213233.ino): `Smartbin-System-main/Smartbin-System-main/ardino code/trial1_copy_20250217213233.ino`
- **Three bin servos**

### Other components

- **Webcam**

## Connections

- Webcam → Python application: provides frames (evidence: `README.md`)
- Python application → Waste classifier: classifies frames (evidence: `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`)
- Waste classifier → Keras model and labels: loads model (evidence: `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`)
- Python application → Class-to-bin mapping: maps class ID (evidence: `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`)
- Python application → Visual composer: updates display (evidence: `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`)
- Visual composer → Bin and display assets: loads overlays (evidence: `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`)
- Python application → Serial link: sends bin ID (evidence: `Smartbin-System-main/Smartbin-System-main/Resources/main_code/main.py`)
- Serial link → Arduino controller: transmits command (evidence: `README.md`)
- Arduino controller → Three bin servos: actuates bin (evidence: `README.md`)
