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.

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.

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

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

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

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.2.0.tar.gz (87.5 kB view details)

Uploaded Source

Built Distribution

daqopen_lib-0.2.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: daqopen_lib-0.2.0.tar.gz
  • Upload date:
  • Size: 87.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for daqopen_lib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1a9121b7b9454b6cbbfb2865a1477f8205f815c55040b1095421a92b76afb2a2
MD5 3a2f676996f4fa918701eb39890ca0b2
BLAKE2b-256 e6df54b7c93cd759c4ee3dfc03200b0c20029733b54dae4671d7b87dec125ca1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: daqopen_lib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for daqopen_lib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4967b5667ffe6ee3a510fce38851a4511af28c0ed25cdf93728521879a1a170
MD5 076569100ddeaac6aca9af7216501afe
BLAKE2b-256 258d067d800fa95475ec9f3d4511f5f5cd8107016142d7a9fca5c64413284176

See more details on using hashes here.

Supported by

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