Metadata-Version: 2.4
Name: pratico-sensor
Version: 3.0.0
Summary: PRATICO 3 firmware: low-cost Raspberry Pi colorimeter for nitrate and phosphate (FreshWater Watch kits)
Author: Riccardo Gaetano Cirrone
License-Expression: GPL-3.0-only
Project-URL: Homepage, https://github.com/LowCostSensor/PRATICO-sensor
Project-URL: Documentation, https://github.com/LowCostSensor/PRATICO-sensor/tree/main/docs
Project-URL: Changelog, https://github.com/LowCostSensor/PRATICO-sensor/blob/main/CHANGELOG.md
Project-URL: Paper, https://doi.org/10.1021/acsestwater.5c00314
Keywords: colorimeter,nitrate,phosphate,raspberry-pi,citizen-science,water-quality
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Chemistry
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: adafruit-blinka; platform_system == "Linux" and platform_machine in "aarch64 armv7l armv6l"
Requires-Dist: gpiod<3,>=2.2.2; platform_system == "Linux" and platform_machine in "aarch64 armv7l armv6l"
Requires-Dist: adafruit-circuitpython-ltr329-ltr303>=3.0.6; platform_system == "Linux" and platform_machine in "aarch64 armv7l armv6l"
Requires-Dist: RPLCD>=1.3; platform_system == "Linux" and platform_machine in "aarch64 armv7l armv6l"
Requires-Dist: smbus2; platform_system == "Linux" and platform_machine in "aarch64 armv7l armv6l"
Requires-Dist: RPi.GPIO; platform_system == "Linux" and platform_machine in "aarch64 armv7l armv6l"
Dynamic: license-file

# pratico-sensor

Firmware for **PRATICO 3**, a low-cost colorimeter for nitrate (N‑NO₃) and phosphate (P‑PO₄) that
reads FreshWater Watch test kits. It runs on a Raspberry Pi Zero 2 W with an LTR‑329 light sensor, a
525 nm LED, a 16×2 LCD and two buttons.

Hardware, build guide and documentation: **https://github.com/LowCostSensor/PRATICO-sensor**

## Install (on the Raspberry Pi)

```bash
sudo apt install -y pipx python3-dev
pipx install pratico-sensor
pipx ensurepath          # then log out and in again
```

Set up the I²C buses first, as in the
[setup guide](https://github.com/LowCostSensor/PRATICO-sensor/blob/main/docs/2-raspberry-setup.md).

## Commands

| Command | What it does |
|---|---|
| `pratico-selftest` | hardware self test: dark level, LED level, noise |
| `pratico-cal` | calibration with standard solutions, over SSH ([guide](https://github.com/LowCostSensor/PRATICO-sensor/blob/main/docs/3-calibration.md)) |
| `pratico-field` | field program: buttons + LCD ([guide](https://github.com/LowCostSensor/PRATICO-sensor/blob/main/docs/4-field-use.md)) |
| `pratico-service install` | start the field program at every power-on (systemd user service) |

`pratico-selftest`, `pratico-cal` and `pratico-field` accept `--simulate` to run without hardware, for
example on a PC. Calibration,
results and logs are kept in `~/PRATICO_3/`. Settings can be overridden in
`~/PRATICO_3/pratico3_config.json`.

## Upgrade

```bash
pipx upgrade pratico-sensor
pratico-service install       # restart the field program on the new version
```

## Citation

Cirrone R. G. et al. Low-Cost Optical Sensing for Nitrate and Phosphate: Advancing Community
Freshwater Monitoring. *ACS ES&T Water* **2025**, 5, 6258–6267.
[doi:10.1021/acsestwater.5c00314](https://doi.org/10.1021/acsestwater.5c00314)

License: GPL-3.0.
