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

# 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.1.0.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

daqopen_lib-0.1.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: daqopen_lib-0.1.0.tar.gz
  • Upload date:
  • Size: 52.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 6bc47b8ca3a6948fc81950e575c0a87e47fa61e1b1691810b2e25a79f646c0b9
MD5 1c6e47506e1d84ee68e7b95dc9a8df25
BLAKE2b-256 5cf692cb117e8f1b16a78f3ab774856f383caeb66ac678428bb67458b5dc5d47

See more details on using hashes here.

File details

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

File metadata

  • Download URL: daqopen_lib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bcd760fdb92874b590eb0e6203db4f66a39a7dfa0211ceb46bdddf7baf0fe8d
MD5 085b2867a6c2c734ddebcd7cb8ca7e76
BLAKE2b-256 87582bf9960a286bebe6285fe1c5902072ec00af7368fd03dfbd172d23f73ae8

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