Overview

OpenReef is an open-source Raspberry Pi-based colorimeter for automated water quality testing. The web-controlled system provides phosphate and nitrate measurements for ๐Ÿ  Reef aquarium monitoring, hydroponics, and environmental testing.

Key Features

  • Web-Based Control: Access from phone, tablet, or computer on your network
  • Remote Monitoring: Check water quality from anywhere
  • Automated Sequences: Pre-programmed test protocols with motors, valves, and timers
  • Real-Time Display: Live sensor readings and interactive controls
  • Multi-Channel: Support for 4 motors and 8 solenoid valves
  • Editable Calibrations: Web-based JSON configuration for custom calibrations
  • Open Source: Complete hardware designs, Python code, and documentation
  • Cost Effective: ~$200-250 build cost using Raspberry Pi and Adafruit components
  • No Display Required: Headless operation with web interface

๐Ÿ“– Documentation

๐Ÿงช Assay Protocols

๐Ÿ”ง Hardware

๐Ÿ’ป Software


System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚      Raspberry Pi + Flask Server         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚  TSL2591   โ”‚  โ”‚  Motor HAT       โ”‚   โ”‚
โ”‚  โ”‚  Sensor    โ”‚  โ”‚  Solenoid Driver โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚               โ”‚
    Measurement     Hardware Control
         โ”‚               โ”‚
         โ”‚          โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚          โ”‚  Motors (4ร—) โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”    โ”‚  Solenoids(8ร—)โ”‚
    โ”‚ Cuvette โ”‚    โ”‚  Reagents    โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ–ฒ
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚   Web Browser UI    โ”‚
    โ”‚  (Phone/Tablet/PC)  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Component Summary

Component Function Details
Raspberry Pi Main controller Web server, automation, remote access
TSL2591 Light sensor Absorbance measurements
Motor HAT Motor control 4 DC motors for pumps/stirring
MCP23017 Solenoid driver 8-channel valve control
Web UI User interface Responsive web app, any device

Assay Comparison

Feature Phosphate Nitrate
Chemistry Ascorbic acid method Cadmium reduction + Griess
Wavelength 880 nm (NIR) 528 nm (Green)
Range 0-30 ppm POโ‚„ 0-90 ppm NOโ‚ƒ
Reaction Time 5-10 min* 5+ min
Total Time ~12 min ~10 min

*Critical timing - phosphate measurements must be taken within 5-10 minute window


Project Status

โœ… Raspberry Pi Version - Ready to Build!

Completed

  • โœ… Raspberry Pi web interface (Flask)
  • โœ… Hardware control (motors, solenoids, sensor)
  • โœ… Automated command sequences
  • โœ… Web-based configuration editors
  • โœ… Calibration system
  • โœ… Real-time measurements and display
  • โœ… Systemd service automation
  • โœ… Comprehensive documentation

In Progress

  • ๐Ÿ”จ CAD designs (3D printable enclosure and mounts)
  • ๐Ÿ”จ Hardware assembly guide with photos
  • ๐Ÿ”จ Assay-specific calibration protocols
  • ๐Ÿ”จ PCB design (optional, for cleaner wiring)

Planned

  • ๐Ÿ“‹ Sensor multiplexer support (multi-sensor switching)
  • ๐Ÿ“‹ Data visualization and trending
  • ๐Ÿ“‹ Additional assays (ammonia, silicate)
  • ๐Ÿ“‹ Mobile app (optional)

Getting Started

Build Your Raspberry Pi Colorimeter

Estimated Cost: $200-250

  1. Order Components
    • Hardware Guide - Complete parts list with Adafruit PIDs
    • Raspberry Pi 3/4/5
    • TSL2591 light sensor
    • Motor HAT, solenoid driver
    • Fluidics components
  2. Install Software
    • Setup Guide - Step-by-step instructions
    • Install Raspberry Pi OS or Ubuntu Server
    • Clone repository and install dependencies
    • Run automated service installer
  3. Connect Hardware
    • Stack Motor HAT on Raspberry Pi GPIO
    • Connect TSL2591 sensor via I2C
    • Connect MCP23017 solenoid driver
    • Wire motors and valves
  4. Configure & Calibrate
    • Access web interface at http://raspberrypi.local:5000
    • Edit device names in mappings.json
    • Create calibration curves
    • Calibration Guide
  5. Run Automated Tests!
    • Create command sequences
    • Mix motors, solenoids, waits, blanking, measurements
    • Monitor from any device on your network
    • Save and load test protocols

Contributing

This is an open-source project. Contributions welcome!

  • ๐Ÿ“ Documentation: Improvements and corrections
  • ๐Ÿ’ป Firmware: CircuitPython code development
  • ๐Ÿ”ง Hardware: Enclosure designs, PCB layouts
  • ๐Ÿงช Testing: Validation and QC data

License

This project is licensed under the MIT License.

Based on:


Acknowledgments

Built with:

  • AdaFruit - PyBadge, sensors, electronics
  • CircuitPython - Embedded Python platform
  • Red Sea Pro Test Kits - Reagent chemistry

Built with passion for the reef keeping and maker communities.

๐Ÿ  ๐Ÿชธ ๐Ÿงช ๐Ÿ”ฌ ๐Ÿค–