Skip to content

AccelerationConsortium/dose_every_well

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dose Every Well

Precision weighing and dosing system for microplate automation.

A Python package for automated gravimetric workflows combining precision weighing, plate handling, and optional CNC or Opentrons integration.

Python License Platform


What is MicroDoser?

MicroDoser is a weighing station that can optionally integrate with dosing systems:

MicroDoser = Balance + Plate Loader + Optional Dosing System

Core Components

  • ✅ Sartorius Balance - Precision gravimetric measurement
  • ✅ Motorized Plate Loader - Automated plate handling with collision avoidance
  • ⚙️ CNC Dosing System (optional) - Automated solid dispensing
  • ⚙️ Opentrons Integration (future) - Liquid handling support

Quick Start

Installation

On Raspberry Pi 5 (default):

git clone https://github.com/AccelerationConsortium/dose_every_well.git
cd dose_every_well

# Install (includes all Raspberry Pi dependencies by default)
pip install -e .

On other platforms (development/testing only):

# Hardware features will not work without Raspberry Pi
pip install -e .

Standalone Weighing Station

Manual dosing with automated weighing:

from dose_every_well import MicroDoser

doser = MicroDoser(
    balance_port='/dev/ttyUSB1',
    plate_type='shallow_plate'
)

doser.load_plate()
input("Add material, press Enter...")
mass = doser.read_balance()
print(f"Mass: {mass * 1000:.2f} mg")
doser.unload_plate()
doser.shutdown()

With CNC Automated Dosing

Full automation with gravimetric verification:

from dose_every_well import MicroDoser, CNCDosingSystem

# Initialize dosing system
dosing_system = CNCDosingSystem(cnc_port='/dev/ttyUSB0')
dosing_system.initialize()

# Initialize MicroDoser
doser = MicroDoser(
    balance_port='/dev/ttyUSB1',
    plate_type='shallow_plate',
    dosing_system=dosing_system
)

# Dose with verification
doser.load_plate()
result = doser.dose_to_well('A1', target_mg=5.0)
print(f"Target: {result['target_mg']:.2f} mg, Actual: {result['actual_mg']:.2f} mg")
doser.unload_plate()
doser.shutdown()

Features

🎯 High-Level API

  • Simple, intuitive Python interface for common workflows
  • REST API for remote control via HTTP
  • Automatic coordination of all hardware components
  • Built-in gravimetric verification

⚖️ Precision Weighing

  • Sartorius balance integration
  • Automatic taring and measurement
  • mg-level precision

🤖 Automated Plate Handling

  • Motorized loading/unloading
  • Collision avoidance for different plate types
  • Configurable via YAML

📊 Gravimetric Verification

  • Measure before and after dosing
  • Calculate actual dispensed amount
  • Track dosing accuracy

🔧 Flexible Integration

  • Works standalone or with CNC
  • Future-ready for Opentrons
  • Modular architecture

📝 Production-Ready

  • Comprehensive error handling
  • Detailed logging
  • Safe shutdown procedures

Documentation

Document Description
Quick Start Installation, setup, and basic usage
Python API Complete Python API reference
Web API REST API service for remote control
Architecture & Configuration System design and configuration
Examples Detailed workflow examples

Examples

Pre-built example scripts in examples/:

# Standalone weighing
python examples/example_standalone.py

# CNC automated dosing
python examples/example_with_cnc.py

# Calibrate flow rate
python examples/example_calibration.py

Hardware Requirements

Core System (Required)

  • Raspberry Pi 5 (primary target, or Pi 3/4)
  • Sartorius precision balance (USB serial)
  • PCA9685 16-channel PWM HAT (I2C 0x40)
  • 3× Servo motors (plate loader)
  • 5V 5A power supply
  • MicroSD card (32GB+ recommended)
  • Raspberry Pi OS (64-bit recommended)

For Automated Solid Dosing (Optional)

  • CNC controller (GRBL-compatible, USB serial)
  • 1× Servo motor (gate control)
  • 1× 5V relay module (motor control)
  • 1× DC motor (auger/feeder)

For Liquid Handling (Future)

  • Opentrons OT-2 robot
  • Network connection

System Architecture

┌─────────────────────────────────────────────────┐
│                  MicroDoser                     │
│  (High-level orchestration & coordination)      │
└────────┬────────────────────────┬───────────────┘
         │                        │
    ┌────▼─────┐           ┌──────▼────────┐
    │  Core    │           │    Optional    │
    │Components│           │ Dosing System  │
    └────┬─────┘           └────────┬───────┘
         │                          │
    ┌────▼─────────┐         ┌──────▼────────────┐
    │  Balance     │         │  CNCDosingSystem  │
    │  (Sartorius) │         │  (CNC + Solid     │
    ├──────────────┤         │   Doser)          │
    │ Plate Loader │         └───────────────────┘
    │ (PCA9685 +   │         
    │  3 Servos)   │         
    └──────────────┘         

