Skip to main content
Regolith Water Loop Logo

Regolith Water Loop

Three-stage water pre-treatment column: bioremediated regolith, pyrolysis biochar, and a gravity feed. Bench-built and tested.

Leonardo Salas · rwl.leonardosalas.dev


Sponsor Regolith Water Loop on GitHub Sponsors

Built and documented in the open by one person. Sponsorship keeps it that way.



What this is

A habitat has to detoxify its own soil, handle the waste it produces every day, and recycle water. Solved separately those are three problems. Solved together they are one machine, where the furnace that processes waste also keeps the bioreactor warm and fed, and both of them produce the material the filter is made of.

This repository holds the design, the bench build, and the code that measures whether it works.

docs/system.md The three stages and how they depend on each other
docs/mars.md Mars conditions, sizing for six crew and habitat requirements
docs/method.md How turbidity is measured from photographs
docs/protocol.md Greywater recipe, grading, calibration and run procedure
docs/build.md Build log with photographs and measured volumes
docs/results.md First runs and what they show
docs/print/target-sheet.pdf Printable checker target and white card for the rig
docs/drawings/ Bench drawings RWL-001 and RWL-002, system schematics RWL-003 and RWL-004
docs/references.md Every source, checked against the claim it supports
GLOSSARY.md Terms used throughout

Stage 2, the filtration column, is the stage built and tested on the bench; see docs/results.md. Stages 1 and 3 are supported by published work. Perchlorate salts are strong oxidisers and are not handled in this project.


Measuring turbidity

Removal is measured from photographs rather than an electronic probe: a phone camera is available and free, a nephelometer is not. A printed target behind the sample loses contrast as suspended solids rise, and a white card in frame cancels exposure differences between shots.

Results are relative to the influent, never reported in NTU.

pip install -e .

rwl measure photos/*.jpg --setup setup.json --out readings.csv
rwl calibrate --readings readings.csv --levels levels.csv --out calibration.json
rwl report --readings readings.csv --calibration calibration.json \
    --before influent --after effluent

Read docs/method.md before shooting a session. The rig has to stay fixed or the series is void.

Sizing

rwl size --crew 6 --base early

Greywater, filter area under Mars gravity, char output and perchlorate stoichiometry for a crew. Every constant is cited in src/rwl/sizing.py.

Development

pip install -e '.[dev]'
pytest

Documentation site

A static site under site/, English at the root and Spanish under /es/.

pnpm install --dir site
pnpm --dir site dev # development
pnpm --dir site build # static export into site/out/

Building the PDF

The whole technical document is assembled from these Markdown files and the SVG drawings with doc-engine-cli. doc-engine.md is the manifest.

pipx install doc-engine-cli
doc-engine build doc-engine.md

Docker

docker compose up site # site on http://localhost:8080
docker compose run --rm rwl --help

Share this project

Share the link directly or scan the code: rwl.leonardosalas.dev

QR code linking to the project

Support

If this is useful to you, sponsorship on GitHub funds the parts, the materials and the time that go into documenting it properly.


License

Licensing is split by what you are using:

  • Source code — MIT. Use, modify and build on it freely.
  • Documentation, guides and media — CC BY 4.0. Share and adapt with credit.

Metadata

Release files for rwl 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rwl 0.1.0
File Size Uploaded
rwl-0.1.0.tar.gz 19.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rwl 0.1.0
File Interpreter ABI Platform
rwl-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.1 kB

Release files / rwl-0.1.0.tar.gz

Download URL rwl-0.1.0.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
452ee556c54c978aaeba96dbe79423bb4d20bea99e669c6e270a342e3ddccf0f
BLAKE2b-256 checksum
How to use checksums
c5851cd878029f356c6c50cc913cb05f567f46e3eddb146eeae78485143ec6b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / rwl-0.1.0-py3-none-any.whl

Download URL rwl-0.1.0-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e34f0cd3aafea458b254fbf1087afe96b3469dbc2ad95accb333bcb304f39896
BLAKE2b-256 checksum
How to use checksums
3cec5deab69f2ffed503294aeb36d71cc5e492993c9c500c00722f5d749e4456
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page