# shivabommera143/microplastic_detection architecture

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

- Interactive diagram: https://gitdiagram.com/shivabommera143/microplastic_detection
- Repository: https://github.com/shivabommera143/microplastic_detection

## Overview

This is an Arduino-based optical detector: laser light passes through a water sample, a photodiode measures transmitted intensity, and the Arduino averages readings and applies a threshold to identify possible microplastic contamination. It displays intensity on an LCD. The README documents these relationships; no source excerpts were provided, so the implementation details are not independently verified.

Main entry points: [`code/microplastic_detector.ino`](https://github.com/shivabommera143/microplastic_detection/blob/main/code/microplastic_detector.ino) (Arduino measurement)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_optical["Optical sensing"]
  node_laser["Red laser"]
  node_photodiode["Photodiode"]
end

subgraph group_processing["Embedded processing"]
  node_arduino["Arduino measurement"]
  node_averaging["50-reading average"]
  node_threshold["Contamination threshold"]
end

subgraph group_display["User display"]
  node_lcd["16x2 LCD"]
end

node_sample(("Water sample"))

node_laser -->|"transmits through"| node_sample
node_sample -->|"scatters light"| node_photodiode
node_photodiode -->|"sends intensity"| node_arduino
node_arduino -->|"averages readings"| node_averaging
node_arduino -->|"applies threshold"| node_threshold
node_arduino -->|"prints intensity"| node_lcd

click node_arduino "https://github.com/shivabommera143/microplastic_detection/blob/main/code/microplastic_detector.ino"
click node_averaging "https://github.com/shivabommera143/microplastic_detection/blob/main/code/microplastic_detector.ino"
click node_threshold "https://github.com/shivabommera143/microplastic_detection/blob/main/code/microplastic_detector.ino"

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_laser,node_photodiode toneBlue
class node_arduino,node_averaging,node_threshold toneAmber
class node_lcd toneMint
class node_sample toneIndigo
```

## Components

### Optical sensing

- **Red laser**
- **Photodiode**

### Embedded processing

- [Arduino measurement](https://github.com/shivabommera143/microplastic_detection/blob/main/code/microplastic_detector.ino): `code/microplastic_detector.ino`
- [50-reading average](https://github.com/shivabommera143/microplastic_detection/blob/main/code/microplastic_detector.ino): `code/microplastic_detector.ino`
- [Contamination threshold](https://github.com/shivabommera143/microplastic_detection/blob/main/code/microplastic_detector.ino): `code/microplastic_detector.ino`

### User display

- **16x2 LCD**

### Other components

- **Water sample**

## Connections

- Red laser → Water sample: transmits through (evidence: `README.md`)
- Water sample → Photodiode: scatters light (evidence: `README.md`)
- Photodiode → Arduino measurement: sends intensity (evidence: `README.md`)
- Arduino measurement → 50-reading average: averages readings (evidence: `README.md`)
- Arduino measurement → Contamination threshold: applies threshold (evidence: `README.md`)
- Arduino measurement → 16x2 LCD: prints intensity (evidence: `README.md`)
