Chapter 2 Getting Started
Working with AfDaq is a straightforward process. Make sure you have prerequisites available and follow the steps below.
2.1 Prerequisites
MATLAB-ver2017b
was used to develop the AfDaq. It was also tested withver2015b
andver2018b
for backward and forward compatibility respectively. It may not work withver20xx and before
due to the unavailability of compatibleMATLAB Support Package for Arduino Hardware
.
- MATLAB Support Package for Arduino Hardware
- Arduino compatible hardware board.
For the list of the supported boards, visit documentation here.
2.2 Installation and Running
- Download the latest stable release and extract contents into your MATLAB working directory. Alternatively, you can also download the latest code from the repository.
- Open
AfDaq.m
in MATLAB. - Connect Arduino board to PC with USB cable. If the board is pre-configured with Firmata code by MATLAB, a message is shown in the command window.
- Run
AfDaq.m
and wait for the GUI to appear. - In the GUI select the
COM
port for the Arduino and press theConnect
button. If the Arduino is not pre-configured with Firmata code by MATLAB, it may take few minutes (It’s a one-time process in the beginning OR if the board is re-flashed outside). - After a successful connection, appropriate settings can be selected and acquisition is manually started.
- The acquisition runs till a set time or can be stopped manually.
- After successful completion, the information panel shows various statistics related to the acquisition.
- Data can be saved for offline processing.
2.3 GUI
The user interface is straightforward and easy to use. The various sub-components are arranged in panels as per their functionality. The main sub-components of the GUI and their functions are :
- Settings
Arduino
: Lists the availableCOM
ports. Establishes a connection to the Arduino.Settings
: Lists various settings with defaults. Up to 5 channels can be selected.Display
: Controls the scaling of the live plot.
- Information
Status
: Panel showing the current status of the GUI.Daq Information
: Panel for important information regarding the current session.Results
: Panel to display the results after the successful acquisition.
- Plot
Live plot
: Panel displaying a real-time plot of the acquired data.
- Control
Control
: Panel to control the state of the GUI and data logging.
Figure 2.1 shows the minimum number of steps (labeled from 1 to 4) required for a simple data acquisition session. However, the number of steps may increase depending upon the user’s preference. Following is a brief explanation for each of these steps.
- Select the
COM
port from the list to which the Arduino board is connected. - Connect to the board.
- Select at least one channel from the drop-down list.
- Start the acquisition. You can pre-maturely stop the acquisition using the
Start/Stop
button at will or let it finish by itself till the session duration.