Skip to main content

daqopen-lib

This library can be used for various data acquisition tasks to proper handle streaming ADC data for building data acquisition applications.

Documentation incl. tutorials can be found here: docs.daqopen.com

Initially, it is build around the Arduino Due, which has a high-speed ADC with good accuracy and a data transfer via USB 2.0. Most of the examples and driver uses this model together with the firmware which can be found in the firmware folder.

Schema-Bild

Features

  • ADC driver: Driver for communicating with Arduino Due (included firmware) and packing the data to numpy arrays.
  • Circular Channel Buffer: A class representing a circular buffer for holding needed amount of data for viewing, calculating and storing.
  • DAQ-Info Class: Can be used to exchange informations regarding the interpretation of the data packages. It holds adjustment values and info about the acquisition rate.
  • ZMQ-Support: Transfer the acquired data in realtime via zmq to other applications or hosts

Intended Use

This library should be used if:

  • you build long-running acquisition applications (e.g. measurement devices)

Installation

Installation from pypi:

pip install daqopen-lib

Install latest directly from Github:

git clone https://github.com/DaqOpen/daqopen-lib.git
cd daqopen-lib
pip install -e .

Usage

SIM (no hardware)

from daqopen.duedaq import DueDaq
import matplotlib.pyplot as plt

# Create Instance of DueDaq
myDaq = DueDaq(serial_port_name="SIM")

# Start acquisition device
myDaq.start_acquisition()

# Read the buffer 10 times
for i in range(10):
    data = myDaq.read_data()

# Hold acqusition device
myDaq.stop_acquisition()

# Plot Data of last buffer
plt.plot(data)
plt.show()

image-20241010124001678

Arduino Due

Setting up Arduino IDE

  • Download Arduino IDE for your plattform and start the app
  • Install the Package to support SAM-Controllers: Arduino SAM Boards (32-bits ARM Cortex- M3) by Arduino of version 1.6.12

Compiling and Downloading

  • Open the sketch-file from firmware/due-daq/due-daq.ino
  • Connect the Arduino Due to the "Programming Port" (the port near to the power socket)
  • Compile and upload the firmware
  • Disconnect from the "Programming Port"

Now, connect the "Native USB Port" (the port near the reset toggle) and use the following sketch for testing the Arduino acquisition:

from daqopen.duedaq import DueDaq
import matplotlib.pyplot as plt

# Create Instance of DueDaq (use empty port name for automatic search)
myDaq = DueDaq()

# Start acquisition device
myDaq.start_acquisition()
for i in range(10):
    data = myDaq.read_data() # read buffer

# Hold acqusition device
myDaq.stop_acquisition()

# Plot Data of last buffer
plt.plot(data)
plt.show()

You should see something like this:

my-first-acq-1

Congratulations!

For more Examples see docs.daqopen.com

Roadmap

A quick and dirty roadmap to show what is planned for the future:

  • More practical examples
  • Raspberry Pi Pico as DAQ device
  • ...

Contributing

I welcome contributions to DaqOpen! If you'd like to contribute, please fork the repository, create a new branch, and submit a pull request.

License

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

Logo_200px

Metadata

Release files for daqopen-lib 0.7.9

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

Source distribution (sdist)

Source distribution for daqopen-lib 0.7.9
File Size Uploaded Provenance Actions
daqopen_lib-0.7.9.tar.gz 2.6 MB Without provenance Details for daqopen_lib-0.7.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for daqopen-lib 0.7.9
File Interpreter ABI Platform Actions
daqopen_lib-0.7.9-py3-none-any.whl Python 3 none any Details for daqopen_lib-0.7.9-py3-none-any.whl

Total release size: 2.6 MB

Release files / daqopen_lib-0.7.9.tar.gz

Download URL daqopen_lib-0.7.9.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
5d969e1ac50b56bdb0383c784db8f7dca99c197ebdc068cc3b35767d016f2109
BLAKE2b-256 checksum
How to use checksums
77edae6802c3bf74ec4d90e37dcbe41462907b5a62e8112a31449cb804b6caa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / daqopen_lib-0.7.9-py3-none-any.whl

Download URL daqopen_lib-0.7.9-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbf73a9d273c52b3dd8e8eceda8f6dc74a51cd1f224edc69e45babfa5908547e
BLAKE2b-256 checksum
How to use checksums
ec850618e6c7acd11c40bbea6f3944df64dc54966d32f8b6d415f46e63149094
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for daqopen-lib 0.7.9

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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