Skip to content

QMUL/breksta

Repository files navigation

pre-commit

Introduction

Breksta is a data acquisition program that reads from photomultiplier tubes via the ADS1115 ADC on a Raspberry Pi. It aims to simplify collecting, monitoring, and exporting photodiode/PMT data. The app can also operate in a simulated mode for testing.

Features

  • User interface built with PySide6 and integrated with dash/plotly for real-time graphing.
  • Database integration for storing experiment metadata (via sqlalchemy).
  • Export functionality that records experiment data for later analysis.
  • Sine-wave generator algorithm to mock a signal for development and testing without dedicated hardware.

App GUI examples

Data acquisition. Click to expand image

Your Image Alt Text

Data export. Click to expand image

Your Image Alt Text

Pre-requisites

  • Linux-based OS (hardware tested on Manjaro, developed on Ubuntu)
  • Python 3.10+ (tested on 3.11 and 3.12)
  • Qt C++ libraries for PySide6
  • ADS1115 Interface package (see known issues)
  • Hardware:
    • Raspberry Pi (tested on a RPI4, but any Pi with I2C support should work if the libraries install correctly).
    • ADS1115 (address and gain configurable in the app).

Installation

Setup

  1. Create and activate a Python environment:

    python3 -m venv .venv  # to create the environment
    source .venv/bin/activate  # to activate it

    Remember to activate your enviroment before runtime or development tasks.

  2. Install the runtime and development packages:

    pip install -r requirements.txt       # Runtime dependencies
    pip install -r requirements-dev.txt   # Development dependencies (optional)

Running the Application

To run the application, from the root of the project activate the virtual environment and run:

source .venv/bin/activate  # ensure the environment is active
python -m app.breksta

By default, the application will attempt to detect the ADS1115 ADC. If your hardware is set up and recognized, it will be available to start monitoring automatically.

Selecting mock device for testing

If you do not have access to hardware or simply wish to test the application with fake data, set the following environment variable before running:

export USE_MOCK_DEVICE=1

This will generate a sine-wave signal in place of real ADC data.

Contributing

Contributions are welcome! Feel free to open an Issue or Pull Request for any improvements, bug fixes, or new features.

Code Quality

The project uses:

  • flake8, pylint, ruff for linting.
  • ruff for formatting.
  • pytest (plus coverage) for tests.
  • mypy for static typing checks.
  • pre-commit to automatically run checks on git commit and push.

For more usage details, see TOOLING.md.

License

This project is licensed under the Apache v2.0 license.

Funding

Breksta was developed by the Queen Mary University of London IT Research Department RSE team. ITR provided the funding and resources necessary to bring this project to life.

Appendix

ADC Integration

For detailed steps on enabling I2C on a Raspberry Pi, installing the modified ADS1x15 library, and troubleshooting permissions, see adc_integration.md.

Troubleshooting & Advanced Setup

For more information on environment setup, or errors like GPU acceleration, libtiff conflicts, or I2C permissions, see troubleshooting.md.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages