# ti-capacitor/embedded_irrigation_system architecture

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

- Interactive diagram: https://gitdiagram.com/ti-capacitor/embedded_irrigation_system
- Repository: https://github.com/ti-capacitor/embedded_irrigation_system

## Overview

This is an Arduino embedded irrigation system. Its documented workflow accepts serial commands to select automatic, manual, or maintenance mode; manual commands can select a crop and request or stop watering, while automatic watering uses moisture readings and crop-specific thresholds. The sampled implementation shows command parsing, sensor reads, and valve control, but not the main sketch’s orchestration, so links from that controller to irrigation behaviors are omitted. The PCB files indicate a hardware design artifact; its runtime connections are not established by the available evidence.

Main entry points: [`firmware/Emb_irrigation/irrigation.cpp`](https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/irrigation.cpp) (Serial commands), [`firmware/Emb_irrigation/MY_FINAL_PROJECT.ino`](https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/MY_FINAL_PROJECT.ino) (Sketch controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Firmware control"]
  node_controller["Sketch controller"]
  node_commands["Serial commands<br/>[irrigation.cpp]"]
  node_modes["Mode state<br/>[irrigation.cpp]"]
end

subgraph group_irrigation["Irrigation behavior"]
  node_moisture["Moisture reading<br/>[irrigation.cpp]"]
  node_valve["Valve control<br/>[irrigation.cpp]"]
end

subgraph group_hardware["Hardware design"]
  node_pcb["Irrigation PCB"]
  node_bom["Circuit BOM"]
end

node_operator(("Serial operator"))
node_probe(("Analog moisture input"))
node_actuator(("Valve hardware"))

node_operator -->|"sends commands"| node_commands
node_commands -->|"sets watering flags"| node_controller
node_probe -->|"provides analog input"| node_moisture
node_valve -->|"writes pin signal"| node_actuator

click node_controller "https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/MY_FINAL_PROJECT.ino"
click node_commands "https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/irrigation.cpp"
click node_modes "https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/irrigation.cpp"
click node_moisture "https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/irrigation.cpp"
click node_valve "https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/irrigation.cpp"
click node_pcb "https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/hardware/PCB/Gerber_irrigation-circuit_PCB_irrigation-circuit_2026-04-25.zip"
click node_bom "https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/hardware/PCB/BOM_irrigation-circuit_2026-04-25.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_controller,node_commands,node_modes toneBlue
class node_moisture,node_valve toneAmber
class node_pcb,node_bom toneMint
class node_operator,node_probe,node_actuator toneIndigo
```

## Components

### Firmware control

- [Sketch controller](https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/MY_FINAL_PROJECT.ino): `firmware/Emb_irrigation/MY_FINAL_PROJECT.ino`
- [Serial commands](https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/irrigation.cpp): `firmware/Emb_irrigation/irrigation.cpp`
- [Mode state](https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/irrigation.cpp): `firmware/Emb_irrigation/irrigation.cpp`

### Irrigation behavior

- [Moisture reading](https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/irrigation.cpp): `firmware/Emb_irrigation/irrigation.cpp`
- [Valve control](https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/firmware/Emb_irrigation/irrigation.cpp): `firmware/Emb_irrigation/irrigation.cpp`

### Hardware design

- [Irrigation PCB](https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/hardware/PCB/Gerber_irrigation-circuit_PCB_irrigation-circuit_2026-04-25.zip): `hardware/PCB/Gerber_irrigation-circuit_PCB_irrigation-circuit_2026-04-25.zip`
- [Circuit BOM](https://github.com/ti-capacitor/embedded_irrigation_system/blob/main/hardware/PCB/BOM_irrigation-circuit_2026-04-25.csv): `hardware/PCB/BOM_irrigation-circuit_2026-04-25.csv`

### Other components

- **Serial operator**
- **Analog moisture input**
- **Valve hardware**

## Connections

- Serial operator → Serial commands: sends commands (evidence: `firmware/Emb_irrigation/irrigation.cpp`)
- Serial commands → Sketch controller: sets watering flags (evidence: `firmware/Emb_irrigation/irrigation.cpp`)
- Analog moisture input → Moisture reading: provides analog input (evidence: `firmware/Emb_irrigation/irrigation.cpp`)
- Valve control → Valve hardware: writes pin signal (evidence: `firmware/Emb_irrigation/irrigation.cpp`)
