Author Topic: Data Acquisition Library for Python and Arduino Due  (Read 199 times)

0 Members and 1 Guest are viewing this topic.

Offline powerDaqTopic starter

  • Newbie
  • Posts: 2
  • Country: at
  • Stop guessing. Start measuring
    • DaqOpen
Data Acquisition Library for Python and Arduino Due
« on: January 06, 2025, 09:48:17 am »
Hello EEVblog community,

I’m excited to share a project I’ve been working on: daqopen-lib. This open-source library simplifies data acquisition, making it easier to handle medium-speed streaming ADC data for various applications.

Why I Built It:
Many projects require reliable and efficient data acquisition tools. I created daqopen-lib to streamline this process, starting with support for the Arduino Due, leveraging its high-speed ADC and USB 2.0 connectivity. It is a core part of my main project for power (quality) analysis and can be used separately for many other applications/projects which requires continous data acquisition.

Features:
  • ADC Driver: Easily communicate with Arduino Due and manage data using NumPy arrays.
  • Circular Channel Buffer: Efficiently handle and store data for analysis or visualization.
  • DAQ-Info Class: Description for data acquisition properties like scaling, samplerate.
  • firmware included for Arduino Due.

Background:
I use the Arduino Due (although it's more than 10 years old) because it has three main advantages for my use-cases:
  • ADC Speed up to 1 MS/s
  • Differential inputs with 12 bit resolution
  • USB 2.0 interface to connect to edge-device like Raspberry Pi and transfer with ~16 MBit/s
I use the native USB-interface and collect the data on the edge device via simple /dev/ttyACM0. The "driver" application is written in Python and converts the streamed packages to numpy arrays. Using the daq-zmq server-client allows you to decouple time-critical data reading from further processing in your target application.

How to Get Started:
The library is available on GitHub (https://github.com/DaqOpen/daqopen-lib), and documentation and tutorials can be found here: docs.daqopen.com.

Related projects
I'm actively developing and using this library for my main project PQopen. This will be an open source power (quality) analyzer for power networks. It is still under development.

Some example apps, including the daq-zmq-server, are available in a separate repository:
https://github.com/DaqOpen/daqopen-apps

I’d love to hear your thoughts, suggestions, and ideas for improvement. Looking forward to your input!

Best regards,
Michael

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 7094
  • Country: ro
Re: Data Acquisition Library for Python and Arduino Due
« Reply #1 on: January 06, 2025, 10:03:26 am »
Wow, thank you!  :-+

Will give it a look.  Is there any way to add a timestamp to the data?

Offline powerDaqTopic starter

  • Newbie
  • Posts: 2
  • Country: at
  • Stop guessing. Start measuring
    • DaqOpen
Re: Data Acquisition Library for Python and Arduino Due
« Reply #2 on: January 06, 2025, 10:20:22 am »
Is there any way to add a timestamp to the data?
I mainly use the daq-zmq-server.py (https://github.com/DaqOpen/daqopen-apps/blob/main/daq-zmq-server.py) as application, which adds a timestamp to the data with relatively low latency. In the receiving main application you can rebuild the timestamp and extend it to a continous one with the AcqBufferPool. There is no "real" example available for now, but you can get an idea from the method start_transfer from the client app https://github.com/DaqOpen/daqopen-apps/blob/main/daq-zmq-viewer.py.
 
The following users thanked this post: RoGeorge


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf