# leonvandenbeukel/3d-7-segment-digital-clock architecture

> Architecture diagram of the GitHub repository leonvandenbeukel/3d-7-segment-digital-clock, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/leonvandenbeukel/3d-7-segment-digital-clock
- Repository: https://github.com/leonvandenbeukel/3d-7-segment-digital-clock

## Overview

#### Purpose and Entry Point
This repository defines a physical, 3D-printed four-digit seven-segment digital clock. The Arduino firmware entry point is `3D-7-Segment-Digital-Clock.ino`; it drives addressable LEDs and integrates time, environmental sensing, and Bluetooth control.

#### Firmware Control Layer
`3D-7-Segment-Digital-Clock.ino` is the device’s central runtime. It is expected to initialize the Arduino Nano peripherals, repeatedly obtain clock/sensor state, map that state to segment patterns, and update the LED strip. It is the only software implementation source in the repository.

#### Timekeeping Boundary
The clock’s authoritative time source is an external DS3231 real-time-clock module with battery backup. Firmware communicates with that hardware from `3D-7-Segment-Digital-Clock.ino`, separating persistent timekeeping from Arduino power/reset behavior.

#### Display Rendering and LED Topology
A one-meter, 30-pixel WS2812B RGB LED strip provides the display output. The physical LED-to-segment mapping is documented by:
- `7_Segment_Display with LED indexes 0 - 13 right segments - minutes.pdf`
- `7_Segment_Display with LED indexes 16 - 29 left segments - hours.pdf`

The firmware translates hours/minutes into seven-segment illumination states and emits per-pixel color data to the strip. The index documents are the key contract between code, LED wiring, and printed digit geometry.

#### External Inputs and Wireless Control
The Arduino integrates:
- HC-05 Bluetooth module, intended to receive commands from the linked Android clock app.
- DHT11 or DHT22 temperature/humidity sensor for environmental readings.

Both are hardware-service boundaries managed by `3D-7-Segment-Digital-Clock.ino`; Bluetooth provides the external control path, while the DHT sensor contributes displayable telemetry.

#### Electrical and Physical Assembly
The hardware wiring/PCB design is represented by `Schema.fzz` (Fritzing schema). The runtime infrastructure is an Arduino Nano, 5V/2A power supply, WS2812B strip, DS3231, HC-05, DHT sensor, and custom PCB/wiring. Power capacity is important because LED brightness and color updates directly determine current draw.

#### Printed Enclosure and Optical Components
The display enclosure is a modular STL assembly that constrains LED placement, segment separation, and contrast:
- `STL/Horizontal Segment.stl`
- `STL/Vertical Segment.stl`
- `STL/OuterRingSegments.stl`

Supporting separator, center, and colon components include `STL/Betweenblock.stl`, `STL/Middle.stl`, and `STL/DotRing.stl`. These files are not firmware dependencies, but they define the physical rendering surface that the LED index maps target.

Main entry points: [`3D-7-Segment-Digital-Clock.ino`](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/3D-7-Segment-Digital-Clock.ino) (Clock runtime), [`Schema.fzz`](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/Schema.fzz) (Wiring / PCB schema), [`7_Segment_Display with LED indexes 0 - 13 right segments - minutes.pdf`](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/7_Segment_Display%20with%20LED%20indexes%200%20-%2013%20right%20segments%20-%20minutes.pdf) (Minute digit pixels), [`STL/Horizontal Segment.stl`](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/STL/Horizontal%20Segment.stl) (Segment enclosure)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["Arduino firmware"]
  node_firmware_entry["Clock runtime<br/>Arduino sketch"]
  node_time_state["Clock state<br/>runtime state"]
  node_segment_renderer["Segment renderer<br/>rendering logic"]
  node_led_index_contract["LED index mapping<br/>display contract"]
  node_minute_digits["Minute digit pixels<br/>mapping document"]
  node_hour_digits["Hour digit pixels<br/>mapping document"]
end

subgraph group_electronics["Electronics"]
  node_arduino_nano["Arduino Nano<br/>controller"]
  node_ds3231["DS3231 RTC<br/>time module"]
  node_dht_sensor["DHT11 / DHT22<br/>environment sensor"]
  node_hc05["HC-05 Bluetooth<br/>wireless module"]
  node_android_app["Android clock app<br/>control client"]
  node_ws2812b["WS2812B strip<br/>30-pixel RGB output"]
  node_power_supply["5V / 2A supply<br/>power source"]
  node_wiring_schema["Wiring / PCB schema<br/>Fritzing design<br/>[Schema.fzz]"]
end

subgraph group_physical["Printed display"]
  node_segment_parts["Segment enclosure<br/>STL assembly"]
  node_optical_parts["Separator and colon parts<br/>STL components<br/>[DotRing.stl]"]
end