Project Structure

dose_every_well/
├── docs/                       # Documentation
│   ├── getting-started.md      # Installation & setup
│   ├── api-reference.md        # Complete API docs
│   ├── configuration.md        # Config guide
│   ├── examples.md             # Example workflows
│   └── architecture.md         # System design
│
├── examples/                   # Example scripts
│   ├── example_standalone.py   # Weighing station
│   ├── example_with_cnc.py     # Automated dosing
│   └── example_calibration.py  # Calibration
│
├── src/dose_every_well/        # Main package
│   ├── core.py                 # MicroDoser class
│   ├── dosing_system.py        # CNCDosingSystem
│   ├── config/                 # YAML configs
│   │   ├── standalone.yaml
│   │   └── with_cnc.yaml
│   ├── cnc_controller.py       # CNC control
│   ├── plate_loader.py         # Plate loader
│   ├── solid_doser.py          # Solid doser
│   └── sartorius_balance.py    # Balance
│
└── README.md                   # This file

Use Cases

1. Manual Dosing + Automated Weighing

  • User doses materials by hand
  • System handles plate loading and weighing
  • Ideal for method development

2. Fully Automated Solid Dosing

  • CNC positions over wells
  • Solid doser dispenses material
  • Balance verifies each dose
  • Ideal for high-throughput workflows

3. Liquid + Solid Workflows (Future)

  • Opentrons handles liquids
  • MicroDoser verifies masses
  • Combined liquid/solid experiments

Platform Support

Platform Status Notes
Raspberry Pi 5 Primary Target Full hardware support with rpi-lgpio
Raspberry Pi 3/4 ✅ Supported Full hardware support with standard GPIO
Linux (Ubuntu/Debian) ⚠️ Limited Development/CNC control only
macOS / Windows ⚠️ Limited Development/CNC control only

Note: This package is designed for Raspberry Pi hardware. Other platforms can be used for development and CNC control, but full functionality requires Raspberry Pi.


Safety

Important Safety Practices:

  • ✅ Test in simulation before hardware execution
  • ✅ Verify movement boundaries match your machine
  • ✅ Keep emergency stop accessible
  • ✅ Clear work area before automated runs
  • ✅ Monitor first runs carefully

Roadmap

Current Features (v0.7)

  • ✅ Python API for direct hardware control
  • ✅ REST API for remote control
  • ✅ Automated plate loading/unloading
  • ✅ Precision gravimetric measurement
  • ✅ CNC-based solid dosing
  • ✅ Gravimetric verification
  • ✅ Auto-start service on boot

Planned Features

v0.8 - Workflow Implementation & Testing

  • 🔲 Predefined workflow templates
  • 🔲 Custom workflow builder
  • 🔲 Workflow validation and testing
  • 🔲 Batch processing optimization
  • 🔲 Error recovery strategies
  • 🔲 Workflow logging and replay

v0.9 - PID Control

  • 🔲 PID controller for gravimetric dosing
  • 🔲 Real-time weight feedback control
  • 🔲 Adaptive dosing based on target
  • 🔲 Flow rate auto-adjustment
  • 🔲 Precision tuning parameters
  • 🔲 Target accuracy improvements

v1.0 - Web UI

  • 🔲 Web-based dashboard for system control
  • 🔲 Real-time status monitoring
  • 🔲 Interactive well plate visualization
  • 🔲 Dosing workflow builder interface
  • 🔲 Historical data visualization
  • 🔲 Mobile-responsive design

v1.1 - Advanced Features

  • 🔲 WebSocket support for real-time updates
  • 🔲 Job queue for long-running operations
  • 🔲 Database logging of all operations
  • 🔲 User authentication and authorization
  • 🔲 API rate limiting
  • 🔲 Multi-user support

v2.0 - Opentrons Integration

  • 🔲 Opentrons OT-2 integration
  • 🔲 Combined liquid + solid workflows
  • 🔲 Unified control interface
  • 🔲 Protocol import/export

Future Considerations

  • 🔲 Iterative dosing with feedback control
  • 🔲 Multi-tool support (hot-swappable)
  • 🔲 Cloud data synchronization
  • 🔲 Machine learning for dose optimization
  • 🔲 Integration with LIMS systems

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

For major changes, open an issue first to discuss.


License

This project is licensed under the MIT License - see the LICENSE file for details.


Citation

If you use this package in your research, please cite:

@software{dose_every_well,
  author = {Cao, Yang},
  title = {Dose Every Well: Precision Dosing and Weighing System},
  year = {2025},
  url = {https://github.com/AccelerationConsortium/dose_every_well}
}

Author

Yang Cao
Email: yangcyril.cao@utoronto.ca


Acknowledgments

Built for laboratory automation workflows with a focus on microplate gravimetric applications.


Need help? Check the documentation or open an issue on GitHub.

About

A CNC-gantry based solid dosing module for microplates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages