You are on page 1of 21

sensors

Article
The Acquisition Rate and Soundness of a Low-Cost
Data Acquisition System (LC-DAQ) for High
Frequency Applications
Ciro Moreno, Alejandro González, José Luis Olazagoitia * and Jordi Vinolas
Industrial Engineering Department, Universidad Antonio de Nebrija, Pirineos 55, 28040 Madrid, Spain;
cmorenora@nebrija.es (C.M.); agonzalezmu@nebrija.es (A.G.); jvinolas@nebrija.es (J.V.)
* Correspondence: jolazago@nebrija.es; Tel.: +34-914-521-100 (ext. 2863)

Received: 2 December 2019; Accepted: 14 January 2020; Published: 17 January 2020 

Abstract: This article presents a novel and reliable low-cost data acquisition solution for high
frequency and real-time applications in vehicular dynamics. Data acquisition systems for highly
dynamic systems based on low-cost platforms face different challenges such as a constrained data
retrieval rate. Basic data reading functions in these platforms are inefficient and, when used, they limit
electronics acquisition rate capabilities. This paper explains a new low-cost, modular and open
platform to read different types of sensors at high speed rates. Conventional reading functions are
avoided to speed up acquisition rate, but this negatively affects data reliability of the system. To solve
this and exploit higher data managing rates, a number of custom secure layers are implemented to
secure a reliable acquisition. This paper describes the new low-cost electronics developed for high
rate acquisition applications and inspects its performance and robustness against the introduction
of an increasing number of sensors connected to the board. In most cases, acquisition rates of the
system are duplicated using this new solution.

Keywords: DAQ; data acquisition system; acquisition rate; low cost; reliability; Arduino; high
dynamics; vehicle applications

1. Introduction
Data acquisition systems (DAQ) acquire signals from different types of sensors in contact with
the physical world. These systems acquire an analog signal and convert it to digital values for
further processing. Basically, a DAQ is composed of one or several sensors that send an electrical
signal to a circuitry to be conditioned and, subsequently, converted to digital values through an
analog-digital converter.
There are innumerable data acquisition systems available in the market. Some of them are based
on high priced proprietary systems (hardware and software). The physical magnitude that one wishes
to measure significantly conditions the acquisition system to be used. It is important to determine if
the measure you want to acquire changes over time and at what frequency. There are physical systems
with magnitudes that change slowly with time (for example the temperature) and other systems in
which they vary many times per second. The physical system to be measured, therefore, determines
the characteristics of the acquisition system that can be used to provide reliable data.
In this article, we focus on a very demanding application, the measurement of dynamic magnitudes
in vehicular systems. This application needs to quickly process high frequency signals coming from the
sensors installed in the vehicles (displacement sensors, acceleration sensors, GPS sensors, inclination
sensors, etc.) in front of external solicitations (inertias, vibrations, change of position, speeds,
accelerations, etc.). The configuration of an acquisition system compatible with these requirements

Sensors 2020, 20, 524; doi:10.3390/s20020524 www.mdpi.com/journal/sensors


Sensors 2020, 20, 524 2 of 21

causes the price of the data acquisition system to skyrocket. Additionally, the final price depends on
the number and quality of the sensors used, as well the refresh and data acquisition rates must be high
which means that the processors integrated in the circuitry must have a powerful and quick processor.
At the same time, the system should store and record the acquired data without delay.
Given this situation, we recently introduced an alternative low-cost acquisition system based on
the Arduino platform [1]. In that study, we validated the low-cost system presented with a professional
data acquisition system for vehicular dynamics applications. The results were promising, validating
the use of an Arduino-based system for this type of applications with high reliability at a reasonably
high sampling rate when a reduced number of sensors were installed.
The idea of using a data acquisition system based on a low-cost platform is not new. In [2],
Arduino had already been presented as a possible low-cost laboratory equipment and its accuracy was
analyzed, although an investigation of its performance and capacity was not studied or taken to the
limit. Other acquisition systems based on low-cost platforms, such as Raspberry Pi, have also been
presented, as in [3], where the system was used as a data acquisition and storage system where large
amounts of sensor data on low-cost servers was stored.
The relevant literature shows that these low-cost platforms have been applied to countless
situations. Most of these applications do not need high frequency of acquisition or do not apply to
very demanding dynamic situations. For example, in [4], a low-cost system was developed based on
an Arduino Mega platform that deployed a variable gain amplifier circuit increasing the efficiency,
resolution, and measuring range of the system. In this case, the system was also connected to a
Raspberry Pi with the calculation of basic electrical parameters in real time. Another recent example was
the development of an automated calorimeter for determining soil-specific heat using a microcontroller
based on Arduino [5]. It was also used for acquisition of environmental data, as in [6], where a system
based on an Arduino Leonardo system was used for continuous monitoring of air quality. Another
significant example was the use of a KdUINO DIT system to estimate water quality through the study
of its transparency through the diffuse attenuation coefficient [7] that was recorded on an SD card for
further study.
Some applications can be found in which these low-cost systems have been applied to
high-frequency dynamic systems. For example, in [8], a low cost acquisition system was developed for
a single axis vibration shaker table for civil engineering applications. In this case, the shaker table
was used to simulate horizontal acceleration data recorded during earthquakes and was based on an
Arduino DUE for control of the table and an Arduino MEGA for the verification of the acceleration
obtained. Another study obtained dynamic data in a low-cost platform to study the lateral displacement
of railway bridges through the use of low-cost accelerometers transmitting the data wirelessly [9].
Another recent example is found in [10], where a real-time electronic system was presented to monitor
the integrity of structures, continuously monitoring data such as acceleration, inclination, position,
and temperature that are transmitted wirelessly using the harvested energy in the system. It is also
possible to find applications in which these low-cost systems are used to condition the operation
of a machine. For example, in [11], a low-cost system was developed to monitor a bearing in a
mechanical system through a MEMS accelerometer, transmitting the information to a computer for
further processing in Matlab. Other applications have used multipurpose equipment (such as National
Instuments DAQ) [12] to lower the cost of high dynamics (and higher priced proprietary systems),
such as photoacoustic computed tomography [13].
In regards to the low-cost acquisition for applications related to vehicles, in [14], a low-cost system
was used to assess the comfort of travelers in the public transport system while evaluating vehicle
accelerations in a determined route by urban route. This system used a compact system obtaining
data from a GPS sensor and an accelerometer. In [15], a DAQ and a driving operation process was
designed for a dynamic vehicle simulation system, where data of the path of the three driving pedals
were obtained through linear displacement sensors and a sensor of angular displacement to obtain the
steering angle of the steering wheel. In [16], it was possible to classify the type of behavior behind the
Sensors 2020, 20, 524 3 of 21

wheel of public transport drivers using of a single low-cost triaxial accelerometer. The same idea was
applied in [17] using an inertial sensor and the CAN bus. In addition, in [18], an analysis of cyclists
data obtained by sensors was carried out through an Arduino-based system, using an ultrasonic sensor
and a GPS to evaluate the type of roadway. The system connected to a smartphone via Bluetooth to
record the data on a server. Recently, a low-cost system was presented, in this case based on Raspberry
Pi, to assess road surface friction [19]. In this case, the deceleration from the braking of the vehicle was
measured and compared with the geolocation of the vehicle to calculate the corresponding coefficient
of friction.
The examples cited so far prove that it is possible to use low-cost acquisition systems in increasingly
demanding situations. However, the specific applications in which Arduino- or Raspberry Pi-based
systems have been used for vehicular dynamics applications are still limited. In the system presented
in a previous article [1], we already have shown that it was possible to dynamically use a system based
on an Arduino microcontroller to perform dynamic measurements in vehicles. However, little attention
has been given in the relevant literature to improving the sampling frequency and the reliability of
these low-cost systems. The articles consulted are limited to highlighting the feasibility of acquiring,
analyzing, or sending data through low-cost platforms in specific applications, but little is explained
about reliability or how to increase the acquisition rate on these systems.
In reality, to implement a low-cost acquisition system in these platforms, it must be taken into
account that the system’s control, the testing, and the error checking are not implemented by default.
In addition, no information is given about the reliability of the obtained data or on how to improve the
acquisition rate of the system. Addressing the available functions in a low-cost acquisition system in
order to further speed it up forces the user to be prepared to deal with different types of errors. The
transmission of the data could have errors that should be monitored for a reliable acquisition. If the
DAQ do not have an integrated and adequate error checking system, the costly experimental results
would have to be repeated and, consequently, with a waste of time and money. In applications such
as dynamic acquisitions in vehicles, this is especially relevant, since the availability of these systems
to carry out tests is usually limited. In professional acquisition systems, many of these errors are
controlled and the system automatically corrects for them. In low-cost platforms, this control system is
usually not available, and one has to program for it.
A low-cost acquisition system for high dynamic applications must not only guarantee obtaining
proven reliable data, but it must also assure high acquisition rates. In addition, it is desirable that
the system is easy to use and configure, modular, and reusable in different vehicle configurations.
Unfortunately, little attention has been given to improving acquisition rates and the errors that can be
generated in these Arduino-based acquisition systems and how the data should be treated to ensure
fast, continuous, nonstop, and reliable operation.
Taking the system used in dynamic applications described in [1] as a reference, it would be
desirable to increase the already high acquisition rate provided. In addition, communication through
the serial ports between the system of Arduino (that provides the measure of the real time) and the
central computer (that can be based on a Raspberry Pi in case of wanting to maintain the cost low) can
have transmission errors that one has to monitor.
As a result of the analysis of the revised literature, we concluded that the development of
applications based on low-cost electronic platforms is increasing and is very popular. However, the
use of these platforms for the acquisition of high-frequency dynamic data is limited. Applications
that use these platforms for data acquisition in dynamic vehicle applications are much more restricted.
In addition, to the best of our knowledge, none has directly addressed the improvement and optimization
of the speed of data transmission on these platforms to improve their operation.
Therefore, the scientific novelty of this paper is centered on the development of a novel DAQ,
based on affordable electronics for real-time applications in vehicular dynamics that, apart from
allowing the open installation of a wide variety of sensors, multiplies by two the acquisition rate
of the system presented in [1] and assures consistent reliability of the acquired data, checking and
Sensors 2020, 20, 524 4 of 21