node_firmware_entry -->|"runs on"| node_arduino_nano
node_firmware_entry -->|"reads time"| node_ds3231
node_firmware_entry -->|"reads telemetry"| node_dht_sensor
node_firmware_entry -->|"receives commands"| node_hc05
node_android_app -->|"Bluetooth commands"| node_hc05
node_ds3231 -->|"supplies time"| node_time_state
node_firmware_entry -->|"maintains"| node_time_state
node_time_state -->|"hours and minutes"| node_segment_renderer
node_dht_sensor -->|"environment data"| node_segment_renderer
node_segment_renderer -->|"pixel color data"| node_ws2812b
node_led_index_contract -->|"documents"| node_minute_digits
node_minute_digits -.->|"minute pixel layout"| node_segment_renderer
node_hour_digits -.->|"hour pixel layout"| node_segment_renderer
node_ws2812b -->|"illuminates"| node_segment_parts
node_segment_parts -->|"assembled with"| node_optical_parts
node_wiring_schema -.->|"wiring design"| node_arduino_nano
node_wiring_schema -.->|"wiring design"| node_ws2812b
node_power_supply -->|"powers"| node_arduino_nano
node_power_supply -->|"powers LED load"| node_ws2812b

click node_firmware_entry "https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/3D-7-Segment-Digital-Clock.ino"
click node_segment_renderer "https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/3D-7-Segment-Digital-Clock.ino"
click node_led_index_contract "https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/7_Segment_Display%20with%20LED%20indexes%200%20-%2013%20right%20segments%20-%20minutes.pdf"
click node_minute_digits "https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/7_Segment_Display%20with%20LED%20indexes%200%20-%2013%20right%20segments%20-%20minutes.pdf"
click node_hour_digits "https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/7_Segment_Display%20with%20LED%20indexes%2016%20-%2029%20left%20segments%20-%20hours.pdf"
click node_wiring_schema "https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/Schema.fzz"
click node_segment_parts "https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/STL/Horizontal%20Segment.stl"
click node_optical_parts "https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/STL/DotRing.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_firmware_entry,node_time_state,node_segment_renderer,node_led_index_contract,node_minute_digits,node_hour_digits toneBlue
class node_arduino_nano,node_ds3231,node_dht_sensor,node_hc05,node_android_app,node_ws2812b,node_power_supply,node_wiring_schema toneAmber
class node_segment_parts,node_optical_parts toneMint
```

## Components

### Arduino firmware

- [Clock runtime](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/3D-7-Segment-Digital-Clock.ino): Arduino sketch · Central device control loop. · `3D-7-Segment-Digital-Clock.ino`
- **Clock state**: runtime state · Hours and minutes for display rendering.
- [Segment renderer](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/3D-7-Segment-Digital-Clock.ino): rendering logic · Maps clock and telemetry state to pixel colors. · `3D-7-Segment-Digital-Clock.ino`
- [LED index mapping](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/7_Segment_Display%20with%20LED%20indexes%200%20-%2013%20right%20segments%20-%20minutes.pdf): display contract · Defines pixels for the right-minute digits. · `7_Segment_Display with LED indexes 0 - 13 right segments - minutes.pdf`
- [Minute digit pixels](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/7_Segment_Display%20with%20LED%20indexes%200%20-%2013%20right%20segments%20-%20minutes.pdf): mapping document · `7_Segment_Display with LED indexes 0 - 13 right segments - minutes.pdf`
- [Hour digit pixels](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/7_Segment_Display%20with%20LED%20indexes%2016%20-%2029%20left%20segments%20-%20hours.pdf): mapping document · Defines pixels for the left-hour digits. · `7_Segment_Display with LED indexes 16 - 29 left segments - hours.pdf`

### Electronics

- **Arduino Nano**: controller
- **DS3231 RTC**: time module · Battery-backed authoritative time source.
- **DHT11 / DHT22**: environment sensor
- **HC-05 Bluetooth**: wireless module
- **Android clock app**: control client
- **WS2812B strip**: 30-pixel RGB output · One-meter display light source.
- **5V / 2A supply**: power source · Supplies controller and LED load.
- [Wiring / PCB schema](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/Schema.fzz): Fritzing design · `Schema.fzz`

### Printed display

- [Segment enclosure](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/STL/Horizontal%20Segment.stl): STL assembly · Positions LEDs and separates seven-segment light paths. · `STL/Horizontal Segment.stl`
- [Separator and colon parts](https://github.com/leonvandenbeukel/3d-7-segment-digital-clock/blob/master/STL/DotRing.stl): STL components · Supporting display separators and colon optics. · `STL/DotRing.stl`

## Connections

- Clock runtime → Arduino Nano: runs on
- Clock runtime → DS3231 RTC: reads time
- Clock runtime → DHT11 / DHT22: reads telemetry
- Clock runtime → HC-05 Bluetooth: receives commands
- Android clock app → HC-05 Bluetooth: Bluetooth commands
- DS3231 RTC → Clock state: supplies time
- Clock runtime → Clock state: maintains
- Clock state → Segment renderer: hours and minutes
- DHT11 / DHT22 → Segment renderer: environment data
- Segment renderer → WS2812B strip: pixel color data
- LED index mapping → Minute digit pixels: documents
- Minute digit pixels → Segment renderer: minute pixel layout
- Hour digit pixels → Segment renderer: hour pixel layout
- WS2812B strip → Segment enclosure: illuminates
- Segment enclosure → Separator and colon parts: assembled with
- Wiring / PCB schema → Arduino Nano: wiring design
- Wiring / PCB schema → WS2812B strip: wiring design
- 5V / 2A supply → Arduino Nano: powers
- 5V / 2A supply → WS2812B strip: powers LED load
