# sparkfun/sparkfun_openscale_iot architecture

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

- Interactive diagram: https://gitdiagram.com/sparkfun/sparkfun_openscale_iot
- Repository: https://github.com/sparkfun/sparkfun_openscale_iot

## Overview

OpenScale-IoT is an ESP32-based wireless scale firmware and hardware design. The principal workflow is to connect a load cell, configure the scale through a serial or Bluetooth terminal, then read weight and temperature through the selected interface; Wi-Fi provides read-only viewing and OTA updates. Firmware excerpts are limited to Bluetooth abstraction and settings, so the remaining firmware components and their connections are mapped from the README and file tree rather than inspected source.

Main entry points: [`Firmware/OpenScale-IoT/Print.ino`](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/Print.ino) (Data output), [`Firmware/OpenScale-IoT/wifi.ino`](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/wifi.ino) (Wi-Fi viewing), [`Firmware/OpenScale-IoT/scale.ino`](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/scale.ino) (Scale readings), [`Firmware/OpenScale-IoT/menus.ino`](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/menus.ino) (Serial menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Measurement"]
  node_loadcell["Load cell"]
  node_hx711["HX711 ADC"]
  node_temperature["Temperature sensing<br/>[temperature.ino]"]
  node_scale["Scale readings<br/>[scale.ino]"]
end

subgraph group_configuration["Configuration"]
  node_settings["Scale settings<br/>[settings.h]"]
  node_menu["Serial menu<br/>[menus.ino]"]
end

subgraph group_interfaces["Device Interfaces"]
  node_serial["USB / serial<br/>[OpenScale-IoT.ino]"]
  node_bluetooth["Bluetooth / BLE<br/>[bluetoothSelect.h]"]
  node_wifi["Wi-Fi viewing<br/>[wifi.ino]"]
  node_tcp["TCP server<br/>[tcpServer.ino]"]
  node_output["Data output<br/>[Print.ino]"]
end

subgraph group_maintenance["Updates and Hardware"]
  node_ota["OTA updates<br/>[ota.ino]"]
  node_board["Scale circuit board"]
end

node_user(("Scale user"))
node_terminal(("Terminal client"))
node_network(("Wi-Fi network"))

node_loadcell -->|"senses weight"| node_hx711
node_hx711 -->|"provides readings"| node_scale
node_temperature -->|"measures temperature"| node_scale
node_user -->|"configures scale"| node_menu
node_terminal -->|"connects by USB"| node_serial
node_terminal -->|"connects wirelessly"| node_bluetooth
node_menu -.->|"configures"| node_settings
node_scale -.->|"formats readings"| node_output
node_output -->|"sends readings"| node_serial
node_output -->|"sends readings"| node_bluetooth
node_network -->|"connects device"| node_wifi
node_wifi -->|"views readings"| node_output
node_terminal -->|"requests update"| node_ota
node_wifi -->|"enables updates"| node_ota

click node_temperature "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/temperature.ino"
click node_scale "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/scale.ino"
click node_settings "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/settings.h"
click node_menu "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/menus.ino"
click node_serial "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/OpenScale-IoT.ino"
click node_bluetooth "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/bluetoothSelect.h"
click node_wifi "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/wifi.ino"
click node_tcp "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/tcpServer.ino"
click node_output "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/Print.ino"
click node_ota "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/ota.ino"
click node_board "https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Hardware/SparkFun_OpenScale-BT.kicad_sch"

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_loadcell,node_hx711,node_temperature,node_scale,node_user,node_terminal toneBlue
class node_settings,node_menu toneAmber
class node_serial,node_bluetooth,node_wifi,node_tcp,node_output toneMint
class node_ota,node_board toneRose
class node_network toneIndigo
```

## Components

### Measurement

- **Load cell**
- **HX711 ADC**
- [Temperature sensing](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/temperature.ino): `Firmware/OpenScale-IoT/temperature.ino`
- [Scale readings](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/scale.ino): `Firmware/OpenScale-IoT/scale.ino`

### Configuration

- [Scale settings](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/settings.h): `Firmware/OpenScale-IoT/settings.h`
- [Serial menu](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/menus.ino): `Firmware/OpenScale-IoT/menus.ino`

### Device Interfaces

- [USB / serial](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/OpenScale-IoT.ino): `Firmware/OpenScale-IoT/OpenScale-IoT.ino`
- [Bluetooth / BLE](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/bluetoothSelect.h): `Firmware/OpenScale-IoT/bluetoothSelect.h`
- [Wi-Fi viewing](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/wifi.ino): `Firmware/OpenScale-IoT/wifi.ino`
- [TCP server](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/tcpServer.ino): `Firmware/OpenScale-IoT/tcpServer.ino`
- [Data output](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/Print.ino): `Firmware/OpenScale-IoT/Print.ino`

### Updates and Hardware

- [OTA updates](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Firmware/OpenScale-IoT/ota.ino): `Firmware/OpenScale-IoT/ota.ino`
- [Scale circuit board](https://github.com/sparkfun/sparkfun_openscale_iot/blob/main/Hardware/SparkFun_OpenScale-BT.kicad_sch): `Hardware/SparkFun_OpenScale-BT.kicad_sch`

### Other components

- **Scale user**
- **Terminal client**
- **Wi-Fi network**

## Connections

- Load cell → HX711 ADC: senses weight (evidence: `readme.md`)
- HX711 ADC → Scale readings: provides readings (evidence: `readme.md`)
- Temperature sensing → Scale readings: measures temperature (evidence: `readme.md`)
- Scale user → Serial menu: configures scale (evidence: `readme.md`)
- Terminal client → USB / serial: connects by USB (evidence: `readme.md`)
- Terminal client → Bluetooth / BLE: connects wirelessly (evidence: `readme.md`)
- Serial menu → Scale settings: configures
- Scale readings → Data output: formats readings
- Data output → USB / serial: sends readings (evidence: `readme.md`)
- Data output → Bluetooth / BLE: sends readings (evidence: `readme.md`)
- Wi-Fi network → Wi-Fi viewing: connects device (evidence: `readme.md`)
- Wi-Fi viewing → Data output: views readings (evidence: `readme.md`)
- Terminal client → OTA updates: requests update (evidence: `readme.md`)
- Wi-Fi viewing → OTA updates: enables updates (evidence: `readme.md`)
