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.

Further documentation can be soon 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

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

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

# Hold acqusition device
myDaq.stop_acquisition()

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

# Create Instance of DueDaq (use empty port name for automatic search)
myDaq = DueDaq(serial_port_name="", sim_packet_generation_delay=0.1)

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

# Hold acqusition device
myDaq.stop_acquisition()

You should see something like this:

example-cmd-output

Congratulations!

See daqopen-apps repository for more examples

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

Uploaded Source

Built Distribution

daqopen_lib-0.0.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for daqopen_lib-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e87ae4f68f7fa7f67e6f81d6d8887cdfe0e2ac83b22568a6f0fb380c168bf00d
MD5 5cd3a809c500b3ce2b96b9a17e4451ba
BLAKE2b-256 534523e714d2fcf5c499f3a529331b6e4b108d1927997d5dd528aa9fc17864b6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for daqopen_lib-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 239ce5e54a83e2464a29682a3bb0d8981a522765760ce80fdda9318a9db2b24c
MD5 d86054d527e6eedfb735a8c8ebc37262
BLAKE2b-256 daf88cc2e187b0fc0884f41901a635e08b3cbdc2276fab3d2a6142891c3690b3

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