# mertwhocodes/pid-temperature-control-module-arduino architecture

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

- Interactive diagram: https://gitdiagram.com/mertwhocodes/pid-temperature-control-module-arduino
- Repository: https://github.com/mertwhocodes/pid-temperature-control-module-arduino

## Overview

This repository is an Arduino-based closed-loop AC heater controller. The documented workflow measures heater temperature with a K-type thermocouple and MAX6675, applies PID control, and triggers a triac to regulate heater power. The repository also includes Eagle hardware designs and component datasheets. No firmware excerpts were provided, so control-flow details beyond the README’s stated behavior are not verified here; edges reflect only documented relationships.

Main entry points: [`Firmware/PID/PID.ino`](https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Firmware/PID/PID.ino) (PID controller), [`Documentation/MAX6675 datasheet.pdf`](https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Documentation/MAX6675%20datasheet.pdf) (MAX6675 converter), [`Hardware/PID_heater.sch`](https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Hardware/PID_heater.sch) (BTA-16 triac)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Temperature sensing"]
  node_thermocouple["K-type thermocouple<br/>[PID_heater.sch]"]
  node_max6675["MAX6675 converter"]
end

subgraph group_firmware["Controller firmware"]
  node_pid["PID controller<br/>[PID.ino]"]
end

subgraph group_power["AC power stage"]
  node_triac["BTA-16 triac<br/>[PID_heater.sch]"]
  node_optocoupler["MOC3020 optocoupler<br/>[PID_heater.sch]"]
  node_zero_cross["Zero-cross output<br/>[PID_heater.sch]"]
end

node_heater(("AC heater"))

node_thermocouple -->|"senses temperature"| node_max6675
node_max6675 -->|"provides measurement"| node_pid
node_pid -->|"triggers via Frig"| node_triac
node_triac -->|"controls power"| node_heater
node_zero_cross -->|"signals AC zero"| node_pid

click node_thermocouple "https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Hardware/PID_heater.sch"
click node_max6675 "https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Documentation/MAX6675%20datasheet.pdf"
click node_pid "https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Firmware/PID/PID.ino"
click node_triac "https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Hardware/PID_heater.sch"
click node_optocoupler "https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Hardware/PID_heater.sch"
click node_zero_cross "https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Hardware/PID_heater.sch"

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_thermocouple,node_max6675 toneBlue
class node_pid toneAmber
class node_triac,node_optocoupler,node_zero_cross toneMint
class node_heater toneIndigo
```

## Components

### Temperature sensing

- [K-type thermocouple](https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Hardware/PID_heater.sch): `Hardware/PID_heater.sch`
- [MAX6675 converter](https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Documentation/MAX6675%20datasheet.pdf): `Documentation/MAX6675 datasheet.pdf`

### Controller firmware

- [PID controller](https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Firmware/PID/PID.ino): `Firmware/PID/PID.ino`

### AC power stage

- [BTA-16 triac](https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Hardware/PID_heater.sch): `Hardware/PID_heater.sch`
- [MOC3020 optocoupler](https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Hardware/PID_heater.sch): `Hardware/PID_heater.sch`
- [Zero-cross output](https://github.com/mertwhocodes/pid-temperature-control-module-arduino/blob/master/Hardware/PID_heater.sch): `Hardware/PID_heater.sch`

### Other components

- **AC heater**

## Connections

- K-type thermocouple → MAX6675 converter: senses temperature (evidence: `README.md`)
- MAX6675 converter → PID controller: provides measurement (evidence: `README.md`)
- PID controller → BTA-16 triac: triggers via Frig (evidence: `README.md`)
- BTA-16 triac → AC heater: controls power (evidence: `README.md`)
- Zero-cross output → PID controller: signals AC zero (evidence: `README.md`)
