Skip to main content

A data acquisition library for streaming adc data from arduino due and more

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

daqopen_lib-0.7.6.tar.gz (894.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

daqopen_lib-0.7.6-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file daqopen_lib-0.7.6.tar.gz.

File metadata

  • Download URL: daqopen_lib-0.7.6.tar.gz
  • Upload date:
  • Size: 894.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for daqopen_lib-0.7.6.tar.gz
Algorithm Hash digest
SHA256 5d3b03b95c0b6612d5906e6c5d8aaf5d316533aa87cf3f3e8b6185f88be314ad
MD5 b85ece707b6f6022ad6eb41876481fef
BLAKE2b-256 ff67e8315ac35c3df95fa1376bd9073056a66a835fe2e6b826310f4c7235c586

See more details on using hashes here.

File details

Details for the file daqopen_lib-0.7.6-py3-none-any.whl.

File metadata

  • Download URL: daqopen_lib-0.7.6-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for daqopen_lib-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 330490f55d437df6f0088245112635e4dfaed7257afa1115f3135b741dbdfa74
MD5 8d984951c5772c77023dc952f8386a38
BLAKE2b-256 f30fb7749f785ff1202d76d70168188eaaec146d50ecd6b01ccddb95e7d30e2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page