# techhane/pc-stat-monitor-esp32 architecture

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

- Interactive diagram: https://gitdiagram.com/techhane/pc-stat-monitor-esp32
- Repository: https://github.com/techhane/pc-stat-monitor-esp32

## Overview

TechHane PC Status Monitor bridges Libre Hardware Monitor data to an ESP32-driven TFT: the Python process fetches sensor data, selects and formats CPU, GPU, memory, and network metrics into a packet, then sends it over serial for display. The README also documents hidden startup automation and the display pin configuration. Firmware behavior and startup-script internals were not sampled, so those links reflect README descriptions only.

Main entry points: [`kasa_monitor.py`](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py) (Monitor Loop), [`Kasa_MonitorV3.ino`](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/Kasa_MonitorV3.ino) (ESP32 Firmware), [`ESP32-ILI9341-Body.stl`](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/ESP32-ILI9341-Body.stl) (Monitor Body), [`baslat_gizli.vbs`](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/baslat_gizli.vbs) (Hidden Launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pc_data["PC Data"]
  node_lhm["Libre Hardware Monitor"]
end

subgraph group_bridge["Data Bridge"]
  node_python_loop["Monitor Loop<br/>[kasa_monitor.py]"]
  node_sensor_lookup["Sensor Lookup<br/>[kasa_monitor.py]"]
  node_value_format["Value Formatting<br/>[kasa_monitor.py]"]
  node_packet["Packet Assembly<br/>[kasa_monitor.py]"]
  node_serial["Serial Connection<br/>[kasa_monitor.py]"]
end

subgraph group_display["Display Hardware"]
  node_esp32["ESP32 Firmware<br/>[Kasa_MonitorV3.ino]"]
  node_display_config["TFT Pin Setup<br/>[User_Setup.h]"]
  node_tft["ILI9341 TFT"]
  node_enclosure_body["Monitor Body"]
  node_enclosure_cover["Back Cover"]
end

subgraph group_startup["Startup Automation"]
  node_startup_entry(("Windows Startup"))
  node_hidden_launcher["Hidden Launcher<br/>[baslat_gizli.vbs]"]
  node_batch_launcher["Batch Launcher<br/>[baslat.bat]"]
end

node_python_loop -->|"fetches JSON"| node_lhm
node_python_loop -->|"selects metrics"| node_sensor_lookup
node_python_loop -->|"formats values"| node_value_format
node_python_loop -->|"assembles payload"| node_packet
node_python_loop -->|"writes payload"| node_serial
node_serial -->|"sends serial data"| node_esp32
node_esp32 -->|"drives display"| node_tft
node_display_config -->|"configures pins"| node_tft
node_startup_entry -.->|"starts"| node_hidden_launcher
node_hidden_launcher -.->|"launches hidden"| node_batch_launcher
node_batch_launcher -.->|"runs script"| node_python_loop
node_enclosure_body -.->|"houses"| node_tft
node_enclosure_cover -.->|"covers"| node_enclosure_body

click node_python_loop "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py"
click node_sensor_lookup "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py"
click node_value_format "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py"
click node_packet "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py"
click node_serial "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py"
click node_esp32 "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/Kasa_MonitorV3.ino"
click node_display_config "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/User_Setup.h"
click node_hidden_launcher "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/baslat_gizli.vbs"
click node_batch_launcher "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/baslat.bat"
click node_enclosure_body "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/ESP32-ILI9341-Body.stl"
click node_enclosure_cover "https://github.com/techhane/pc-stat-monitor-esp32/blob/main/ESP32-ILI9341-BackCover.stl"

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_lhm toneBlue
class node_python_loop,node_sensor_lookup,node_value_format,node_packet,node_serial toneAmber
class node_esp32,node_display_config,node_tft,node_enclosure_body,node_enclosure_cover toneMint
class node_startup_entry,node_hidden_launcher,node_batch_launcher toneRose
```

## Components

### PC Data

- **Libre Hardware Monitor**

### Data Bridge

- [Monitor Loop](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py): `kasa_monitor.py`
- [Sensor Lookup](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py): `kasa_monitor.py`
- [Value Formatting](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py): `kasa_monitor.py`
- [Packet Assembly](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py): `kasa_monitor.py`
- [Serial Connection](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/kasa_monitor.py): `kasa_monitor.py`

### Display Hardware

- [ESP32 Firmware](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/Kasa_MonitorV3.ino): `Kasa_MonitorV3.ino`
- [TFT Pin Setup](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/User_Setup.h): `User_Setup.h`
- **ILI9341 TFT**
- [Monitor Body](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/ESP32-ILI9341-Body.stl): `ESP32-ILI9341-Body.stl`
- [Back Cover](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/ESP32-ILI9341-BackCover.stl): `ESP32-ILI9341-BackCover.stl`

### Startup Automation

- **Windows Startup**
- [Hidden Launcher](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/baslat_gizli.vbs): `baslat_gizli.vbs`
- [Batch Launcher](https://github.com/techhane/pc-stat-monitor-esp32/blob/main/baslat.bat): `baslat.bat`

## Connections

- Monitor Loop → Libre Hardware Monitor: fetches JSON
- Monitor Loop → Sensor Lookup: selects metrics
- Monitor Loop → Value Formatting: formats values
- Monitor Loop → Packet Assembly: assembles payload
- Monitor Loop → Serial Connection: writes payload
- Serial Connection → ESP32 Firmware: sends serial data
- ESP32 Firmware → ILI9341 TFT: drives display
- TFT Pin Setup → ILI9341 TFT: configures pins
- Windows Startup → Hidden Launcher: starts
- Hidden Launcher → Batch Launcher: launches hidden
- Batch Launcher → Monitor Loop: runs script
- Monitor Body → ILI9341 TFT: houses
- Back Cover → Monitor Body: covers
