# cropsentry/hardware architecture

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

- Interactive diagram: https://gitdiagram.com/cropsentry/hardware
- Repository: https://github.com/cropsentry/hardware

## Overview

CropSentry is a solar-powered field device for monitoring crop conditions and relaying readings for analysis and user-facing summaries. The documented workflow runs from environmental sensors through an onboard LoRa board, a Wi-Fi-connected receiver, server-side AI/ML processing, and an app for farmers. The repository contains firmware and hardware-design artifacts, but no source excerpts were provided; edges therefore reflect only relationships described in the README, not inspected implementation details.

Main entry points: [`firmware/CropSentry_MainBoard_Firmware/CropSentry_MainBoard_Firmware.ino`](https://github.com/cropsentry/hardware/blob/main/firmware/CropSentry_MainBoard_Firmware/CropSentry_MainBoard_Firmware.ino) (Sensor board firmware), [`firmware/CropSentry_Reciever_Board_Firmware/CropSentry_Reciever_Board_Firmware.ino`](https://github.com/cropsentry/hardware/blob/main/firmware/CropSentry_Reciever_Board_Firmware/CropSentry_Reciever_Board_Firmware.ino) (LoRa receiver firmware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Field sensing"]
  node_sgp41["SGP41 VOC/NOx"]
  node_bme688["BME688 gas and climate"]
  node_sht45["SHT45 climate reference"]
  node_soil["Soil moisture probe"]
end

subgraph group_relay["Device and relay"]
  node_mainboard["Sensor board firmware"]
  node_receiver["LoRa receiver firmware"]
  node_router["Wi-Fi router"]
end

subgraph group_analysis["Analysis and user"]
  node_server["Compute server"]
  node_model["AI/ML analysis"]
  node_app["CropSentry app"]
end

subgraph group_design["Hardware design"]
  node_power["Solar power system"]
  node_schematic["Circuit schematic"]
  node_cad["CAD and enclosure models"]
  node_bom["Hardware bill of materials"]
end

node_field(("Crop environment"))
node_farmer(("Farmer"))

node_field -->|"provides air conditions"| node_sgp41
node_field -->|"provides climate and gas"| node_bme688
node_field -->|"provides ambient readings"| node_sht45
node_field -->|"provides soil moisture"| node_soil
node_sgp41 -->|"sends readings"| node_mainboard
node_bme688 -->|"sends readings"| node_mainboard
node_sht45 -->|"sends readings"| node_mainboard
node_soil -->|"sends analog readings"| node_mainboard
node_mainboard -->|"sends via LoRa"| node_receiver
node_receiver -->|"sends via Wi-Fi"| node_router
node_router -->|"forwards data"| node_server
node_server -->|"computes readings"| node_model
node_model -->|"sends translated results"| node_app
node_app -->|"presents crop status"| node_farmer

click node_mainboard "https://github.com/cropsentry/hardware/blob/main/firmware/CropSentry_MainBoard_Firmware/CropSentry_MainBoard_Firmware.ino"
click node_receiver "https://github.com/cropsentry/hardware/blob/main/firmware/CropSentry_Reciever_Board_Firmware/CropSentry_Reciever_Board_Firmware.ino"
click node_power "https://github.com/cropsentry/hardware/tree/main/boms"
click node_schematic "https://github.com/cropsentry/hardware/blob/main/sch-files/CropSentry.kicad_sch"
click node_cad "https://github.com/cropsentry/hardware/tree/main/cad/Modeling"
click node_bom "https://github.com/cropsentry/hardware/blob/main/boms/.CSV_Files/CropSentry_Hardware_BOM_10-8-26_V3.csv"

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_sgp41,node_bme688,node_sht45,node_soil toneBlue
class node_mainboard,node_receiver,node_router toneAmber
class node_server,node_model,node_app toneMint
class node_power,node_schematic,node_cad,node_bom toneRose
class node_field,node_farmer toneIndigo
```

## Components

### Field sensing

- **SGP41 VOC/NOx**
- **BME688 gas and climate**
- **SHT45 climate reference**
- **Soil moisture probe**

### Device and relay

- [Sensor board firmware](https://github.com/cropsentry/hardware/blob/main/firmware/CropSentry_MainBoard_Firmware/CropSentry_MainBoard_Firmware.ino): `firmware/CropSentry_MainBoard_Firmware/CropSentry_MainBoard_Firmware.ino`
- [LoRa receiver firmware](https://github.com/cropsentry/hardware/blob/main/firmware/CropSentry_Reciever_Board_Firmware/CropSentry_Reciever_Board_Firmware.ino): `firmware/CropSentry_Reciever_Board_Firmware/CropSentry_Reciever_Board_Firmware.ino`
- **Wi-Fi router**

### Analysis and user

- **Compute server**
- **AI/ML analysis**
- **CropSentry app**

### Hardware design

- [Solar power system](https://github.com/cropsentry/hardware/tree/main/boms): `boms`
- [Circuit schematic](https://github.com/cropsentry/hardware/blob/main/sch-files/CropSentry.kicad_sch): `sch-files/CropSentry.kicad_sch`
- [CAD and enclosure models](https://github.com/cropsentry/hardware/tree/main/cad/Modeling): `cad/Modeling`
- [Hardware bill of materials](https://github.com/cropsentry/hardware/blob/main/boms/.CSV_Files/CropSentry_Hardware_BOM_10-8-26_V3.csv): `boms/.CSV_Files/CropSentry_Hardware_BOM_10-8-26_V3.csv`

### Other components

- **Crop environment**
- **Farmer**

## Connections

- Crop environment → SGP41 VOC/NOx: provides air conditions (evidence: `README.md`)
- Crop environment → BME688 gas and climate: provides climate and gas (evidence: `README.md`)
- Crop environment → SHT45 climate reference: provides ambient readings (evidence: `README.md`)
- Crop environment → Soil moisture probe: provides soil moisture (evidence: `README.md`)
- SGP41 VOC/NOx → Sensor board firmware: sends readings (evidence: `README.md`)
- BME688 gas and climate → Sensor board firmware: sends readings (evidence: `README.md`)
- SHT45 climate reference → Sensor board firmware: sends readings (evidence: `README.md`)
- Soil moisture probe → Sensor board firmware: sends analog readings (evidence: `README.md`)
- Sensor board firmware → LoRa receiver firmware: sends via LoRa (evidence: `README.md`)
- LoRa receiver firmware → Wi-Fi router: sends via Wi-Fi (evidence: `README.md`)
- Wi-Fi router → Compute server: forwards data (evidence: `README.md`)
- Compute server → AI/ML analysis: computes readings (evidence: `README.md`)
- AI/ML analysis → CropSentry app: sends translated results (evidence: `README.md`)
- CropSentry app → Farmer: presents crop status (evidence: `README.md`)
