# catmudd/resistivity-testing-system architecture

> Architecture diagram of the GitHub repository catmudd/resistivity-testing-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/catmudd/resistivity-testing-system
- Repository: https://github.com/catmudd/resistivity-testing-system

## Overview

This repository implements a Raspberry Pi rock-resistivity testing system. The user enters test details and starts a run; the runner configures the power supply, acquires voltage and current measurements, and creates result reports. The graph includes the visible UI, instrument and reporting stages, plus calibration and troubleshooting capabilities. The README is empty, and some source excerpts omit implementation details, so uncertain calls are not inferred.

Main entry points: [`src/python/main.py`](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/main.py) (Test runner), [`src/python/report_generation.py`](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/report_generation.py) (Report generation), [`src/python/power_supply.py`](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/power_supply.py) (Power supply control), [`src/python/voltage_measurement.py`](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/voltage_measurement.py) (Voltage acquisition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Test interface"]
  node_ui["Test UI<br/>[user_interface.py]"]
end

subgraph group_execution["Test execution"]
  node_runner["Test runner<br/>[main.py]"]
  node_troubleshooting["Troubleshooting prompts<br/>[troubleshoot.py]"]
end

subgraph group_instruments["Measurement instruments"]
  node_power_control["Power supply control<br/>[power_supply.py]"]
  node_voltage_io["Voltage acquisition"]
  node_calibration["Calibration run<br/>[calibration.py]"]
end

subgraph group_results["Analysis and results"]
  node_calculations["Resistance calculations<br/>[calculations.py]"]
  node_reporting["Report generation"]
  node_result_files["Result files"]
end

node_tester(("Tester"))
node_supply{{"Programmable power supply"}}
node_arduino{{"Arduino ADC<br/>[ArduinoADC.ino]"}}
node_usb[("USB drive")]

node_tester -->|"enters test details"| node_ui
node_ui -->|"starts run"| node_runner
node_runner -->|"configures supply"| node_power_control
node_power_control -->|"controls and queries"| node_supply
node_runner -->|"requests readings"| node_voltage_io
node_voltage_io -->|"triggers and reads"| node_arduino
node_calibration -->|"sets test voltages"| node_power_control
node_calibration -->|"collects readings"| node_voltage_io
node_runner -->|"reports connection issue"| node_troubleshooting
node_runner -->|"requests reports"| node_reporting
node_reporting -->|"writes reports"| node_result_files
node_reporting -->|"checks for drive"| node_usb

click node_ui "https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/user_interface.py"
click node_runner "https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/main.py"
click node_troubleshooting "https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/troubleshoot.py"
click node_power_control "https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/power_supply.py"
click node_voltage_io "https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/voltage_measurement.py"
click node_arduino "https://github.com/catmudd/resistivity-testing-system/blob/main/src/arduino/ArduinoADC.ino"
click node_calibration "https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/calibration.py"
click node_calculations "https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/calculations.py"
click node_reporting "https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/report_generation.py"

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_ui toneBlue
class node_runner,node_troubleshooting,node_usb toneAmber
class node_power_control,node_voltage_io,node_calibration toneMint
class node_calculations,node_reporting,node_result_files toneRose
class node_tester,node_supply toneIndigo
class node_arduino toneTeal
```

## Components

### Test interface

- [Test UI](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/user_interface.py): `src/python/user_interface.py`

### Test execution

- [Test runner](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/main.py): `src/python/main.py`
- [Troubleshooting prompts](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/troubleshoot.py): `src/python/troubleshoot.py`

### Measurement instruments

- [Power supply control](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/power_supply.py): `src/python/power_supply.py`
- [Voltage acquisition](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/voltage_measurement.py): `src/python/voltage_measurement.py`
- [Calibration run](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/calibration.py): `src/python/calibration.py`

### Analysis and results

- [Resistance calculations](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/calculations.py): `src/python/calculations.py`
- [Report generation](https://github.com/catmudd/resistivity-testing-system/blob/main/src/python/report_generation.py): `src/python/report_generation.py`
- **Result files**

### Other components

- **Tester**
- **Programmable power supply**
- [Arduino ADC](https://github.com/catmudd/resistivity-testing-system/blob/main/src/arduino/ArduinoADC.ino): `src/arduino/ArduinoADC.ino`
- **USB drive**

## Connections

- Tester → Test UI: enters test details (evidence: `src/python/user_interface.py`)
- Test UI → Test runner: starts run (evidence: `src/python/user_interface.py`)
- Test runner → Power supply control: configures supply (evidence: `src/python/main.py`)
- Power supply control → Programmable power supply: controls and queries (evidence: `src/python/power_supply.py`)
- Test runner → Voltage acquisition: requests readings (evidence: `src/python/main.py`)
- Voltage acquisition → Arduino ADC: triggers and reads (evidence: `src/python/voltage_measurement.py`)
- Calibration run → Power supply control: sets test voltages (evidence: `src/python/calibration.py`)
- Calibration run → Voltage acquisition: collects readings (evidence: `src/python/calibration.py`)
- Test runner → Troubleshooting prompts: reports connection issue (evidence: `src/python/main.py`)
- Test runner → Report generation: requests reports (evidence: `src/python/main.py`)
- Report generation → Result files: writes reports (evidence: `src/python/report_generation.py`)
- Report generation → USB drive: checks for drive (evidence: `src/python/report_generation.py`)
