image thumbnail


version 2.2.2 (25 KB) by Antonio Silveira
Arduino-based Data Acquisition Device for Computer-controlled systems practices


Updated 21 Mar 2022

View License

Use the Arduino board as a single-shot data aqcuisition (DAQ) device for computer-controlled systems practices (Digital Control Theory). This package comes with four main m-file functions: daqduino_start, daqduino_end, daqduino_write, daqduino_read. As an example, consider the fragment of a code to implement a digital PID control loop:
for k=1:2, % Initial conditions
y(k)=0; u(k)=0; e(k)=0; % output, control, error
for k=3:nit, % nit=number of iterations
e(k)=yr(k)-y(k); %yr(k) is a reference sequence
daqduino_write(u(k),Ts); % Ts is the sampling time
A Simulink block is also available. However, it has not been tested very much. You may face some bugs.
An m-file example is given doing three practices: (1) Open-loop datalog; (2) Least-squares offline identification; (3) IMC Model-based Digital PID control tuned by the selection of the closed-loop time constant.
This package has been tested only with Arduino Uno R3 and Arduino Nano R3. The I/O pins in use are the Analog Input A0 and Pin 6 PWM. However, the Arduino code is very simple and you can modify it to your own needs. If you do so, please remember to reference/cite the author and research groups involved.
Laboratory of Control and Systems - LACOS, Federal University of Para, Brazil (
Group of Control and Systems - GCS, State University of Santa Catarina, Brazil (
Author: Professor Antonio S. Silveira (

Cite As

Antonio Silveira (2022). DaqDuino (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!