automatically correcting the detected errors. Specifically, this new system includes the configuration of
new hardware, with a redesigned shield adapted to be modular and open to innumerable types of
analog and digital sensors (position sensors, accelerometers, GPS, etc.). In addition, the transmission of
reliable (and time-marked) data from the sensors to the central operating system is assured. Optionally,
the system can work autonomously recording the acquired data in a local SD card. The reliability
of the data acquisition system is completed with a real-time data analysis module that detects and
corrects situations in which errors occur, making the system functional and fault tolerant. Therefore, a
robust acquisition system is proposed, which allows reliable professional acquisitions at a low cost. In
addition, the system is easy to install and very small, aimed at use for dynamic applications in different
vehicle sizes.
This article is divided into different sections. Section 2 details the characteristics of the new
acquisition system. In this section, first, the hardware configuration is described and, secondly, it deals
with the study and improvement of the reliability of the operation of the low-cost hardware used and
the protocols that must be implemented to ensure the quality of the data and its transmission at a high
refresh rate. Section 3 focuses on the validation tests of the system and presents the system functioning
in a real application, as well as a discussion of the results obtained. Section 4 presents our conclusions
and future paths.

2. The Low-Cost Data Acquisition (LC-DAQ) System


The low-cost data acquisition system presented in this research is aimed to conform an open,
flexible, robust and low-cost system which acquires data at high frequency from a large number of
sensors simultaneously, providing high accuracy on the data acquired.
On the one hand, Arduino is a good platform for the development of such a system. It is fully open
source, and the development boards that are compatible with it are electrically reliable and available at
a low cost. Furthermore, there is wide flexibility in terms of connections and digital protocols that can
be achieved with this platform. Thus, this becomes a suitable choice to develop the hardware of the
LC-DAQ system.
On the other hand, the serial communication protocol between the Arduino boards and external
computers becomes a bottleneck in terms of sampling frequency in real-time acquisitions applications.
The Arduino’s built-in functions for communicating with the controlling PCs are robust but do not
focus on efficiency. In order to increase the acquisition frequency and to optimize the robustness of the
system, a custom communication protocol is developed and introduced as part of the LC-DAQ system.

2.1. Hardware
The proposed low-cost system, namely low cost data acquisition system (LC-DAQ) is a modular
system with a high capacity for personalization. It is optimal for vehicle data acquisition applications
where compact and reliable systems are necessary. The LC-DAQ is composed of an Arduino Due card.
The board performs the processing of the data. An acquisition Shield (developed in the present work)
simplifies the connections between the sensors, modules, and the acquisition card. Data can be stored
directly on the SD card allocated in the shield, or it can be sent online to an external computer. The
system is protected by a housing made of methacrylate.
Arduino Due has a powerful Atmel SAM3 × 8E ARM Cortex-M3 with a 32-bit CPU. This provides
a faster calculation and acquisition speed than boards based on AVR architecture. Arduino Due is a
device far superior to previous models. It has 54 digital inputs and outputs, of which 12 can be used
as pulse-width modulation (PWM) outputs. It has 12 analog inputs and two analog outputs with a
voltage range between zero and 3.3 V. Four serial ports through the hardware (UARTs) establish several
serial connections at the same time. It also has pins dedicated to the I2C (inter-integrated circuit) and
SPI (serial peripheral interface) protocols. Table 1 shows the characteristics of the Arduino Due card as
compared with other Arduino compatible systems. As it can be observed, the Arduino Due sports
the highest clock frequency and finest analog resolution. Along with its low supply voltage (3.3 V),
Sensors 2020, 20, 524 5 of 21

these two features represent fundamental advantages over other systems to fulfill the requirements of
the LC-DAQ.

Table 1. Arduino Due characteristics.

Arduino Arduino Arduino Arduino Arduino Arduino Arduino


Name
Due Zero Mega2560 Leonardo Uno Nano Pro Mini

