# gadepall/pt100 architecture

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

- Interactive diagram: https://gitdiagram.com/gadepall/pt100
- Repository: https://github.com/gadepall/pt100

## Overview

This repository is a PT100 calibration and temperature-inference project. Its main workflow collects paired voltage and thermometer readings during natural cooling, fits and evaluates regression models, then runs temperature inference on Arduino hardware. The README documents three model families and two analog front-end options; unsampled notebook and firmware details are represented only at the documented subsystem level. The OCR source writes to `out.txt`; the README identifies a final training dataset, but the available evidence does not establish how that file is produced or consumed.

Main entry points: [`codes/models/PT100_models.ipynb`](https://github.com/gadepall/pt100/blob/main/codes/models/PT100_models.ipynb) (Model training), [`codes/arduino/datacollection/code/main.ino`](https://github.com/gadepall/pt100/blob/main/codes/arduino/datacollection/code/main.ino) (Arduino collection), [`AutoTrainer/a.py`](https://github.com/gadepall/pt100/blob/main/AutoTrainer/a.py) (OCR capture), [`tables/model_coefficients.tex`](https://github.com/gadepall/pt100/blob/main/tables/model_coefficients.tex) (Model results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_arduino_collect["Arduino collection<br/>[main.ino]"]
  node_analog_frontends["Analog front-ends"]
  node_ocr["OCR capture<br/>[a.py]"]
  node_ocr_output["OCR output"]
  node_training_data["Training data<br/>[trainingdata.txt]"]
end

subgraph group_modeling["Modeling"]
  node_model_training["Model training<br/>[PT100_models.ipynb]"]
  node_lsq["Least-squares model<br/>[lsq.py]"]
  node_model_results["Model results"]
  node_validation["Validation results<br/>[validation.tex]"]
  node_plotting["Model comparison plot<br/>[plot.py]"]
end

subgraph group_embedded["Embedded system"]
  node_inference["Temperature inference<br/>[main.ino]"]
end

node_operator(("Operator"))
node_cooling(("Cooling experiment"))
node_camera["Camera"]
node_pt100["PT100 sensor"]
node_display["LCD display"]

node_operator -->|"starts"| node_cooling
node_cooling -->|"provides readings"| node_ocr
node_camera -->|"provides frames"| node_ocr
node_ocr -->|"writes pairs"| node_ocr_output
node_cooling -->|"supplies sensor input"| node_arduino_collect
node_analog_frontends -->|"conditions voltage"| node_arduino_collect
node_arduino_collect -->|"reports readings"| node_operator
node_training_data -->|"training input"| node_model_training
node_model_training -->|"produces models"| node_model_results
node_model_training -->|"evaluates models"| node_validation
node_lsq -->|"fits coefficients"| node_model_results
node_plotting -->|"compares models"| node_model_results
node_pt100 -->|"provides voltage"| node_inference
node_inference -->|"shows temperature"| node_display

click node_arduino_collect "https://github.com/gadepall/pt100/blob/main/codes/arduino/datacollection/code/main.ino"
click node_ocr "https://github.com/gadepall/pt100/blob/main/AutoTrainer/a.py"
click node_training_data "https://github.com/gadepall/pt100/blob/main/AutoTrainer/trainingdata.txt"
click node_model_training "https://github.com/gadepall/pt100/blob/main/codes/models/PT100_models.ipynb"
click node_lsq "https://github.com/gadepall/pt100/blob/main/codes/linear_regression/lsq.py"
click node_model_results "https://github.com/gadepall/pt100/blob/main/tables/model_coefficients.tex"
click node_validation "https://github.com/gadepall/pt100/blob/main/tables/validation.tex"
click node_plotting "https://github.com/gadepall/pt100/blob/main/codes/plot/plot.py"
click node_inference "https://github.com/gadepall/pt100/blob/main/codes/arduino/inference/code/main.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_arduino_collect,node_analog_frontends,node_ocr,node_ocr_output,node_training_data toneBlue
class node_model_training,node_lsq,node_model_results,node_validation,node_plotting toneAmber
class node_inference toneMint
class node_operator,node_cooling,node_camera,node_pt100,node_display toneIndigo
```

## Components

### Data collection

- [Arduino collection](https://github.com/gadepall/pt100/blob/main/codes/arduino/datacollection/code/main.ino): `codes/arduino/datacollection/code/main.ino`
- **Analog front-ends**
- [OCR capture](https://github.com/gadepall/pt100/blob/main/AutoTrainer/a.py): `AutoTrainer/a.py`
- **OCR output**
- [Training data](https://github.com/gadepall/pt100/blob/main/AutoTrainer/trainingdata.txt): `AutoTrainer/trainingdata.txt`

### Modeling

- [Model training](https://github.com/gadepall/pt100/blob/main/codes/models/PT100_models.ipynb): `codes/models/PT100_models.ipynb`
- [Least-squares model](https://github.com/gadepall/pt100/blob/main/codes/linear_regression/lsq.py): `codes/linear_regression/lsq.py`
- [Model results](https://github.com/gadepall/pt100/blob/main/tables/model_coefficients.tex): `tables/model_coefficients.tex`
- [Validation results](https://github.com/gadepall/pt100/blob/main/tables/validation.tex): `tables/validation.tex`
- [Model comparison plot](https://github.com/gadepall/pt100/blob/main/codes/plot/plot.py): `codes/plot/plot.py`

### Embedded system

- [Temperature inference](https://github.com/gadepall/pt100/blob/main/codes/arduino/inference/code/main.ino): `codes/arduino/inference/code/main.ino`

### Other components

- **Operator**
- **Cooling experiment**
- **Camera**
- **PT100 sensor**
- **LCD display**

## Connections

- Operator → Cooling experiment: starts
- Cooling experiment → OCR capture: provides readings
- Camera → OCR capture: provides frames
- OCR capture → OCR output: writes pairs
- Cooling experiment → Arduino collection: supplies sensor input
- Analog front-ends → Arduino collection: conditions voltage
- Arduino collection → Operator: reports readings
- Training data → Model training: training input
- Model training → Model results: produces models
- Model training → Validation results: evaluates models
- Least-squares model → Model results: fits coefficients
- Model comparison plot → Model results: compares models
- PT100 sensor → Temperature inference: provides voltage
- Temperature inference → LCD display: shows temperature
