# argilo/pico-projects architecture

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

- Interactive diagram: https://gitdiagram.com/argilo/pico-projects
- Repository: https://github.com/argilo/pico-projects

## Overview

The repository contains two independent Pico W applications: an NTP-synchronized clock and a Home Assistant temperature/humidity display. The clock connects to Wi-Fi, obtains time over NTP, sets the RTC, applies Eastern-time display logic, and refreshes its screen. The temperature display connects to Wi-Fi and an MQTT broker, parses sensor and cover updates, and periodically renders the collected values. Each application is implemented in a single main file; the diagram separates its meaningful runtime responsibilities. Evidence comes from the README and the excerpted source files.

Main entry points: [`ntp_clock/main.py`](https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py) (Clock runtime), [`temp_display/main.py`](https://github.com/argilo/pico-projects/blob/main/temp_display/main.py) (Display runtime), [`temp_display/CONFIG.py`](https://github.com/argilo/pico-projects/blob/main/temp_display/CONFIG.py) (Display settings), [`ntp_clock/WIFI_CONFIG.py`](https://github.com/argilo/pico-projects/blob/main/ntp_clock/WIFI_CONFIG.py) (Wi-Fi settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clock["NTP Clock"]
  node_clock_app["Clock runtime<br/>[main.py]"]
  node_clock_config["Wi-Fi settings<br/>[WIFI_CONFIG.py]"]
  node_clock_wifi["Wi-Fi connection<br/>[main.py]"]
  node_ntp_sync["NTP synchronization<br/>[main.py]"]
  node_ntp_service{{"NTP server"}}
  node_rtc[("Pico RTC")]
  node_timezone["Eastern time<br/>[main.py]"]
  node_clock_display["Clock rendering<br/>[main.py]"]
  node_display_pack["Pico Display Pack"]
  node_clock_led["Status LED"]
end

subgraph group_temperature["Temperature Display"]
  node_temp_app["Display runtime<br/>[main.py]"]
  node_temp_config["Display settings<br/>[CONFIG.py]"]
  node_temp_wifi["Wi-Fi connection<br/>[main.py]"]
  node_mqtt_client["MQTT client<br/>[main.py]"]
  node_ha_broker{{"Home Assistant broker"}}
  node_message_parser["Update parser<br/>[main.py]"]
  node_sensor_state[("Sensor and door state<br/>[main.py]")]
  node_temp_renderer["Display renderer<br/>[main.py]"]
  node_inky_pack["Pico Inky Pack"]
end

node_clock_app -->|"connects"| node_clock_wifi
node_clock_app -->|"reads settings"| node_clock_config
node_clock_app -->|"invokes"| node_ntp_sync
node_ntp_sync -->|"queries"| node_ntp_service
node_ntp_sync -->|"sets time"| node_rtc
node_clock_app -->|"calculates"| node_timezone
node_timezone -->|"reads time"| node_rtc
node_clock_app -->|"renders"| node_clock_display
node_clock_display -->|"updates"| node_display_pack
node_clock_wifi -->|"signals status"| node_clock_led
node_temp_app -->|"connects"| node_temp_wifi
node_temp_app -->|"reads settings"| node_temp_config
node_temp_app -->|"connects and subscribes"| node_mqtt_client
node_mqtt_client -->|"exchanges messages"| node_ha_broker
node_mqtt_client -->|"dispatches updates"| node_message_parser
node_message_parser -->|"updates"| node_sensor_state
node_temp_app -->|"renders periodically"| node_temp_renderer
node_temp_renderer -->|"reads values"| node_sensor_state
node_temp_renderer -->|"uses ordering"| node_temp_config
node_temp_renderer -->|"updates"| node_inky_pack

click node_clock_app "https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py"
click node_clock_config "https://github.com/argilo/pico-projects/blob/main/ntp_clock/WIFI_CONFIG.py"
click node_clock_wifi "https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py"
click node_ntp_sync "https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py"
click node_timezone "https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py"
click node_clock_display "https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py"
click node_temp_app "https://github.com/argilo/pico-projects/blob/main/temp_display/main.py"
click node_temp_config "https://github.com/argilo/pico-projects/blob/main/temp_display/CONFIG.py"
click node_temp_wifi "https://github.com/argilo/pico-projects/blob/main/temp_display/main.py"
click node_mqtt_client "https://github.com/argilo/pico-projects/blob/main/temp_display/main.py"
click node_message_parser "https://github.com/argilo/pico-projects/blob/main/temp_display/main.py"
click node_sensor_state "https://github.com/argilo/pico-projects/blob/main/temp_display/main.py"
click node_temp_renderer "https://github.com/argilo/pico-projects/blob/main/temp_display/main.py"

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_clock_app,node_clock_config,node_clock_wifi,node_ntp_sync,node_ntp_service,node_rtc,node_timezone,node_clock_display,node_display_pack,node_clock_led toneBlue
class node_temp_app,node_temp_config,node_temp_wifi,node_mqtt_client,node_ha_broker,node_message_parser,node_sensor_state,node_temp_renderer,node_inky_pack toneAmber
```

## Components

### NTP Clock

- [Clock runtime](https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py): `ntp_clock/main.py`
- [Wi-Fi settings](https://github.com/argilo/pico-projects/blob/main/ntp_clock/WIFI_CONFIG.py): `ntp_clock/WIFI_CONFIG.py`
- [Wi-Fi connection](https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py): `ntp_clock/main.py`
- [NTP synchronization](https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py): `ntp_clock/main.py`
- **NTP server**
- **Pico RTC**
- [Eastern time](https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py): `ntp_clock/main.py`
- [Clock rendering](https://github.com/argilo/pico-projects/blob/main/ntp_clock/main.py): `ntp_clock/main.py`
- **Pico Display Pack**
- **Status LED**

### Temperature Display

- [Display runtime](https://github.com/argilo/pico-projects/blob/main/temp_display/main.py): `temp_display/main.py`
- [Display settings](https://github.com/argilo/pico-projects/blob/main/temp_display/CONFIG.py): `temp_display/CONFIG.py`
- [Wi-Fi connection](https://github.com/argilo/pico-projects/blob/main/temp_display/main.py): `temp_display/main.py`
- [MQTT client](https://github.com/argilo/pico-projects/blob/main/temp_display/main.py): `temp_display/main.py`
- **Home Assistant broker**
- [Update parser](https://github.com/argilo/pico-projects/blob/main/temp_display/main.py): `temp_display/main.py`
- [Sensor and door state](https://github.com/argilo/pico-projects/blob/main/temp_display/main.py): `temp_display/main.py`
- [Display renderer](https://github.com/argilo/pico-projects/blob/main/temp_display/main.py): `temp_display/main.py`
- **Pico Inky Pack**

## Connections

- Clock runtime → Wi-Fi connection: connects (evidence: `ntp_clock/main.py`)
- Clock runtime → Wi-Fi settings: reads settings (evidence: `ntp_clock/main.py`)
- Clock runtime → NTP synchronization: invokes (evidence: `ntp_clock/main.py`)
- NTP synchronization → NTP server: queries (evidence: `ntp_clock/main.py`)
- NTP synchronization → Pico RTC: sets time (evidence: `ntp_clock/main.py`)
- Clock runtime → Eastern time: calculates (evidence: `ntp_clock/main.py`)
- Eastern time → Pico RTC: reads time (evidence: `ntp_clock/main.py`)
- Clock runtime → Clock rendering: renders (evidence: `ntp_clock/main.py`)
- Clock rendering → Pico Display Pack: updates (evidence: `ntp_clock/main.py`)
- Wi-Fi connection → Status LED: signals status (evidence: `ntp_clock/main.py`)
- Display runtime → Wi-Fi connection: connects (evidence: `temp_display/main.py`)
- Display runtime → Display settings: reads settings (evidence: `temp_display/main.py`)
- Display runtime → MQTT client: connects and subscribes (evidence: `temp_display/main.py`)
- MQTT client → Home Assistant broker: exchanges messages (evidence: `temp_display/main.py`)
- MQTT client → Update parser: dispatches updates (evidence: `temp_display/main.py`)
- Update parser → Sensor and door state: updates (evidence: `temp_display/main.py`)
- Display runtime → Display renderer: renders periodically (evidence: `temp_display/main.py`)
- Display renderer → Sensor and door state: reads values (evidence: `temp_display/main.py`)
- Display renderer → Display settings: uses ordering (evidence: `temp_display/main.py`)
- Display renderer → Pico Inky Pack: updates (evidence: `temp_display/main.py`)
