jolau / OsciDAQ

Data Acquisition (DAQ) with the Analog Discovery 2 oscilloscope.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OsciDAQ

Data Acquisition (DAQ) with the Analog Discovery 2 oscilloscope. The OsciDAQ was developed as part of an internship at Wingtra by Jonas Lauener.

For any technical questions, please open an issue: https://github.com/jolau/OsciDAQ/issues/new/choose

Copyright (c) 2020, Jonas Lauener & Wingtra AG
License: MPL 2.0 oscidaq

Index

Hardware

Capabilities

Two-channel oscilloscope:

  • 1MΩ
  • ±25V
  • differential
  • 14-bit
  • 100Msample/sec
  • 30MHz+ bandwidth (with the Analog Discovery BNC Adapter Board)

Other features for data acquisition are not yet supported by this toolchain.

Pinout

pinout

General Workflow

  1. Do the acquisition of the data with the official Waveforms software. The data is logged in the proprietary, binary file format TDMS.
  2. Convert the TDMS files to CSV.
  3. Plot and analyze the CSV files.

Acquisition

The acquisition is done with the official Waveforms software. With the prepared logging script, it records the samples in the TDMS file format.

Installation

In case you want to setup your own OsciDAQ on a Raspberry Pi:
Remark: The Analog Discovery 2 works only with the Raspberry Pi 4.

  1. Plug the Analog Discovery 2 to a USB 3.0 port on the Raspberry.
  2. Install Adept 2 Runtime. Last tested version: 2.20.1
  3. Install latest 32bit Waveforms beta. Last tested version: 3.13.20

Usage

waveforms

Workflow

Before measurement campaign
  1. Connect oscilloscope to the signals you wish to investigate → Pinout
  2. Connect to OsciDAQ and open the template_logging.dwf3work workspace
  3. Make your adjustment until you get your signal right
  4. Save as... workspace
At measurement campaign
  1. Connect to OsciDAQ and open your prepared workspace
  2. Make sure Each acquisition is selected in Logging
  3. Press Run
After measurement campaign
  1. Download the collected data (by default under ~/Documents/scope) over SFTP
  2. Proceed with Conversion

Connect to OsciDAQ

  1. Connect your laptop to the OsciDAQ by Ethernet.
  2. Find the IP address with sudo arp-scan --interface=eth0 --localnet
  3. Connect with the VNC Viewer to the Raspberry Pi.

Conversion

The binary TDMS files coming from the Waveforms software have to be converted to CSV files - this is done using a custom python script.

Installation

Install the converter script on your PC: Run: pip3 install -r OsciConverter/requirements.txt

Usage

Workflow

  1. Identify the UTC timestamp when the interesting stuff happened
  2. Identify which batch folder contains the selected timestamp
  3. Convert the TDMS files to CSV in that batch folder

Convert TDMS to CSV

Run python OsciConverter/tdms_convert.py [path to the batch directory with the TDMS files]

The csv files are stored in a directory named [tdms_files_directory]_csv located next to the directory stated above.

Run python OsciConverter/tdms_convert.py -h to see all available options.

Preview TDMS

Run python OsciConverter/tdms_preview.py [path to tdms file] to preview data of one file as a plot.

Analysis

You can use whatever tool you like to analyze the csv files, but I recommend you to use the BeSpice Wave software. bespice

Installation

Download and install the BeSpice Wave software on your PC.

Usage

Open the previously converted CSV files in BeSpice Wave

Example data

As a proof-of-concept I did some logging on an I2C port (SDA/SCL):

About

Data Acquisition (DAQ) with the Analog Discovery 2 oscilloscope.

License:Mozilla Public License 2.0


Languages

Language:Python 62.0%Language:JavaScript 38.0%