# sensirion/arduino-i2c-sfm3000 architecture

> Architecture diagram of the GitHub repository sensirion/arduino-i2c-sfm3000, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sensirion/arduino-i2c-sfm3000
- Repository: https://github.com/sensirion/arduino-i2c-sfm3000

## Overview

##### Project type and purpose
- This is an Arduino driver library for the Sensirion SFM3000 differential pressure/flow sensor, exposing an I2C‑based API to sketch authors.
- It is **not** a full‑stack web app, but a hardware abstraction layer (HAL) / device driver, packaged for the Arduino ecosystem.

##### File structure
- Top‑level metadata:
– library.properties, keywords.txt (Arduino library registry metadata)
– README.md, CHANGELOG.md, LICENSE
- .github/workflows: CI pipelines for quality checks and GitHub releases
- src/: actual driver code (SensirionI2CSfm3000.cpp/.h)
- examples/: an Arduino sketch (exampleUsage.ino) demonstrating usage

##### README for additional insights
- Describes sensor wiring, installation via Arduino IDE, dependency on “Sensirion Core” v0.6.0
- Shows sample usage, serial output at 115200 baud
- Mentions clang‑format for code style in CI

##### Detail without over‑complicating
- Every directory’s role succinctly (src, examples, .github).
- Clearly label external dependencies (Sensirion Core, Arduino IDE).
- End‑to‑end flow: from user sketch, through driver layers, to hardware sensor, back.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Hardware Layer
    subgraph "Hardware Layer"
        Sensor["SFM3000 Sensor"]:::hardware
        I2C["I2C Bus @ up to 400 kHz"]:::hardware
        MCU["Arduino Board (MCU)"]:::hardware
    end

    %% MCU Software Layer
    subgraph "MCU Software Layer"
        WireLib["Arduino Wire Library<br>(I2C API)"]:::mcusoftware
        Core["Sensirion Core Library"]:::mcusoftware
        SFM_H["SensirionI2CSfm3000.h"]:::mcusoftware
        SFM_CPP["SensirionI2CSfm3000.cpp"]:::mcusoftware
        Sketch["Example Sketch<br>exampleUsage.ino"]:::mcusoftware
    end

    %% Development / CI Layer
    subgraph "Development / CI"
        IDE["Arduino IDE"]:::ci
        QC["Quality Check Pipeline"]:::ci
        Release["Release Automation Pipeline"]:::ci
        Meta1["library.properties"]:::ci
        Meta2["keywords.txt"]:::ci
        Docs1["README.md"]:::ci
        Docs2["CHANGELOG.md"]:::ci
        Docs3["LICENSE"]:::ci
    end

    %% Data and Dependencies
    Sensor -->|"data"| I2C
    I2C -->|"physical connection"| MCU
    MCU -->|"I2C API"| WireLib
    WireLib -->|"utility calls"| Core
    Core -->|"CRC & I2C helpers"| SFM_H
    Core -->|"CRC & I2C helpers"| SFM_CPP
    SFM_H -->|"driver API"| Sketch
    SFM_CPP -->|"driver API"| Sketch
    Sketch -->|"Serial @ 115200 baud"| MCU

    %% CI Interactions
    QC -->|"build & format"| SFM_H
    QC -->|"build & format"| SFM_CPP
    QC -->|"build & test"| Sketch
    Release -->|"package & publish"| Meta1
    Release -->|"package & publish"| Meta2
    Release -->|"package & publish"| Docs1
    Release -->|"package & publish"| Docs2
    Release -->|"package & publish"| Docs3
    IDE -->|"installs"| Sketch
    IDE -->|"installs"| SFM_H
    IDE -->|"installs"| SFM_CPP

    %% Click Events
    click SFM_H "https://github.com/sensirion/arduino-i2c-sfm3000/blob/main/src/SensirionI2CSfm3000.h"
    click SFM_CPP "https://github.com/sensirion/arduino-i2c-sfm3000/blob/main/src/SensirionI2CSfm3000.cpp"
    click Sketch "https://github.com/sensirion/arduino-i2c-sfm3000/blob/main/examples/exampleUsage/exampleUsage.ino"
    click Meta1 "https://github.com/sensirion/arduino-i2c-sfm3000/blob/main/library.properties"
    click Meta2 "https://github.com/sensirion/arduino-i2c-sfm3000/blob/main/keywords.txt"
    click Docs1 "https://github.com/sensirion/arduino-i2c-sfm3000/blob/main/README.md"
    click Docs2 "https://github.com/sensirion/arduino-i2c-sfm3000/blob/main/CHANGELOG.md"
    click Docs3 "https://github.com/sensirion/arduino-i2c-sfm3000/tree/main/LICENSE"
    click QC "https://github.com/sensirion/arduino-i2c-sfm3000/blob/main/.github/workflows/arduino_quality_check.yml"
    click Release "https://github.com/sensirion/arduino-i2c-sfm3000/blob/main/.github/workflows/github_release.yml"

    %% Styles
    classDef hardware fill:#eeeeee,stroke:#333,stroke-width:1px;
    classDef mcusoftware fill:#bbdefb,stroke:#333,stroke-width:1px;
    classDef ci fill:#c8e6c9,stroke:#333,stroke-width:1px;
```
