MATLAB-Based Real-Time Data Acquisition Tool for Multimodal Biofeedback and Arduino-Based Instruments: Arduino Firmata Data Acquisition (AfDaq)

MATLAB-Based Real-Time Data Acquisition Tool for Multimodal Biofeedback and Arduino-Based Instruments: Arduino Firmata Data Acquisition (AfDaq)

Kulbhushan Chand, Arun Khosla
Copyright: © 2022 |Pages: 20
DOI: 10.4018/JITR.299922
Article PDF Download
Open access articles are freely available for download

Abstract

AfDaq is an open-source, plug and play, MATLAB based tool that offers the capabilities of multi-channel real-time data acquisition, visualization, manipulation, and local saving of data for offline analysis. The MATLAB Arduino package suffers from serious timing jitter during real-time data acquisition. This timing jitter associated with four main commands (Analog Read, Digital Read, Digital Write and PWM Set) available in MATLAB Arduino package is statistically analyzed and a simple post-hoc timing jitter correction mechanism is proposed to acquire data points with high timing accuracy. The benchmark of the final program is conducted at various sampling rates for multichannel acquisition with 10 Hz comes as the maximum sampling rate for 5 channel recording. In the end, a use case of the developed tool for physiological data acquisition in multimodal biofeedback is presented. The software tool, data, and analysis scripts that support the findings of this study are released as an open-source project to support the replicability and reproducibility of the research.
Article Preview
Top

1. Introduction

Researchers from different fields frequently require data acquisition devices to record various signals relevant to their field of interest. In some cases, scientific research requires the development of experimental setups and novel methods to capture unknown phenomenon and signals of interest while others rely on expensive proprietary data acquisition devices. However, there is a significant proportion of researchers including students of universities, school-going students, and hobbyists, for their preliminary data acquisition needs, requires an inexpensive and quick to deploy which can be realized with limited engineering capabilities, falls under their resource constraints, and easy to use. Particularly in the biofeedback domain, there is a need for affordable and quick to deploy data acquisition tool for quick prototyping and out-of-lab experiments (Fortin-Côté et al., 2019).

In recent years, in pursuit of affordable and flexible data acquisition systems, researchers have shifted their focus to using open-source electronics platforms like Arduino (D’Ausilio, 2012; Pearce, 2012; Polo et al., 2018). An Arduino is a low-cost open-source microcontroller board used for quick prototyping for electronics projects. The dedicated integrated development environment of Arduino is available for different operating systems like Windows, Mac OS, and Linux, and simplifies the process of editing, compiling, and uploading of software code into the microcontroller. The huge online community and support forums are an additional advantage of the Arduino ecosystem. The low cost associated with the Arduino ecosystem makes it stand apart from other hardware alternatives for data acquisition like myRIO (National Instruments, Austin TX, USA), LabJack (LabJack Corporation, Colorado, USA), and others. The cost of the cheapest alternatives is $130 for the Labjack device whereas Arduino comes for $10.

For the software part of data acquisition, software like MATLAB (Mathworks, Natick MA, USA) have been extensively used for its quick prototyping abilities and ease of use (Toulson, 2008). MATLAB is a widely used software in universities around the world. It offers very powerful data processing capabilities with an exhaustive library of functions spanning various fields. It also offers powerful and customized GUI tools for experiment building. Most of the researchers are already familiar with or have access to MATLAB in their university. A tool built in this environment will have data acquisition, visualization, and processing capabilities all in one place which significantly reduces the prototype building time. However, for an individual with no access to MATLAB, the high cost of MATLAB can be the biggest setback in using this tool.

Arduino family of boards can be easily integrated with MATLAB using official support packages to create a plug and play system (MATLAB Support Package for Arduino Hardware Documentation - MathWorks India, n.d.). However, this flexibility of prototyping comes at a cost of random timing jitters in communication between Arduino and MATLAB which causes latency issues in real-time data acquisition. In this paper, the authors present AfDaq1, a MATLAB based GUI tool for real-time data acquisition from Arduino. The GUI is developed using the GUIDE tool available in MATLAB. For interacting with the Arduino, a set of commands is used which are provided by “MATLAB Support Package for Arduino Hardware”2 (Arduino Support from MATLAB - Hardware Support - MATLAB & Simulink, n.d.). The timing jitter associated with various commands and sub-processes in the system was measured and descriptive statistics were computed. MAE (Mean Absolute Error) and the recorded sampling rate are used in the benchmark to define the selection criteria for system performance. A maximum of 5 channels (Analog or Digital) can be recorded simultaneously. The acquired data is displayed in real-time over a customizable scrolling plot at a maximum sampling rate of 10 Hz when acquiring from all 5 channels simultaneously. The tool also offers real-time data manipulation. The acquired data can be locally saved for offline processing. This is a plug and play system and the experimenter can be quickly up and running with the data acquisition process. The developed tool acquired data and analysis scripts used to compute results are released in the open-source domain for the researchers and to strengthen the replicability of the project.

Complete Article List

Search this Journal:
Reset
Volume 16: 1 Issue (2024): Forthcoming, Available for Pre-Order
Volume 15: 6 Issues (2022): 1 Released, 5 Forthcoming
Volume 14: 4 Issues (2021)
Volume 13: 4 Issues (2020)
Volume 12: 4 Issues (2019)
Volume 11: 4 Issues (2018)
Volume 10: 4 Issues (2017)
Volume 9: 4 Issues (2016)
Volume 8: 4 Issues (2015)
Volume 7: 4 Issues (2014)
Volume 6: 4 Issues (2013)
Volume 5: 4 Issues (2012)
Volume 4: 4 Issues (2011)
Volume 3: 4 Issues (2010)
Volume 2: 4 Issues (2009)
Volume 1: 4 Issues (2008)
View Complete Journal Contents Listing