# jonathan-z-code/dht11_sensor architecture

> Architecture diagram of the GitHub repository jonathan-z-code/dht11_sensor, 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/jonathan-z-code/dht11_sensor
- Repository: https://github.com/jonathan-z-code/dht11_sensor

## Overview

This is a small Arduino library for reading a DHT11 temperature and humidity sensor. The main workflow is: a caller requests data, the library resets and starts the sensor transaction, Arduino interrupt handling captures timed signal edges, and the parser checks the acknowledgement and checksum before returning a result. The example sketch is present in the tree, but its source was not sampled, so its usage details are not represented.

Main entry points: [`src/DHT11_Sensor.cpp`](https://github.com/jonathan-z-code/dht11_sensor/blob/master/src/DHT11_Sensor.cpp) (Transaction control), [`src/DHT11_Sensor.h`](https://github.com/jonathan-z-code/dht11_sensor/blob/master/src/DHT11_Sensor.h) (DHT11 API)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_caller(("Library caller"))
node_dht11["DHT11 sensor"]
node_library["DHT11 API<br/>[DHT11_Sensor.h]"]
node_transaction["Transaction control<br/>[DHT11_Sensor.cpp]"]
node_parser["Edge parser<br/>[DHT11_Sensor.cpp]"]
node_arduino["Arduino runtime"]

node_caller -->|"requests data"| node_library
node_library -->|"calls getData"| node_transaction
node_transaction -->|"resets state"| node_transaction
node_transaction -->|"controls GPIO"| node_arduino
node_transaction -->|"starts reading"| node_dht11
node_transaction -->|"attaches interrupt"| node_arduino
node_arduino -->|"dispatches IRQ"| node_parser
node_parser -->|"reads timestamps"| node_arduino
node_parser -->|"parses and validates"| node_parser
node_transaction -->|"checks status"| node_parser
node_transaction -->|"returns result"| node_caller

click node_library "https://github.com/jonathan-z-code/dht11_sensor/blob/master/src/DHT11_Sensor.h"
click node_transaction "https://github.com/jonathan-z-code/dht11_sensor/blob/master/src/DHT11_Sensor.cpp"
click node_parser "https://github.com/jonathan-z-code/dht11_sensor/blob/master/src/DHT11_Sensor.cpp"

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_caller,node_dht11,node_arduino toneIndigo
class node_library toneMint
class node_transaction,node_parser toneTeal
```

## Components

### Other components

- **Library caller**
- **DHT11 sensor**
- [DHT11 API](https://github.com/jonathan-z-code/dht11_sensor/blob/master/src/DHT11_Sensor.h): `src/DHT11_Sensor.h`
- [Transaction control](https://github.com/jonathan-z-code/dht11_sensor/blob/master/src/DHT11_Sensor.cpp): `src/DHT11_Sensor.cpp`
- [Edge parser](https://github.com/jonathan-z-code/dht11_sensor/blob/master/src/DHT11_Sensor.cpp): `src/DHT11_Sensor.cpp`
- **Arduino runtime**

## Connections

- Library caller → DHT11 API: requests data
- DHT11 API → Transaction control: calls getData
- Transaction control → Transaction control: resets state
- Transaction control → Arduino runtime: controls GPIO
- Transaction control → DHT11 sensor: starts reading
- Transaction control → Arduino runtime: attaches interrupt
- Arduino runtime → Edge parser: dispatches IRQ
- Edge parser → Arduino runtime: reads timestamps
- Edge parser → Edge parser: parses and validates
- Transaction control → Edge parser: checks status
- Transaction control → Library caller: returns result
