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-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()
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:
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
Built Distribution
File details
Details for the file daqopen_lib-0.3.0.tar.gz
.
File metadata
- Download URL: daqopen_lib-0.3.0.tar.gz
- Upload date:
- Size: 89.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f02573a176dfdc61feab543cd4f4cf5043a4f63d906d071148d7bf497ab027d |
|
MD5 | 779dfc4d391a68282a86e286adf19f66 |
|
BLAKE2b-256 | 95ca6eeac09de2339cefdd7cc56a9872e77fb6883a31276c42b95ffee929b119 |
File details
Details for the file daqopen_lib-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: daqopen_lib-0.3.0-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9b76ddd449151bc44030addd408590418625ec12582ac948ed67d6d9bdcae28 |
|
MD5 | bb383fff3255c61a4323631282bc13ed |
|
BLAKE2b-256 | cfd2d75ce2b69d708eed2dc449d4a602ff679f3dda521069b843b0e409c35885 |