SensorsFormat Mega
2020, 20, x FOR PEER REVIEW Arduino Mega Arduino Arduino minimal 5 ofMini
21
ATSAM3X8E ATSAMD Atmega Atmega Atmega Atmega Atmega
Processor
(Cortex-M3) Table
21G18A1. Arduino2560 32U4
Due characteristics. 328P 328 328P
Frequency 84 MHz 48 MHz 16 MHz 16 MHz 16 MHz 16 MHz 8 (3.3 V)
Arduino Arduino Arduino Arduino Arduino Arduino
Name
Digital I/O (pins) Arduino
54 Due14
Zero 54Mega2560 20Leonardo 14 Uno 14
Nano Pro14Mini
AnalogFormat
output pins 2 Mega 1 Arduino 0 Mega 0 Arduino 0Arduino minimal 0 Mini
0
Analog input (pins) ATSAM3X8E
12 6 ATSAMD 16 Atmega 12 Atmega 6Atmega Atmega
8 Atmega
6
Processor
Analog Signal (Cortex-M3) 21G18A 2560 32U4 328P 328 328P
0–3.3 V
Frequency
Range 84 MHz 0–3.3 V 48 MHz0–5 V16 MHz 0–5 V16 MHz 0–516 V
MHz 0–5 16 V
MHz 83.3 V
(3.3 V)
Digital
AnalogI/O (pins)
signals 54 14 54 20 14 14 14
12 bits 10 bits 10 bits 10 bits 10 bits 10 bits 10 bits
Analog output pins
resolution 2 1 0 0 0 0 0
Analog input
Analog (pins)
signals 12 6 16 12 6 8 6
0.81 mV 3.22 mV 4.88 mV 4.88 mV 4.88 mV 4.88 mV 3.22 mV
Analogresolution
Signal Range 0–3.3 V 0–3.3 V 0–5 V 0–5 V 0–5 V 0–5 V 3.3 V
Analog signals resolution 12 bits 10 bits 10 bits 10 bits 10 bits 10 bits 10 bits
AnalogAsignals resolution
customized 0.81 mV1) is easily
shield (Figure 3.22 mV 4.88on
installed mVthe Arduino
4.88 mV Due 4.88board.
mV 4.88The mVshield3.22 mV
connects
the different modules
A customized and(Figure
shield the external sensors.
1) is easily Optional
installed SD card,
on the Arduino DueGPS
board.and
Thereal-time clock (RTC)
shield connects
modules can bemodules
the different installedandonthethe system.
external The shield
sensors. Optionalhas
SDfemale pins
card, GPS andto real-time
directly clock
connect
(RTC)modules
modules can be installed on the system. The shield has female pins to directly connect
to the acquisition system. It is a Plug and Play system. External sensors such as accelerometers modules to the
andacquisition system.
displacement It is aare
sensors Plug and Playby
connected system. External
terminals. Thesensors such as
acquisition accelerometers
shield connects theandoutput
displacement sensors are connected by terminals. The acquisition shield
and input pins of the Arduino Due board to external terminals. The terminals have a screwconnects the output and fixing
input pins of the Arduino Due board to external terminals. The terminals have a screw fixing system.
system. The external sensor cables are connected to these terminals and thanks to this, system reliable
The external sensor cables are connected to these terminals and thanks to this, system reliable
connections between the elements are guaranteed. This construction allows the data acquisition to be
connections between the elements are guaranteed. This construction allows the data acquisition to be
easily embarked
easily embarkedininthethevehicle. Connectionproblems
vehicle. Connection problems due
due to vibration
to vibration are avoided.
are avoided. In addition,
In addition, it is it is
a customizable
a customizablesystem
systemwith
with fast
fast assembly.
assembly. The Theavailable
available pins
pins are are shown
shown in Figure
in Figure 1. The1.optional
The optional
modules
modulesareare
installed
installeddepending
depending on the theapplication
application and
and thethe available
available budget.
budget.

Figure 1. Low-cost data acquisition (LC-DAQ) shield pinout.


Figure 1. Low-cost data acquisition (LC-DAQ) shield pinout.

The shield has four different optional modules. The first module, the microSD module Catalex
v1.0, is used when acquisitions are made using the acquisition system individually, that is, without
an external computer. The module is connected through the SPI protocol and the SD acquisition
allows a compact system but limits acquisition frequency to 70 Hz [1]. The second module, the RTC
module DS3231, is connected through I2C and the watch allows us to have control of the time for
long-term acquisitions. In short acquisitions the clock of the microcontroller is used. The third module
Sensors 2020, 20, 524 6 of 21

The shield has four different optional modules. The first module, the microSD module Catalex
v1.0, is used when acquisitions are made using the acquisition system individually, that is, without an
external computer. The module is connected through the SPI protocol and the SD acquisition allows a
compact system but limits acquisition frequency to 70 Hz [1]. The second module, the RTC module
DS3231, is connected through I2C and the watch allows us to have control of the time for long-term
acquisitions. In short acquisitions the clock of the microcontroller is used. The third module has a GPS
module Adafuit Ultimate V3 which allows the position and speed of the vehicle to be known with
frequencies in the range of 1 to 10 Hz. Its speed accuracy is ± 0.1 m/s and the position accuracy is ± 1.8
m. Finally, the fourth module is a logical converter for the I2C protocol. This is needed to use sensors
that operate at 5 V in the LC-DAQ. The LC-DAQ system is shown in Figure 2.
The acquisition system supports three forms of connections for external sensors (Table 2). Analog,
I2C (inter-integrated circuit) and SPI sensors can be used. The voltage range of the analog pins is from
0 to 3.3 V. Negative voltages cannot be measured. Any sensor able to either communicate through one
of these protocols or to return an analog signal within the voltage limit is compatible with the system.

Table 2. LC-DAQ external connections.

Characteristic Connection
Power 5 V, 3.3 V, 2Xgnd
Digital input/output 13
Analog inputs 12
Analog output 2
I2C SDA 3.3 V, SCL 3.3 V, SDA 5 V, SCL 5 V
RESET, SCK, MISO, GND, MOSI, 5 V, 4 D
SPI
I/O
LCD 5 V, GND, SDA 5 V, SCL 5 V
Others IOREF, RESET

The analog digital converter of Arduino Due has 12 bits. Therefore, the resolution is 0.806 mV for
a voltage range of 0 to 3.3 V. This obliges to condition the signal from sensors that do not meet these
characteristics using voltage dividers.
The sensors that are used (MPU-6050 triaxial accelerometers) communicate through the I2C
protocol which is preferred because it connects up to 255 sensors using only two cables. These two
cables are the serial clock line (SCK) and the serial data line (SDA). Both lines are connected to all the
devices that are using the data bus. The devices that use this protocol can be masters or slaves. In this
case, the LC-DAQ is the master and the external sensors are the slaves. The LC-DAQ system controls
the clock line and data transfer is only started by the LC-DAQ. The system supports connecting I2C
sensors powered at 5 V or 3.3 V. An example of the sensors that use this connection are MPU6050
accelerometers, the LCD screen, and the RTC.
Finally, there are sensors that communicate through the SPI protocol. This communication protocol
is characterized by being faster than I2C. In addition, it does not need a dedicated address to identify
each sensor. It uses four wires, a serial clock (SCLK), a master output slave input (MOSI), a master
input slave output (MISO), and a selection pin (SS). The microSD Catalex V1.0 module uses SPI for the
data storage.
The power consumption of the LC-DAQ is 80 to 90 mA plus 4 mA for each connected sensor.
Therefore, without additional modules, the consumption of the LC-DAQ together with eight triaxial
accelerometers MPU-6050 is approximately 112 to 122 mA.
Sensors 2020, 20, 524 7 of 21
Sensors 2020, 20, x FOR PEER REVIEW 7 of 21

Figure 2. 2.
Figure LC-DAQ system
LC-DAQ with
system allall
with thethe
modules installed.
modules installed.

2.2.
2.2. Firmware
Firmware and
and Communication
Communication Protocol
Protocol
The
The firmwareinstalled
firmware installed into
into thetheLC-DAQ
LC-DAQ is isdeveloped
developed taking
taking advantage
advantage ofof Arduino
Arduino IDE.
IDE. The
The
LC-DAQisismeant
LC-DAQ meant to to be aa robust
robustand andaffordable
affordable acquisition
acquisition system
systemthatthat
is able to deliver
is able a highaenough
to deliver high
sampling
enough frequency
sampling in a real-time
frequency scheme.
in a real-time This means
scheme. that LC-DAQ
This means that LC-DAQ must be mustconnected to a master
be connected to a
computer through a reliable and fast communication protocol.
master computer through a reliable and fast communication protocol. Serial over USB is the most Serial over USB is the most commonly
used communication
commonly protocol between
used communication protocol Arduino
between boards and computers.
Arduino boards and Arduino
computers.IDE provides
Arduinodefined
IDE
functions
provides to sendfunctions
defined and read to data packages
send and read through
datathe serial port.
packages One of
through thethese
serialfunctions
port. One is Serial.print.
of these
It becomes
functions very convenient
is Serial.print. to send
It becomes data
very in a structured
convenient to send and reliable
data manner. Inand
in a structured a previous version of
reliable manner.
InLC-DAQ,
a previousSerial.print was the default
version of LC-DAQ, function
Serial.print wasused to communicate
the default function used withtothe external computer
communicate with the[1].
Serial.print
external function
computer is aSerial.print
[1]. regular andfunction
reliable communication
is a regular and function.
reliableHowever, it does not function.
communication allow high
samplingitfrequencies,
However, does not allow especially when several
high sampling sensors
frequencies, are connected
especially when to one board.
several sensors are connected
to one The
board. speed in the serial communication can be improved in two ways. On the one hand, the
serial
Theport
speed caninbethe
configured to operate at different
serial communication baud rates.
can be improved in twoOn ways.
the other Onhand,
the one thehand,
communication
the serial
protocol
port can be defines the number
configured of bytes
to operate that are needed
at different to send
baud rates. Onthe acquisition
the other hand, information. The volume
the communication
of thesedefines
protocol bytes directly
the number impacts the that
of bytes communication
are needed tospeed send theandacquisition
the sampling rate. By improving
information. The volume the
ofcommunication
these bytes directly protocol,
impacts the the
communication
communication speedspeed canandbe thesignificantly
sampling improved. This research
rate. By improving the
focuses on improving
communication protocol, thethe
serial communicationspeed
communication protocol cantobeenhance the acquisition
significantly improved. frequency. In order
This research
to test on
focuses theimproving
improvements of thecommunication
the serial new protocol, the baud to
protocol rate was setthe
enhance to aacquisition
commonlyfrequency.
used value Inof
250,000
order bps.
to test the improvements of the new protocol, the baud rate was set to a commonly used value
A qualitative
of 250,000 bps. explanation can be provided observing how Serial.print works. This function takes
theAvariable
qualitative explanation
specified by the usercan beandprovided
convertsobserving
each of itshow Serial.print
characters works.
into ASCII This
code function
and, takes a
then, sends
the variable
byte specified
containing this by
code thefor
user andofconverts
each each of
the character in its
thecharacters
variable. into This ASCII code and,
is reasonable forthen,
sendingsendstext.
a However,
byte containing
sending this code for
numbers eachthis
under of the character
scheme becomes in the variable.
totally Thisfor
inefficient is reasonable
LC-DAQ, which for sending
is meant
text. However,
to read numerical sending
values numbers under this
from different scheme
sensors and becomes
timers and totally
transmitinefficient
them tofor LC-DAQ,
a master whichin
computer
is real
meant
time.to As
read annumerical values from
example, consider that different
one of thesensors
values is andthetimers
number and 255transmit them
in base 10. In to a master
Hexadecimal
computer
this datain is real time. Asasan0 example,
represented x FF and in consider
binary it that one ofthe
becomes thesingle
valuesbyteis the numberUsing
11111111. 255 inSerial.print
base 10.
In(255)
Hexadecimal
this value,this data
first, is represented
is split into its three as characters
0 x FF and[2, in5,binary
5]. Then it becomes
they are the single byte
converted into 11111111.
ASCII code,
Using
whichSerial.print
in Hexadecimal (255) isthis value,
written as first,
[0x32,is0x35,
split0x35]
into and
its three
in binarycharacters [2, 5, 5].
as [00110010, Then they
00110111, are
00110111].
converted
Then, these intothree
ASCII code, which
characters in Hexadecimal
are sent individually is aswritten
three bytes as [0x32,
embedded0x35, 0x35]
into theand in binary as
communication
[00110010,
protocol used00110111,
by the00110111].
function toThen, guaranteethese the
threedata characters
synchronism are sent individually
and reliability. as three
Under bytes
this scheme,
embedded into the communication protocol used by the function to guarantee the data synchronism
and reliability. Under this scheme, the number of bytes that must be sent is multiplied by three.
Sensors 2020, 20, 524 8 of 21

the number of bytes that must be sent is multiplied by three. Furthermore, the user has no control of
the communication protocol that runs every time that a Serial.print command is invoked.
In order to overcome the data size disadvantages of using Serial.print, this work embodies the
integration of a communication protocol over serial port that drastically reduces the volume of data
that has to be sent and notably increases the acquisition frequency obtained with the LC-DAQ system.
However, avoiding the use of Serial.print, which is reliable, means that the control and reliability of the
communication rely on the user. This protocol pivots on one of the functions provided by Arduino
IDE (Serial.write) which sends bytes individually and grants full control to the user. This protocol is
assembled adding different control layers to improve the speed and robustness of communication.
These layers have been tested individually to isolate their effects on the transmission speed and data
accuracy. Statistical analyses were performed at each step of the study tracking all the different errors
appearing on the communication to ensure the reliability of data and to observe the pros and cons of
each control layer added to the protocol as follows:

• Data framing Increases transmission speed by sending bytes instead of ASCII characters;
• Checksum Increases robustness by detecting errors in the byte chain;
• Time resolution reduction Increases transmission speed by reducing the number of bytes in
time variables;
• Bytes stuffing Increases robustness by including control bytes to prevent interpretation errors in
the receiving algorithm.

2.2.1. Data Framing


This first layer uses Serial.write instead of Serial.print. It also implements data framing to
synchronize the data flow in the transmission. Serial.write receives the following two arguments: The
address of the variable to be sent (pointer to the variable’s first memory address) and the number of
bytes to be sent (number of memory positions to be read and send through serial port starting at the
memory address introduced in the first argument). The variable that has to be transmitted is stored
in the memory as a sequence of bytes. If the number of bytes indicated in the second argument of
Serial.write exceeds the length of that variable, Serial.write would continue sending those bytes stored
into the contiguous memory addresses. Consequently, data must be stored carefully structured into
the microcontroller memory, and therefore the program has full control on the data location.
In order to control the data, different structured variables are defined for two kind of sensors, i.e.,
analogic and digital. The variable for analogic sensors stores the following two variables: the time
count read from the timer at each measure and the digitalized value of the voltage returned by sensors’
transducer. The variable for digital sensors can store several values, i.e., the time value (uint32_t) and
as many digital values (uint16_t) as the sensor is able to send at each measurement. For example,
the MPU6050 used in this study is configured to return up to three accelerations from the sensor.
On the one hand, with a resolution of microseconds, 32 bits allow the sensor to register continuously
up to 1.19 h. This time is enough to carry out most of the experimental tests for which this LC-DAQ
system was conceived. On the other hand, the analog to digital converter (ADC) of Arduino DUE has
a native resolution of 10 bits. This can be increased up to 12 bits of real resolution and extended up
to 16 bits by interpolation. In addition, all the digital sensors used with our LC-DAQ system have a
resolution of 16 or less bits.
This approach stores all the data of one sensor in a single structure which is allocated sequentially,
byte-by-byte, in the memory of the system. Being so, the stored information of one sensor can be send
just by calling the function Serial.write with the pointer to the structure defined for that sensor and the
total length of the data stored on it (six bytes in the case of an analogic sensor) as arguments.
Framing characters are used to create a data frame within the string of bytes transmitted which
synchronizes the data flow between the LC-DAQ and the master PC. These characters are represented
by the start of transmission byte (STX) and the end of transmission byte (ETX), typically 0x02 and
Sensors 2020, 20, 524 9 of 21

0x03,Sensors 2020, 20, x FOR PEER REVIEW


respectively. Figure 3 shows the sequence of bytes sent through the serial port to transmit 9 of 21
the
information of
Sensors 2020, one
20, analogic
x FOR sensor
PEER REVIEW and one digital sensor with two variables.
0x03, respectively. Figure 3 shows the sequence of bytes sent through the serial port to transmit the
9 of 21
Data is sent of
information from
one the LC-DAQ
analogic sensorenclosed
and one within the framing
digital sensor with twobytes. That information is received in
variables.
0x03, respectively. Figure 3 shows the sequence of bytes sent through the serial port to transmit the
the PC, where
Data isa sent
Python fromprogram
the LC-DAQ monitors
enclosed thewithin
serialtheport and classifies
framing bytes. That theinformation
incomingisbytes.receivedOnce it
information of one analogic sensor and one digital sensor with two variables.
readsina the
STX PC,byte
where it stores
a Pythontheprogram
following bytes in
monitors theits memory
serial port anduntil an ETX
classifies thebyte is received.
incoming bytes. OnceThen, it
Data is sent from the LC-DAQ enclosed within the framing bytes. That information is received
countsit readsnumber
a STX byte it stores the following if bytes in its to
memory until anofETX byte is received. Then, it
in the
the PC, whereofa bytes Python received
programand it isthe
monitors equal the number
serial port and classifiesbytes expected,
the incoming it reconstructs
bytes. Once
countsof
the values thethe
number
variablesof bytes
fromreceived
the and received
bytes if it is equalandto the numberthe
performs of bytes expected,
conversion ofitthose
reconstructs
values
it reads a STX byte it stores the following bytes in its memory until an ETX byte is received. Then, it into
the values
the equivalent of the variables
physicalofquantities. from the bytes
If the received and performs the conversion of those values into
counts the number bytes received andnumber of bytes
if it is equal to thestores
number does not coincide
of bytes expected, with the expected
it reconstructs
the equivalent physical quantities. If the number of bytes stores does not coincide with the expected
one, those bytes
the values ofare
the discarded,
variables from andthe
a new
byteschain
received of bytes is read. the conversion of those values into
and performs
one, those bytes are discarded, and a new chain of bytes is read.
the equivalent
Therefore, physical
framing quantities.reduces
drastically If the number of bytes
the number ofstores
bytesdoes notserial
in the coincide with the expected
transmission for each set
Therefore, framing drastically reduces the number of bytes in the serial transmission for each set
one,
of measures those bytes
performed are discarded,
by bythethe and
system, a new chain of bytes is read.
of measures performed system,increasing
increasingthe the sampling frequency
sampling frequency (see
(see thethe Results
Results section).
section).
Therefore, framing drastically reduces the number of bytes in the serial transmission for each set
of measures performed by the system, increasing the sampling frequency (see the Results section).

Figure
Figure 3. Example
3. Example of bytes
of bytes string
string enclosed
enclosed between
between thethe special
special characters
characters ofof start
start ofof transmission(STX)
transmission
(STX)
and end and
of 3. end of transmission
transmission (ETX). (ETX). Each
Eachenclosed block represents
block represents a byte. Each variable contains severalbytes
Figure Example of bytes string between thea special
byte. Each variable
characters contains
of start several
of transmission
bytes which are sequentially sent staring at the less representative one.
which(STX)
are sequentially sent staring(ETX).
and end of transmission at theEach
less block
representative
representsone.
a byte. Each variable contains several
bytes which are sequentially sent staring at the less representative one.
2.2.2.2.2.2. Checksum
Checksum
2.2.2.The checksum layer is intended to improve the consistency of the data transmitted. It performs
Checksum
The checksum layer is intended to improve the consistency of the data transmitted. It performs a
a checksum operation on the byte string before it is sent (in the LC-DAQ side) and after it is received
checksum operation onlayer
The checksum is intended
the byte to improve
string before it is the
sentconsistency of the data
(in the LC-DAQ transmitted.
side) and after itIt isperforms
received (in
(in the PC side). Then, both values are compared, and data is approved if they coincide.
a checksum
the PC side). operation
Then, both on the
values byte
are string
compared,before it
and is sent
data (in
is the LC-DAQ
approved if side)
they and after
coincide. it is received
The checksum performed at both sides (LC-DAQ and computer) consists in a byte-by-byte XOR
(in the
The PC side). performed
checksum Then, both values aresides
compared, and data
and iscomputer)
approved if they coincide.
logical operation. In this way,atthe bothprobability (LC-DAQ
of errors cancellation consists
is reduced, in a byte-by-byte
obtaining eight parity XOR
The checksum performed at both sides (LC-DAQ and computer) consists in a byte-by-byte XOR
logical operation.
bits for the fullInstring.
this way,
Figure the4 probability
is presentedof aserrors cancellation
an example in whichis the
reduced, obtaining
information of aneight parity
analog
logical operation. In this way, the probability of errors cancellation is reduced, obtaining eight parity
bits for the full
sensor string. Figure
is transmitted. 4 is4apresented
Figure shows theas an example
string of bytes,in whichin
whereas the information
Figure of an analog
4b a numerical examplesensor
bits for the full string. Figure 4 is presented as an example in which the information of an analog
of the bytesFigure
is transmitted. contained in the string
4a shows is presented
the string of bytes,along with theinresult
whereas of performing
Figure 4b a numericala XORexample
checksumof the
sensor is transmitted. Figure 4a shows the string of bytes, whereas in Figure 4b a numerical example
on the six
bytesofcontained bytes corresponding
in the string to
is string the
presented data.
along with
the bytes contained in the is presented alongthewithresult of performing
the result of performing a XORa XORchecksum
checksum on the
six bytes corresponding to the data.
on the six bytes corresponding to the data.

Figure 4. (a) Example of a string of bytes containing the data of an analog sensor along with a
checksum byte and (b) numerical example of XOR checksum calculation.
Figure
Figure 4. (a)4.Example
(a) Example of a string
of a string of bytes
of bytes containing
containing the of
the data data
an of an analog
analog sensorsensor
alongalong
with awith a
checksum
checksum
byte and byte and (b)
(b) numerical numerical
example example
of XOR of XOR calculation.
checksum checksum calculation.
2.2.3. Time Resolution Reduction

2.2.3.2.2.3.
Time This
Timelayer is meant
Resolution
Resolution to further reduce the number of bytes to be sent in the string of bytes for each
Reduction
Reduction
communication. Initially, the resolution of the time value for both analog and digital sensors is 32
This This
layerlayer is meant
is meant to further
to further reducethe
reduce thenumber
number ofofbytes
bytestotobebe
sent in in
sent thethe
string of bytes
string for each
of bytes for each
communication. Initially, the resolution of the time value for both analog and digital sensors is32
communication. Initially, the resolution of the time value for both analog and digital sensors is 32 bits.
Sensors 2020, 20, 524 10 of 21

These four bytes allow the sensor to codify up to 71.5 min in intervals of 1 microsecond. By reducing
the time resolution
Sensors to 24
2020, 20, x FOR PEERbits (3 bytes) the maximum time period that can be codified reduces
REVIEW to2116.7 s.
10 of
This time span becomes too short for most of the experiments for which LC-DAQ is designed, but it is
long bits.
enough These to four
allowbytes allow the sensor
the execution to codify
of several up to and
hundreds 71.5 thousands
min in intervals of 1 microsecond.
of program’s main loop Byin the
reducing the time resolution to 24 bits (3 bytes) the maximum time period that can be codified reduces
Arduino side, depending on the number of sensors to be read.
to 16.7 s. This time span becomes too short for most of the experiments for which LC-DAQ is
To ensure the integrity of the time count, a time-correction routine is included in the PC side that
designed, but it is long enough to allow the execution of several hundreds and thousands of
stablishes the initial
program’s timeinand
main loop thesequentially
Arduino side,adds the time
depending increments
on the number of detected
sensors to at beeach step, by reading
read.
the raw data provided
To ensure by the Arduino
the integrity of the time timer.
count,Ina the first reading,
time-correction this routine
routine is includedstores
in thethePCinitial value of
side that
time stablishes
received the on the serial
initial timeport, and therefore
and sequentially addsitthe
cantime
subtract this value
increments detected from the step,
at each consecutive
by reading values
of time
theand
raw set datathe time ofbythe
provided theinitial
Arduino measure
timer. Inasthe
zero.
firstAt each reading,
reading, this routine thestores
time-correction
the initial valueroutine
of time
compares the received
value on the serial
of time port, and
received therefore
in the currentit can subtract
reading thisthat
with value from theinconsecutive
received the previous values
reading.
of time and set the time of the initial measure as zero. At each reading,
Then, it adds this difference to the previous value of time computed. At a certain number of readings, the time-correction routine
compares the
the maximum value
value of of time
time received
that can be instored
the current
in thereading
24 bitswith that received
variable is reachedin theandprevious reading.
the time’s count is
Then, it adds this difference to the previous value of time computed. At a certain number of readings,
reset. Then, the value of time received on the serial port is lower than that in the previous reading.
the maximum value of time that can be stored in the 24 bits variable is reached and the time’s count
When this circumstance is detected, the comparison between the current value of time received with
is reset. Then, the value of time received on the serial port is lower than that in the previous reading.
the previous
When this one becomes aisnegative
circumstance detected, value. The actual
the comparison time the
between interval
current that elapsed
value of timebetween
received these
with two
measures is found by adding the maximum value reachable in the time variable
the previous one becomes a negative value. The actual time interval that elapsed between these two µs) (224 = 16.777.216
to themeasures
times difference.
is found byBy this approach,
adding the maximum thevalue
maximum
reachabletime achievable
in the at any
time variable (224 experiment
= 16.777.216becomes
µs)
virtually
to theinfinite.
times difference. By this approach, the maximum time achievable at any experiment becomes
virtually
It wouldinfinite.
be possible to further reduce the number of bytes used to encode the timer count. For a
timer count with 2bebytes
It would possible to further reduce
of resolution the number
with sampling of bytes
times of 1 used to encode the
microsecond, the maximum
timer count.timeFor that
a timer count with 2 bytes of resolution with sampling times of 1
can be encoded is about 65 ms. However, as far as the number of sensors is incremented, the time microsecond, the maximum time
that can be encoded is about 65 ms. However, as far as the number of sensors is incremented, the time
taken for the Arduino program to perform a single main loop becomes closer to this value. At a certain
taken for the Arduino program to perform a single main loop becomes closer to this value. At a certain
point this circumstance could produce aliasing on the different measures, therefore, we set the time
point this circumstance could produce aliasing on the different measures, therefore, we set the time
resolution in 3 in
resolution bytes as aascompromise
3 bytes a compromisebetweenbetween performance
performance and androbustness.
robustness. Figure
Figure 5 shows
5 shows how howthe the
data string would be sent at this
data string would be sent at this stage. stage.

Figure
Figure 5. Example
5. Example of aofstring
a string
ofofbytes
bytescontaining
containing the
thedata
dataofofanananalog
analogsensor, a digital
sensor, sensor
a digital of one
sensor of one
variable, and the checksum byte. The time resolution has been set to 3 bytes (24 bits) for both
variable, and the checksum byte. The time resolution has been set to 3 bytes (24 bits) for both sensors. sensors.

2.2.4.2.2.4. Stuffing
Stuffing
The flags
The flags (STX(STX
andand ETX)
ETX) areare specialcharacters
special characters that
thatidentify
identifythe start
the or or
start endend
of transmission and and
of transmission
are codified with a single byte. Table 3 presents the codification used for some special characters.
are codified with a single byte. Table 3 presents the codification used for some special characters.
Table 3. Codification of special characters including their hexadecimal and binary values.
Table 3. Codification of special characters including their hexadecimal and binary values.
Byte Hexadecimal Binary
STXByte 0x02
Hexadecimal 0000Binary
0010
ETXSTX 0x03 0x02 0000 0011
0000 0010
ESCETX 0x06 0x03 0000 0110
0000 0011
ESC 0x06 0000 0110
The data framing layer (see Section 2.2.1) is effective when the bytes within the data string are
different from the special characters. However, if some of te bytes that codify either the times or the
measurements
The data framingtakeslayer
the same
(seevalue as one
Section of those
2.2.1) special characters,
is effective when the the system
bytes which
within thereceives the are
data string
data string (the master PC in our case) could misinterpret the framing structure of the message
different from the special characters. However, if some of te bytes that codify either the times or the and
result in a reading error. To prevent the system failure, a byte stuffing technique is used. This is an
measurements takes the same value as one of those special characters, the system which receives the
extended technique in serial communications which consists of introducing an extra character (ESC)
data string (the master PC in our case) could misinterpret the framing structure of the message and
Sensors 2020, 20, 524 11 of 21

result in a reading error. To prevent the system failure, a byte stuffing technique is used. This is an
extended
Sensorstechnique inPEER
2020, 20, x FOR serial communications which consists of introducing an extra character
REVIEW 11 of 21(ESC)
before those data bytes which coincide with other special characters. When the receiving system
readsbefore
an ESC those data bytes which coincide with other special characters. When the receiving system reads
byte it knows that this character must not be saved and that the following byte must be
an ESC byte it knows that this character must not be saved and that the following byte must be treated
treated as data instead of as a special character. Figure 6 shows an example in which some of the bytes
as data instead of as a special character. Figure 6 shows an example in which some of the bytes
contained in the
contained datadata
in the string coincide
string coincidewith
withthe
the special characterand
special character and how
how thethe communication
communication protocol
protocol
modifies the string by stuffing the ESC byte.
modifies the string by stuffing the ESC byte.

Figure
Figure 6. Example
6. Example of byte
of byte stuffingon
stuffing onaadata
datastring
string containing
containingthree data
three bytes
data thatthat
bytes coincide with with
coincide the the
special characters.
special characters.

The The
fourfour techniques
techniques presentedabove
presented above develop
develop aa communication
communication protocol which
protocol whichprovides full full
provides
control of the data transmitted, highly increases the communication speed by reducing significantly
control of the data transmitted, highly increases the communication speed by reducing significantly
the volume of bytes sent, and provides a high level of robustness on the data transmission.
the volume of bytes sent, and provides a high level of robustness on the data transmission.
In the following sections, the effects of introducing such control layers into the communication
In the following sections, the effects of introducing such control layers into the communication
protocol are experimentally studied observing the sampling frequencies achieved by LC-DAQ
protocol are experimentally
(configured studied
with different number observing
of sensors), theassampling
as well frequencies
the time regularity achieved
obtained by LC-DAQ
in the measures.
(configured with different number of sensors), as well as the time regularity obtained in the measures.
3. Methods, Tests, and Results
3. Methods, Tests, and Results
For the evaluation of the different data transmission methods, 5 trials were carried out. The LC-
For
DAQthe systemevaluation of the different
was used together with low-cost data transmission
triaxial methods,
accelerometers. 5 trialswere
Measurements were carried
taken with out.
different numbers
The LC-DAQ system was of sensors
used and 1 to 8 sensors
together were connected.
with low-cost A time measurement
triaxial accelerometers. was taken for were
Measurements
takeneach
withacquired
different sensor
numbersand 1,of2,sensors
or 3 axes were
and measured
1 to 8 sensors at were
the same time for A
connected. each sensor.
time Only one was
measurement
“time” value was acquired per sensor. Therefore, the number
taken for each acquired sensor and 1, 2, or 3 axes were measured at the same time for each of time bytes sent in each cycle
sensor.
depended on the number of sensors and not on the number of axes sampled. The maximum
Only one “time” value was acquired per sensor. Therefore, the number of time bytes sent in each
acquisition frequency was analyzed for the different test methods. Errors produced in each test were
cycle depended on the number of sensors and not on the number of axes sampled. The maximum
recorded. The study was divided into 5 tests as shown below.
acquisition frequency
Test 1 was thewas analyzed
baseline. for the different
It consisted test methods.
in the acquisition Errors produced
of acceleration in each by
values provided testa were
recorded. Thenumber
different study was dividedtriaxial
of MPU6050 into 5sensors.
tests asThe shown below.
test was divided according to the number of axes
Test 1 wasatthe
acquired thebaseline.
same time It consisted
(1, 2, or in3) the
andacquisition of acceleration
1 to 8 sensors were acquired valuessimultaneously.
provided by a The different
number of MPU6050
transmission triaxial
of the data wassensors. The testwith
implemented wasthedivided
Arduino’saccording to the
Serial.print number
function. Onofthe
axes acquired at
receiving
PC, atime
the same Python program
(1, 2, or 3) andwas1 executed
to 8 sensorsto monitor and record
were acquired the time at which
simultaneously. Thethe data was received.
transmission of the data
was implemented with the Arduino’s Serial.print function. On the receiving PC, atoPython
In this test, only the maximum acquisition frequency is obtained. It is not possible registerprogram
the
number ofto
was executed communication
monitor anderrors. recordThe therelative
time atstandard
which deviation
the data was(RSD)received.
of the frequency
In thisistest,
usedonly
as the
a representation of the number of errors. When there was an error in a measurement cycle, the sensor
maximum acquisition frequency is obtained. It is not possible to register the number of communication
data was not recorded. With a bigger number of errors there are more frequency drops. The test was
errors. The relative standard deviation (RSD) of the frequency is used as a representation of the number
performed in static way. In this situation, the value of bits sent by the sensors was constant.
of errors. InWhen
Test 2,there was an
the same testserror
wereincarried
a measurement
out implementingcycle, the
datasensor
framing. data was
This not recorded.
reduced the number With a
bigger number of errors there are more frequency drops. The test was
of bytes sent and kept track of the errors produced in the transmission. The test was performedperformed in static way. In this
situation, the value of bits sent by the sensors was constant.
following the same methodology as in the first test. With the data framing method, it is possible to
In
knowTestif2,there
the same testsinwere
are errors carried out
the structure implementing
of the data framing.
data sent. Therefore, a recordThis reduced
of the the number
errors was taken of
bytesinsent
a .log
andfilekept
and track
1 to 8 of
sensors with 1produced
the errors to 3 simultaneous axes were sampled.
in the transmission. The test Thewas
maximum
performedfrequency
following
the same methodology as in the first test. With the data framing method, it is possible to know if there
Sensors 2020, 20, 524 12 of 21
Sensors 2020, 20, x FOR PEER REVIEW 12 of 21

are errors
values andinerrors
the structure of the data
were recorded. This sent.
method Therefore,
sends thea samerecord of the of
number errors
byteswas taken inofathe
regardless .logvalue
file
and 1 to 8 sensors with 1 to 3 simultaneous axes were sampled. The
sent by the sensors. Therefore, tests could be made static or dynamic without varying the deviation maximum frequency values and
errors
from the were recorded.
frequency of This methodThis
acquisition. sends the same
behavior number of
is different bytes
with the regardless
Serial.printofmethod. the value sent by
the sensors. Therefore, tests could be made static or dynamic without
In Test 3, checksum was integrated to increase the robustness of communication between varying the deviation from thethe
frequency of acquisition. This behavior is different with the Serial.print
LC-DAQ and the PC. The same procedure was followed as Test 2. Data acquisition frequency and method.
In Teststring
structure 3, checksum
errors were was recorded.
integratedThe to increase
introduction the robustness
of checksum of communication
allowed the byte between
corruptionthe
LC-DAQ and the PC. The same procedure was
errors to be known. The addition of one byte per string sent was studied.followed as Test 2. Data acquisition frequency and
structure string
In Test 4, errors were recorded.
time resolution The introduction
reduction was included, of checksum
reducingallowed
the number the byte corruption
of bytes of theerrors
time
to be known. The addition of one byte per string sent was studied.
variable (3 bytes instead of 4). This change was implied by sending one less byte for each acquired
In Test
sensor. The 4, time resolution
methodology reduction
followed was the wassame included,
as the reducing
two previous the number of bytes ofrates
trials. Acquisition the time
were
variable (3 bytes instead
sampled, as well as the error log. of 4). This change was implied by sending one less byte for each acquired
sensor. The methodology
Finally, in Test 5 the followed
stuffingwas thewas
layer sameimplemented.
as the two previous trials. Acquisition
The experiment followedrates the were
same
sampled, as well as the error log.
procedure as the previous tests. Acquisition frequency and string structure errors were logged. The
Finally,
results in Test
obtained in5the
theexperimental
stuffing layer trials
was implemented.
using the LC-DAQ The experiment followed the
low cost acquisition same procedure
system are shown
as the
below. previous tests. Acquisition frequency and string structure errors were logged. The results
obtained in the
Figure experimental
7 shows trials using
the results obtainedthe LC-DAQ
in Test 1. lowIncost acquisition
Figure 7a thesystemacquisitionare shownfrequencybelow.is
Figure 7 shows the results obtained in Test 1. In Figure 7a the acquisition
represented versus the number of sensors sampled by the Serial.print data acquisition method. In the frequency is represented
versus
ordinate theaxis,
number of sensors frequency
the acquisition sampled by the Serial.print
is shown dataThe
in each test. acquisition
number of method.
sensorsIn the ordinate
acquired at the
axis, the acquisition frequency is shown in each test. The number
same time is represented on the abscissa axis. The three curves represent the I2C triaxial of sensors acquired at the same
time is represented
accelerometer sampling on the abscissa
1, 2, or 3 axes axis.
at theThe three
same curves
time. The represent
nonlinearity theofI2C thetriaxial accelerometer
acquisition frequency
sampling 1, 2, or 3 The
can be observed. axesmaximum
at the samefrequency
time. Thereached
nonlinearity of the
is 1666 Hz acquisition
for a sensorfrequency
acquiringcan on abesingle
observed.
axis.
The maximum frequency reached is 1666 Hz for a sensor acquiring
The minimum acquisition frequency is 127 Hz for 8 accelerometers acquiring on 3 axes. The greater on a single axis. The minimum
acquisition
the numberfrequency is 127 Hz
of axes sampled, thefor 8 accelerometers
lower the acquisition acquiring
frequency.on 3Theaxes.
speedThedecreases
greater the number23%
between of
axes
and sampled,
18% whenthe anlower the acquisition
additional frequency.
axis is included. Figure The 7bspeed
showsdecreases
the relativebetween
standard 23%deviation
and 18% (RSD). when
an additional axis is included. Figure 7b shows the relative standard deviation
The RSD is a standardized measure of dispersion of a frequency distribution. In this case, it is directly (RSD). The RSD is a
standardized measure of dispersion of a frequency distribution. In
influenced by the number of errors in communication. Each error represents a discarded measure this case, it is directly influenced by
the
andnumber
impliesofthat errors
a newin communication.
program cycle isEach necessaryerror represents
to obtain aacorrect
discarded measure and
measurement. implies
This doubles thatthe
a
new program cycle is necessary to obtain a correct measurement.
acquisition time when there is an error. With this method we obtain a deviation of up to 0.8%. This doubles the acquisition time
when there is
Therefore, it an error. Withthat
is observed thisSerial.print
method wehas obtain some a deviation of up to
errors filtered but0.8%.
it is Therefore,
not possible it istoobserved
identify
that
them.Serial.print has some errors filtered but it is not possible to identify them.

Figure7.7.(a)
Figure (a)Acquisition
Acquisitionfrequency
frequency depending
depending onon
thethe
number
numberof sensors and and
of sensors axis read at theatsame
axis read time
the same
with Serial.print method and (b) acquisition frequency relative standard deviation (RSD)
time with Serial.print method and (b) acquisition frequency relative standard deviation (RSD) depending on
the number on
depending of sensors and axis
the number read with
of sensors andSerial.print method.
axis read with Serial.print method.
Sensors 2020, 20, 524 13 of 21

Figure 8 shows the difference in results obtained between Test 1 and Test 2. In this Test,
Sensors 2020, 20, x FOR PEER REVIEW 13 of 21
data communication between the LC-DAQ and the computer is done by sending byte string and not
by the Serial.print
Figure 8method.
shows the Figure 8a shows
difference theobtained
in results evolution of theTest
between acquisition
1 and Testfrequency as a data
2. In this Test, function of
communication
the number of sensorsbetween
and axes theacquired
LC-DAQ and the same
at the computertime.is done by sending byte
The frequency string andby
is increased not1458
by Hz in
the Serial.print method. Figure 8a shows the evolution of the acquisition frequency as a function of
the best case. Figure 8c shows the increase in the relative acquisition frequency between Test 2 and Test
the number of sensors and axes acquired at the same time. The frequency is increased by 1458 Hz in
1. Very the
significant improvements in the acquisition frequency from 80% to 140% are obtained. The
best case. Figure 8c shows the increase in the relative acquisition frequency between Test 2 and
increaseTest
in the sampling
1. Very significantrate is due to a reduction
improvements in thefrequency
in the acquisition sent bytes.fromIt80%is observed
to 140% arethat the increase
obtained.
in speedThe is increase
greaterinwhen the number
the sampling of sensors
rate is due or axes
to a reduction acquired
in the sent bytes.simultaneously
It is observed thatistheincreased.
increase This
happensinbecause
speed is the
greater when the
number number
of bytes of sensors
sent is greateror axes acquired
in each datasimultaneously is increased. This
string, the improvement of the new
method happens because thetonumber
is proportionale of bytes
the numer of sent
bytesis sent.
greaterThe
in each data string,
relative deviationthe improvement of the new
in the acquisition frequency
method is proportionale to the numer of bytes sent. The relative deviation in the acquisition
is shown in Figure 8d. We can see that the measures discarded by this method are greater than in Test
frequency is shown in Figure 8d. We can see that the measures discarded by this method are greater
1. Figurethan
8e in
shows
Test 1.the errors
Figure foundthe
8e shows inerrors
the .log
foundfile.
in the .log file.

Figure 8. (a) Acquisition frequency depending on the number of sensors and axis read at the same time
with data framing method, (b) total variation of the data acquisition frequency between Test 1 and
Test 2, (c) percentage increase of the data acquisition frequency between Test 1 and Test 2, (d) acquisition
frequency RSD depending on the number of sensors and axis read with data framing method, and (e)
total error rate in Test 2.
Sensors 2020, 20, x FOR PEER REVIEW 14 of 21

Figure 8. (a) Acquisition frequency depending on the number of sensors and axis read at the same
time with data framing method, (b) total variation of the data acquisition frequency between Test 1
and Test 2, (c) percentage increase of the data acquisition frequency between Test 1 and Test 2, (d)
Sensorsacquisition
2020, 20, 524frequency RSD depending on the number of sensors and axis read with data framing 14 of 21
method, and (e) total error rate in Test 2.

The
The result
result ofof Test
Test 33 is
is shown
shown in in Figure
Figure 9.
9. Figure
Figure 9a
9a shows
shows the
the acquisition
acquisition frequency
frequency versus
versus the
the
number of sensors acquired. A decrease in the acquisition frequency is observed
number of sensors acquired. A decrease in the acquisition frequency is observed as compared with as compared with
Test
Test 2. This difference
2. This difference is is observed
observed in in Figure
Figure 9b9b and
and inin Figure
Figure 9c,
9c, where
where thethe absolute
absolute and and relative
relative
difference
difference of the acquisition frequency are, respectively, represented. The acquisition frequency
of the acquisition frequency are, respectively, represented. The acquisition frequency
decreases
decreases totoaalower
lowerextent
extentwhen
whenthe thenumber
number ofofsensors
sensors or or
measurements
measurements is smaller. ThisThis
is smaller. is because the
is because
sending of the
the sending of checksum
the checksum byte byte
has ahas
greater influence
a greater on time
influence onwhen the number
time when of bytes
the number ofof dataof
bytes sent is
data
smaller. The acquisition frequency for 1 MPU6050 measuring 1 axis is 2770 Hz.
sent is smaller. The acquisition frequency for 1 MPU6050 measuring 1 axis is 2770 Hz. With 8 sensorsWith 8 sensors taking a
measurement the frequency
taking a measurement decreasesdecreases
the frequency to 490 Hz.toThe 490relative
Hz. Thestandard
relative deviation
standard of the frequency
deviation of the
(RSD)
frequency (RSD) is between 10% and 20% and is represented in Figure 9d. Finally, the errorsare
is between 10% and 20% and is represented in Figure 9d. Finally, the errors recorded shown
recorded
in
areFigure
shown9e. in Under
Figure laboratory conditionsconditions
9e. Under laboratory no checksum errors wereerrors
no checksum found during
were foundtheduring
tests. The most
the tests.
frequent
The mosterror is still
frequent sending
error is stillbyte strings
sending thatstrings
byte are toothat
short.
are too short.

Figure 9. Cont.
Sensors 2020, 20,
Sensors 2020, 20, 524
x FOR PEER REVIEW 15
15 of
of 21
21
Sensors 2020, 20, x FOR PEER REVIEW 15 of 21

Figure 9. (a) Acquisition frequency depending on the number of sensors and axis read at the same
Figure
Figure
time 9.9. (a)
with (a) Acquisition
Acquisition
Checksum methodfrequency
frequency depending
depending
and 4 bytes on
of time,on the
the
(b) number
number
total of sensors
of
variation sensors and acquisition
and
of the data axis read
axis read at
atfrequency
thesame
the same
time
time with
with Checksum
Checksum method
method and
and 44 bytes
bytes of
of time,
time, (b)
(b) total
total variation
variation of
of the
the
between Test 2 and Test 3, (c) percentage increase of the data acquisition frequency between Test 2data
data acquisition
acquisition frequency
frequency
between
between
and Test
Test Test
3, (d)22acquisition
andTest
and Test3,3,frequency
(c)percentage
(c) percentage increase
RSDincrease
depending ofthe
of the datanumber
on data
the acquisition
acquisition frequency
frequency
of sensors between
andbetween Test
axis readTestwith22
and
and Test 3,
Test 3, (d)
Checksum, (d) acquisition
andacquisition frequency
frequency
(e) total error RSD depending on the number of sensors and
RSD3.depending on the number of sensors and axis read with
rate in Test axis read with
Checksum,and
Checksum, and(e) (e)total
totalerror
errorrateratein
inTest
Test3.3.
Figure 10 shows the result of Test 4. Figure 10a shows the acquisition frequency for different
Figure
Figure 10 shows the result
resultatof Test 4.4. Figure 10a
10a shows the acquisition frequency for
for different
numbers of 10 showsand
sensors the axes oftheTest
same Figure
time. Figure shows10b the
shows acquisition frequency
the absolute difference different
in the
numbers
numbers of
of sensors
sensors and
and axes
axes at
at the
the same
same time.
time. Figure 10b shows shows the
the absolute
absolute difference
difference in
in the
the
acquisition frequency between Tests 4 and 3, whereas Figure 10c shows the relative increase. There
acquisition
acquisition frequency
frequency between Tests
between frequency 4 and
Tests 4 andthanks3, whereas
3, whereas Figure 10c shows the relative increase. There is
is an increase in the acquisition to the Figure
reduction 10c ofshows the relative
one byte of the time increase. There
variable. In
an increase
is an increasein the acquisition
in the acquisition frequency
frequency thanks to the
thanks to reduction
theachieved of one
reduction of byte of the
one byte oftime variable.
the time In this
this case, the increment on the acquisition frequency becomes linear with the variable.
number of In
case, the
this case, increment
the incrementon the acquisition frequency achieved becomes linear with the number of sensors
sensors connected to the on the acquisition
system. This new layer frequency
reduces achieved
one byte becomes linear for
on the string witheachthesensor,
number and of
connected
sensors to the system.
connected to the This newThis
system. layernew reduces
layer one byte on
reduces onethe
bytestring
on for string
the each sensor,
for eachand therefore
sensor, and
therefore the string is reduced in length proportionally to the number of sensors, in contrast with the
the string is
therefore thereduced
string isinreduced
length proportionally
in length to the number
proportionally to theof sensors,ofinsensors,
number contrast with the previous
previous layer, for which an extra checksum byte is included in the data string no in contrast
matter with the
the number
layer, for
previous which
layer, an extra
for being
whichsent checksum
an extra byte
checksum is included in the
byte isconnected). data string
included inTherefore, no matter
the data string the
nocase,number
matter of bytes
the number
of bytes that were (number of sensors in that a logarithmic
that werethat
of bytes being sentbeing
were (number of sensorsof connected). Therefore,Therefore,
in that case, inathat
logarithmic trend was
trend was found. The timesent (number
needed to calculate sensors connected).
the checksum is very small, and case, aits
therefore logarithmic
influence
found. Thefound.
time needed toneeded
calculate the checksum is very small, and therefore its influence on the
on the acquisition frequency is small. The acquisition frequency is mainly determined by theinfluence
trend was The time to calculate the checksum is very small, and therefore its number
acquisition
onbytes frequency
the acquisition is small. The acquisition frequency is mainly determined by the number of bytes
of sent. The frequency is small. The
standard deviation of acquisition
the frequency frequency
is shown is mainly
in Figuredetermined
10d where by the number
a variation
sent. The sent.
of bytes standardThe deviation
standard of the frequency
deviation is
of thefound shown inisFigure
frequency shown 10d where a10d
variation between 7%
between 7% and 20% is observed. The errors are mostly shortinchain.
FigureThese where
results aare variation
shown
and 20% is7%
between observed.
and 20% The
is errors found
observed. The are
errorsmostly
found short
are chain.
mostly These
short results
chain. are
Theseshown in Figure
results are 10e.
shown
in Figure 10e.
in Figure 10e.

Figure 10. Cont.


Sensors 2020, 20, 524 16 of 21
Sensors 2020, 20, x FOR PEER REVIEW 16 of 21

Figure 10.
Figure 10. (a)
(a) Acquisition
Acquisition frequency
frequency depending
depending on on the
the number
number of of sensors
sensors and
and axis
axis read
read at
at the
the same
same
time with
time with Checksum
Checksum method
method and and 33 bytes
bytes of
of time,
time, (b)
(b) total
total variation
variation of
of the
the data
data acquisition
acquisition frequency
frequency
betweenTest
between Test33andandTest
Test4, 4,
(c)(c) percentage
percentage increase
increase of the
of the datadata acquisition
acquisition frequency
frequency between
between Test Test
3 and3
and 4,
Test Test
(d) 4, (d) acquisition
acquisition frequency
frequency RSD depending
RSD depending on the on the number
number of sensors
of sensors and axisand
readaxis read
with withof1
1 byte
byte reduction,
time of time reduction, and (e)
and (e) total total
error error
rate rate4.in Test 4.
in Test

The
The results
results of
of Test
Test55are
areshown
shownin inFigure
Figure11. 11. Figure
Figure 11a
11a shows
shows the
the absolute
absolute values
values ofof acquisition
acquisition
frequency
frequency versus
versus the
the number
number of of sensors
sensors and
and acquired
acquired axes.
axes. Figure
Figure 11b shows the absolute frequency
frequency
difference
difference between Test 5 and Test 4. It is observed that the frequency of acquisition is reduced
between Test 5 and Test 4. It is observed that the frequency of acquisition is reduced
moderately
moderatelydue duetotothe
thestuffing
stuffingcalculation.
calculation.As Asthe
thenumber
numberofofbytes sent
bytes does
sent notnot
does increase, there
increase, are are
there no
significant changes
no significant changesin the acquisition
in the acquisitionspeed
speedasascompared
compared with
withTest
Test4.4.Figure
Figure11c
11cshows
showsthe therelative
relative
difference
difference ininthe
theacquisition
acquisition frequency
frequency between
between bothboth tests.
tests. The
The relative
relative deviation
deviation ofof the
the frequency
frequency is is
shown
shown in in Figure
Figure 11d.
11d. Deviation
Deviation has has been
been significantly
significantly reduced
reduced duedue to
to aa decrease
decrease in
in errors.
errors. No
No errors
errors
were
weredetected
detectedduring
duringthethetests.
tests.WeWeobtain
obtaina frequency
a frequencyof 3125 Hz for
of 3125 Hz 1for
MPU6050 sensor
1 MPU6050 acquiring
sensor with
acquiring
an axis.
with an axis.
Sensors 2020, 20, 524 17 of 21
Sensors 2020, 20, x FOR PEER REVIEW 17 of 21

Figure 11.
Figure 11. (a)
(a) Acquisition
Acquisition frequency
frequency depending on the number of sensors and axis read read at
at the
the same
same
time
time with
with stuffing
stuffing method
method and and 33 bytes
bytes of
of time,
time, (b)
(b) total
total variation
variation of
of the
the data
data acquisition
acquisition frequency
frequency
between
between Test
Test44and
andTest
Test5, 5,
(c)(c)
percentage increase
percentage increaseof the data
of the acquisition
data frequency
acquisition between
frequency Test Test
between 4 and4
Test 5, and
and Test (d) acquisition
5, and frequency
(d) acquisition RSD
frequency RSDdepending
depending ononthethe
number
number ofofsensors
sensorsand
andaxis
axisread
read with
with
stuffing
stuffing method
method andand 11byte
byteof oftime
timereduction.
reduction.

4. Discussion and Conclusions


4. Discussion and Conclusions
Figure 12a shows the acquisition frequency variation for different number of sensors obtained
Figure 12a shows the acquisition frequency variation for different number of sensors obtained
when the different layers are included in the communication protocol. It can be observed that as soon
when the different layers are included in the communication protocol. It can be observed that as soon
as the Serial.print function (labeled as 1) is replaced by the data framing approach (labelled as 2) the
as the Serial.print function (labeled as 1) is replaced by the data framing approach (labelled as 2) the
sampling frequency is drastically increased. This is due, on one hand, to the fact that the number of
sampling frequency is drastically increased. This is due, on one hand, to the fact that the number of
bytes needed to transmit the information with the new approach is significantly reduced. On the other
bytes needed to transmit the information with the new approach is significantly reduced. On the
other hand, the conversion of the actual value of a sensor‘s measure into the ASCII code transmitted
connected to a remote computer to transmit the data acquired in real time. The ready-to-use
communication functions provided by a conventional low-cost platform such as Arduino present
some drawbacks in terms of speed and error tracking in the communication process. The results
presented in this paper depict a custom communication protocol that is able to increase the
acquisition
Sensors frequency
2020, 20, 524 by more than 200% as compared with that obtained by conventional protocols. 18 of 21
It is based on serial bus and it has been built in different steeps. At each step a different layer is added
and tested to observe the impact on the performance. Some layers aim to increase the communication
hand, the
speed, conversion
whereas other of the actual
layers value of a sensor‘s
are implemented measure
to guarantee theinto the ASCII
robustness andcode transmitted
data by
consistency.
Serial.print is not needed anymore. Consequently, the time needed to send the information
Layers are added alternatively, increasing speed in one step and improving robustness in the next over the
serial port is reduced.
one.

Sensors 2020, 20, x FOR PEER REVIEW 19 of 21

Figure 12. (a)Variation


12. (a) Variationofof acquisition
acquisition frequency
frequency according
according to the
to the method
method used,used, (b) variation
(b) variation of
of data
data transmission
transmission errorserrors according
according to the method
to the method used,
used, and (c)and
RSD(c)
of RSD of the acquisition
the acquisition frequencyfrequency by
by method
method used.
used.

Whenstandard
The the second layer is of
deviation introduced into the frequency
the acquisition protocol, a ischecksum
considered operation is performed
as a measure of thein
the side of theofLC-DAQ
performance the protocoland in anterms
extra of byte is sent within
robustness. the bytes’
Aleatory string.imply
data losses The checksum operation
larger variability on
increases the time that the microcontroller takes to perform a loop of its program
the time needed for a data string to be correctly delivered to the remote PC. Furthermore, the errors and the extra byte
increasesin
detected the time
the needed to are
transmission transmit
logged theininformation.
order to identifyBoth which
times impact
kinds ofnegatively
errors areon morethe recurrent
sampling
frequency,
for as can be observed in the line labeled as 3.
each layer.
Up to
The new this point, the
protocol resolutiontoofsend
is developed the rawtimedata
variables was set
bytes over the as 32 bits
serial port(4in bytes).
a framed Instructure
order to
improve the frequency, this resolution is reduced to 3 bytes. For each
which includes byte stuffing and 8 bits checksum. Furthermore, the resolution of time variables sensor measure, this implies
could
thatreduced
be the number
to 24of bytes
bits is reduced
by the inclusionin ofonea byte. Line number
time-correction 4 shows
routine thathow the sampling
maintains the time frequency
coherence is
increased notably with this
for virtual infinite measuring times. approach.
Withsystematic
The the previous three layers,
analysis it can be observed
of the performance of thisthat
new theprotocol
numbershows of errors
thatproduced
the amount on the
of
serial communication increases with the number of sensors connected
information sent over serial ports are the bottleneck on the acquisition process when low-cost to the system (see Figure 12b).
Similarly, as
platforms areitused.
is shown in Figure
Reducing 12c, the of
the number variation
bytes oninthe
thedata
frequency
stringsachieved
becomes tends
crucialtotoincrease
increasewith
the
the numberfrequency.
acquisition of sensors.On However,
the other as hand,
soon as it the
wasstuffing
observedlayer
thatis the
included in theaprotocol
error with this trend
higher recurrence
disappears
received a and
bytethe number
string of errors
shorter thanisexpected.
reduced toItpractically
is produced zero.whenIn thethe
lightstuffing
of the results,
layer wasit cannot
be
inferred that the vast majority of errors are due to the misinterpretation
implemented and a data byte with similar pattern of an ETX byte was mistaken by the serial reading of one data byte as an end of
transmission
program in thebyte PC(ETX).
as theOnce
endthe of stuffing
transmission strategy is adopted
sequence. the errors
However, once arethe
fully avoided
stuffing andwas
layer the
variation on the acquisition frequency
included, these errors were reduced to zero. is reduced, as shown in Figure 12c.
Finally, an LC-DAQ acquisition system featuring this new protocol can double the acquisition
frequency obtained with the baseline protocol. The number of errors in the transmission is reduced
to practically zero and the variability on the communication times (acquisition frequency) takes very
low values, similar to those obtained with the baseline protocol. Therefore, we conclude that this
research supports the development of a powerful and suitable low-cost system for multisensor data
acquisition in experiments where high frequency dynamics is involved.
Sensors 2020, 20, 524 19 of 21

With the new communication protocol over the serial bus, including the four layers described in
Section 2, higher acquisition frequencies can be obtained maintaining the robustness of the system.
As a result of these improvements, a reliable low-cost data acquisition system that is capable of
high acquisition frequencies is ready to be used in real-time vehicular dynamics. This system can
be connected to a remote computer to transmit the data acquired in real time. The ready-to-use
communication functions provided by a conventional low-cost platform such as Arduino present
some drawbacks in terms of speed and error tracking in the communication process. The results
presented in this paper depict a custom communication protocol that is able to increase the acquisition
frequency by more than 200% as compared with that obtained by conventional protocols. It is based
on serial bus and it has been built in different steeps. At each step a different layer is added and tested
to observe the impact on the performance. Some layers aim to increase the communication speed,
whereas other layers are implemented to guarantee the robustness and data consistency. Layers are
added alternatively, increasing speed in one step and improving robustness in the next one.
The standard deviation of the acquisition frequency is considered as a measure of the performance
of the protocol in terms of robustness. Aleatory data losses imply larger variability on the time needed
for a data string to be correctly delivered to the remote PC. Furthermore, the errors detected in the
transmission are logged in order to identify which kinds of errors are more recurrent for each layer.
The new protocol is developed to send raw data bytes over the serial port in a framed structure
which includes byte stuffing and 8 bits checksum. Furthermore, the resolution of time variables could
be reduced to 24 bits by the inclusion of a time-correction routine that maintains the time coherence for
virtual infinite measuring times.
The systematic analysis of the performance of this new protocol shows that the amount of
information sent over serial ports are the bottleneck on the acquisition process when low-cost platforms
are used. Reducing the number of bytes on the data strings becomes crucial to increase the acquisition
frequency. On the other hand, it was observed that the error with a higher recurrence received a byte
string shorter than expected. It is produced when the stuffing layer was not implemented and a data
byte with similar pattern of an ETX byte was mistaken by the serial reading program in the PC as
the end of transmission sequence. However, once the stuffing layer was included, these errors were
reduced to zero.
Finally, an LC-DAQ acquisition system featuring this new protocol can double the acquisition
frequency obtained with the baseline protocol. The number of errors in the transmission is reduced to
practically zero and the variability on the communication times (acquisition frequency) takes very low
values, similar to those obtained with the baseline protocol. Therefore, we conclude that this research
supports the development of a powerful and suitable low-cost system for multisensor data acquisition
in experiments where high frequency dynamics is involved.
The system, as it is currently conceived, needs to be connected to a computer for real-time
acquisition applications. Further steps in the research are being taking in order to improve the system
with a long-range wireless connection, and therefore a robust and high frequency capable telemetry
system can be developed. For future research, we plan to analyze different technologies to replace
the physical connection with the master computer with a wireless connection capable of operating
over a long range (more than 500 m) with an acquisition frequency similar to that achieved in this
investigation. These technologies could be based on 2.4 Ghz WiFi or LPWAN (low-power wide-area
networks) more oriented to IoT [20], such as LoRa, NB-IoT, or Lte Cat-M1.

Author Contributions: Conceptualization, C.M., J.L.O. and A.G.; methodology, C.M. and A.G.; software, C.M. and
A.G.; validation, C.M. and A.G.; formal analysis, C.M.; investigation, C.M., J.L.O., and A.G.; resources, J.L.O. and
J.V.; data curation, C.M. and A.G.; writing—original draft preparation, J.L.O., C.M., and A.G.; Writing—Review
& Editing, J.L.O., J.V., C.M.; Supervision, J.L.O. and J.V.; Project Administration, C.M., J.L.O., and J.V.; funding
acquisition, J.L.O. and J.V. All authors have read and agreed to the published version of the manuscript.
Funding: This research was funded by the Comunidad de Madrid, grant number SEGVAUTO
4.0-CM-P2018EEMT-4362 and by the Agencia Estatal de Investigación RETOS 2018-RTI2018-095923-B-C22.
Sensors 2020, 20, 524 20 of 21

Acknowledgments: The authors wish to thank the support of the “Cátedra de Recuperación de energía en el
transporte de superficie” by Banco Santander.
Conflicts of Interest: The authors declare no conflict of interest.

References
1. González, A.; Olazagoitia, J.L.; Vinolas, J. A low-cost data acquisition system for automobile dynamics
applications. Sensors 2018, 18, 366. [CrossRef] [PubMed]
2. Ausilio, A.D. Arduino: A low-cost multipurpose lab equipment. Behav. Res. Methods 2012, 44, 305–313.
[PubMed]
3. Ferencz, K.; Domokos, J. IoT sensor sata acquisition and storage system using raspberry pi and apache
cassandra. In Proceedings of the 2018 International IEEE Conference and Workshop in Óbuda on Electrical
and Power Engineering (CANDO-EPE), Budapest, Hungary, 20–21 November 2018; pp. 000143–000146.
4. Wali, S.; Areeb, M. Development of low-cost DAQ for power system signals using arduino. In Proceedings
of the 2018 IEEE 21st International Multi-Topic Conference (INMIC), Karachi, Pakistan, 1–2 November 2018;
pp. 1–5.
5. Moreno, R.O.; Armindo, R.A.; Moreno, R.L. Development of a low-cost automated calorimeter for determining
soil specific heat. Comput. Electron. Agric. 2019, 162, 348–356. [CrossRef]
6. Cruz, L.A.A.; Griño, M.T.T.; Tungol, T.V.M.; Bautista, J.T. Development of a low-cost air quality data
acquisition loT-based system using arduino leonardo. Int. J. Eng. Manuf. 2019, 3, 1–18.
7. Bardaji, R.; Sánchez, A.M.; Sánchez, C.; Wernand, M.R.; Piera, J. Estimating the underwater diffuse attenuation
coefficient with a low-cost Instrument: The KdUINO DIY buoy. Sensors 2016, 16, 373. [CrossRef] [PubMed]
8. Damcı, E.; Şekerci, Ç. Development of a low-cost single-axis shake table based on arduino. Exp. Tech. 2019,
43, 179–198. [CrossRef]
9. Ozdagli, A.; Liu, B.; Moreu, F. Real-Time low-cost wireless reference-free displacement sensing of railroad
bridges. In Sensors and Instrumentation, Aircraft/Aerospace and Energy Harvesting; Wee sit, E., Walber, C.,
Walter, P., Wicks, A., Seidlitz, S., Eds.; Springer Cham: New YorK, NY, USA, 2019; Volume 8, pp. 103–109.
10. Barile, G.; Leoni, A.; Pantoli, L.; Stornelli, V. Real-time autonomous system for structural and environmental
monitoring of dynamic events. Electronics 2018, 7, 420. [CrossRef]
11. Gopalakrishna, G.K.; Padubidre, S.P. Development of low cost system for condition monitoring of rolling
element bearing using MEMS based accelerometer. In Proceedings of the AIP Conference Proceedings,
Cesme-Izmir, Turkey, 8 March 2019. [CrossRef]
12. Zafar, M.; Kratkiewicz, K.; Manwar, R.; Avanaki, M. Development of low-cost fast photoacoustic computed
tomography: System characterization and phantom study. Appl. Sci. 2019, 9, 374. [CrossRef]
13. Afreen, F.; Kratkiewicz, K. Review of cost reduction methods in photoacoustic computed tomography.
Photoacoustics 2019, 15, 100137.
14. Castellanos, J.C.; Fruett, F. Embedded system to evaluate the passenger comfort in public transportation
based on dynamical vehicle behavior with user’s feedback. Measurement 2014, 47, 442–451. [CrossRef]
15. Wei, L.; Qiao, J.; Liu, Y. Data acquisition and processing of driving operation system for vehicle dynamics
simulation. ICIC Express Lett. Part B Appl. Int. J. Res. Surv. 2018, 9, 819–826.
16. Vaitkus, V.; Lengvenis, P.; Zylius, G. Driving style classification using long-term accelerometer information.
In Proceedings of the 2014 19th International Conference on Methods and Models in Automation and
Robotics (MMAR), Miedzyzdroje, Poland, 2–5 September 2014; pp. 641–644.
17. van Ly, M.; Martin, S.; Trivedi, M.M. Driver classification and driving style recognition using inertial
sensors. In Proceedings of the 2013 IEEE Intelligent Vehicles Symposium (IV), Gold Coast, QLD, Australia,
23–26 June 2013; pp. 1040–1045.
18. Viana, J.D.F.; Neto, G.V.A.; Galdino, I.M.; Oliveira, A.M.B.; Braga, R.B.; Oliveira, C.T. A visualization and
analysis approach of cyclist data obtained through sensors. In Proceedings of the 2017 IEEE 1st Summer Sch.
Smart Cities (S3C), Natal, Brazil, 6–11 August 2017; pp. 13–18.
Sensors 2020, 20, 524 21 of 21

19. Ambrož, M.; Hudomalj, U.; Marinšek, A.; Kamnik, R. Raspberry pi-based low-cost connected device for
assessing road surface friction. Electronics 2019, 8, 341. [CrossRef]
20. Gabriele, T.; Pantoli, L.; Stornelli, V.; Chiulli, D.; Muttillo, M. Smart power management system for home
appliances and wellness based on wireless sensors network and mobile technology. In Proceedings of the
2015 XVIII AISEM Annual Conference, Trento, Italy, 3–5 February 2015.

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access
article distributed under the terms and conditions of the Creative Commons Attribution
(CC BY) license (http://creativecommons.org/licenses/by/4.0/).

You might also like