Professional Documents
Culture Documents
Abstract. Different process automation requirements among global trends[2][3], but has greater capabilities that extend
university students and researchers prompted the design and its potential use to a larger community of users and
development of a data acquisition and control board for use in maximize opportunities for exchange and collaboration
automation activities and for taking readings in educational with students and researchers from other universities
laboratories and industrial environments, using open-source around the world working in a variety of fields. This board
software and hardware. This study includes a detailed will enable university students to learn about 32-bit
description of the solution that was developed to respond to these microcontrollers through a practical, concrete application
needs: it begins by presenting the different components that that can be used for data acquisition and control.
make up the system, which was designed around the Arduino
Due platform. It then provides a detailed functional description Another factor that spurred us on with developing
of these before discussing preliminary trials that were carried designs of our own, building on our experience to date, was
out using the test board. These trials proved that the main the realization that we have the tools and knowledge to
components function correctly and point to the need to continue tackle any problems or issues that the system may pose and
work on the prototype board to obtain more conclusive evidence the ability to modify it without depending on private
that the expected results have been achieved and to check all companies whose technical support services in Argentina
component interactions on the final version. often leave much to be desired.
Keywords: data acquisition, control loop, industrial The development of the system is based on the Arduino
automation, open-source hardware, free software Due platform [4], which we chose because it is widely
developed, stable, and has a wealth of information available
I. INTRODUCTION on it. The main addition to the earlier model is the use of a
Toward the end of 2015, our workgroup successfully microcontroller with greater processing power. This makes
built a data acquisition system (DAQ) based on open- a larger number of entry and exit channels available and
source hardware and software that is designed to be used as orients the design toward taking readings and
a teaching tool in the Science and Engineering Laboratories measurements and industrial automation.
at the National University of General Sarmiento (UNGS),
Argentina[1]. To our satisfaction, the system is already II. SYSTEM STRUCTURE AND COMPOSITION
being used as part of different studies carried out by Briefly, the system is made up of a hardware device,
students and researchers at UNGS. For example, (1) it was based on a 32-bit microcontroller [5] (Arduino Due); the
used to control a solar tracker in a parabolic dish for firmware that runs on this; a set of signal sensors or
generating electricity; (2) it formed part of the automation adapters that transform physical values of interest into the
system for a composting plant developed by students appropriate electrical signals; and computer software that
working on this case study; (3) it has been used for different communicates with the device to configure it and obtain
teaching purposes, and is included in the standard practical readings, the values of which it visualizes and stores. The
exercises on the UNGS technical degree program in system can also be connected to central automation systems
Automation. via standard buses. Fig. 1 is a conceptual diagram of the
system.
However, due to the varied requirements of the different
research teams and student groups, we decided to increase
the functionalities of this initial prototype.
Consequently, the new DAQ that is presented in this
paper is similar in essence to the original in that it uses both
open-source hardware and software, in keeping with current
Inputs
RS485 I2C DIGITAL
USB CAN
SPI I/O
CAN E2
WIFI USART
ADC PWM SD o Eight digital optocoupler inputs, 0 to 24V
PC USB FLASH
o Eight single-ended analog inputs, 0 to 10V, 0 to
20mA, jumper selectable
PDA
ANALOG ANALOG DIGITAL DIGITAL o Four programmable gain analog instrumentation
INPUTS OUTPUTS INPUTS OUTPUTS
inputs for special measurements, 0 to 3.3V @
0.5mA
CENTRAL
AUTOMATION
Buses
o Generic I2C SPI GPIO bus (e.g., for 1-wire,
interrupts, and triggers)
Communications
Fig. 1. Conceptual diagram of the system o RS485
o RS232
These components are described in more detail below.
o USB serial port (for Arduino Due board)
A. Specifications
The hardware specifications for the data acquisition and o CAN
control system based on Arduino Due were established o WiFi board connector (based on ESP8266)
based on the premise that the project is aiming to provide
solutions for or respond to industrial automation needs. Storage
Consequently, our design provides analog outputs that o SD card connector
are used as control loops, as this allows the continuous o EEPROM (I2C) memory
modification of two actuators that can intervene in each
loop, within a range of specifications. The analog inputs o Flash memory (SPI)
and outputs are between 0 and 10 volts or 4 and 20 mA and
can be selected by the user. The device was also designed RTC
to include RS485 and RS232 buses and WiFi. The latter o I2C, lithium battery
feature is not directly oriented toward automation but does
open up other development possibilities. Finally, to extend Maximum sampling frequency
the potential uses of the system, the CAN communication o 52 us @ 12 bits. All selected channels are
protocol was included, making it possible to link it up with displayed every 52 us.
controls in the automotive sector. All in all, the 32-bit
microcontroller provides a wide range of features and Power supply
significant processing power. o Transformer: 9Vac+9Vac, 40VA
Having analyzed the general features of the system that o Input in continuous: 15Vdc, 40VA
we have developed, in the following section we provide
detail descriptions of the components used in the system B. Architecture design
hardware and their respective technical specifications: Architecture design specifically involves defining how a
PCB (printed circuit board) solution will work. Our analysis of the project objectives
and framework pointed to two different design options: a
o Surface-mounted modular design or an integrated design1. However, given
o Four layers the initial specifications described above, we decided that it
would make sense for the device to carry out some of its
o Material: FR4 functions autonomously and some connected to other
Outputs equipment (such as a PC, automation center, etc.).
o Four relay outputs, 24V @ 1A Although a modular design would simplify each board,
the need for more connectors could increase potential
o Four Open Drain outputs, 24V @ 0.5A
o Four PWM outputs, 0 to 3.3V @ 10mA 1
It is worth noting that very high profile international companies develop
both modular and integrated versions.
failure points. Likewise, as the board is designed for input tests, we used another test board that we made
automation and has sufficient inputs, outputs, and ourselves.
communication ports, we ultimately opted for an integrated
How the board will look when it is finished is displayed
design.
in fig. 3 and fig. 4, which show the top and bottom views,
Having established these basic features, we completed respectively, of the PCB with all components in position.
the system architecture, which included the following
design components:
a) Schematic and PCB hardware design
The hardware design began with diagramming the
schematic circuit (fig. 2).
The initial idea for the PCB design was to organize all
the functions into a two-layer board. However, after
developing a preliminary design and reviewing it with the
PCB supplier [7], we concluded that the board needed a
four-layer design.
We should point out here that developing the control
system and data acquisition board required our contacting
several suppliers who carried out or will carry out different
stages in the manufacturing and assembly process for the
definitive prototype board. We communicated with
suppliers regarding: (1) board manufacture [7], (2)
component acquisition [8], and (3) the assembly of the final Fig. 4. Bottom view of the PCB
version of the board. Given that the board is surface-
mounted and that this type of assembly entails specific b) Firmware and software versions
expertise, we decided that the components should be In parallel to the above tasks, the development was
assembled by an external supplier [9]. monitored using GitHub [6] for the firmware and software
The project suffered some setbacks due to delays in versioning. This is a tool that allows components to be
deliveries of components from outside Argentina. For this systematically reviewed as they are developed.
reason, to avoid delays in the subtasks planned as part of c) Firmware
our initial schedule, we used an experimental board from
the firm Mikroelectronika [10], to which we adapted both In order to simplify the use of the board, it was decided
the power supply and signaling of the Arduino board. This that the board communicate with the peripherals through
allowed us to test the firmware modules of the SD memory, commands. Each command would be a specific
the clock, some of the digital inputs and outputs, the RS232 communication, but they are all structured similarly to
port, the USB port, and the logging modules. For the digital achieve a certain degree of standardization, which will
make it easier to add new commands or delete unwanted
ones. In accordance with our specifications, a generic TABLE II. COMMANDS – (CONT)
command format was defined, which is described in detail
U. //Transmission of digital input channels in a single binary byte,
in table I. (ESC U CR)
W. // Set WiFi network and Password, (ESC W Network 0xFF
TABLE I. GENERIC COMMANDS Password 0xFF CR), Maximum 15 ASCII-character
network name and password
Generic command format d. // Download EEPROM data, (ESC d CR)
Esc Attention e. //Transmit data from the unit, (ESC e CR), responds with basic
Character or number Command type project data
Data Command data h. //Transmit RTC day and time, (ESC h CR), responds with unit day
and time
Not only is this a versatile, concrete form of Ref.:
communication, but any additional specifications that users ESC = Escape (0x1b)
wish to incorporate and that entail a relationship with CR = Carriage Return (0x0d)
peripherals can be implemented similarly, such that all
current and future communications are standardized.
The commands that are currently defined for all The board functions in different modes. This is directly
communications are listed in table II. associated with each of its features, depending on the
measurement and/or control function sought. These modes
are mutually exclusive.
2
Given that the system was designed around the use of free hardware and
software, our decision to provide a preliminary interface is far from being
a limiting factor for future designs nor should it be considered in any way
closed or finishing. This interface is a preliminary component—an HMI or
a PDA are examples of possible interfaces that could be developed in the
future.
source, (2) it is supported by an active community of users We used the following graphics libraries: PyQt [14] to
and programmers, (3) it is well-documented, (4) the design the windows and PyQtGraph [14] for plotting data in
programs run on multiple platforms with virtually no two-axes Cartesian graphics.
modifications to the source code, (5) the research team was
The diagram of the software is presented in three layers:
very familiar with it, (6) it supports multiple programming
paradigms, (7) it allows complex applications to be the presentation layer, in which the view is created in
developed, and (8) numerous open-source libraries are QtDesigner .xml files [15] and controlled by Python
available for specific applications such as 2D and 3D (which uses the .xml files from the view);
graphics, communications, graphical user interfaces, the logic layer, in which part of the board’s logic and its
scientific calculations, and web development. state is represented; and
the data access layer, where information is saved on the
hard drive and communication with the series port takes
TABLE III OPERATING MODES place.
Basic specifications for each The layers are ordered as followed: presentation, logic
Description
mode and data access. Each layer only makes use of the layer
DAQ1 "Online" (Mode 1): The board will be asked in real time via immediately below it, so the view layer only sees the logic
- Analog input channels the available communications channel
- Maximum of 8 (e.g. RS232) for the status of the layer, and the logic layer only sees the data access layer.
- Digital input channels analog and digital channels that were
- Maximum of 8 set when the readings were configured.
Fig. 5 shows an example of one of the visualizations
The board will log the status of the that have already been generated, representing a random
analog and digital channels that were variable simulated by the software itself.
DAQ1 "Logging" (Mode 2):
set when the readings were configured
- Analog input channels
on one of the available memory cards.
- Maximum of 8
When required, the data log for the
- Digital input channels
readings can be downloaded via the
- Maximum of 8
chosen communications channel and
processed accordingly.
The board will be asked in real time via
DAQ2 "Online" (Mode 3):
the available communications channel
- Analog input channels
(e.g. RS232) for the status of the
- Maximum of 4
analog and digital channels that were
- Instrumentation-type
set when the readings were configured.
The board will log the status of the
analog and digital channels that were
DAQ2 "Logging" (Mode 4): set when the readings were configured
- Analog input channels on one of the available memory cards.
- Maximum of 4 When required, the data log for the
- Instrumentation-type readings can be downloaded via the
chosen communications channel and
processed accordingly.
AUI (Mode 5): Fig. 5. Screenshot of the software’s graphic interface
The board must be capable of taking
- Analog input channels
readings from all the input channels
- Maximum of 8
specified in the configuration and act
III. PRELIMINARY TESTS
- Analog output channels
- Maximum of 2
on the corresponding output channels We have already discussed the difficulties we faced
as per its programming. regarding the availability of components for the assembly
- Digital input channels
This implies the existence of a control
- Maximum of 8
group, be it remote (the decision- of the prototype board. Consequently, we decided to carry
- Digital relay output channels out our preliminary trials on test boards to analyze
making takes place at an automation
- Maximum of 4
- Digital Open Drain output
center) or local (the board itself makes fundamental aspects such as the behavior of device drivers,
the decisions in question). ADC speed, USB and RS232 communications, and signal
channels
- Maximum of 4
NOTE: This project did not include the reading without the setting and/or amplification stages.
- PWM outputs
implementation of a local control loop
- Maximum of 2
but includes everything necessary to
Although we were fully aware that these types of
- RS232 and RS485
implement a remote one. readings would not show how the actual device would
communication work, they would be useful for adjusting the individual
The board must be capable of
measuring the times between events.
functioning of components such as those already described.
TMS (Mode 6): These are manifested through a change At the time of writing, the entire set of commands had
- Between 2 inputs in the status of a single digital input or
-From a single input between two different digital inputs.
been tested; satisfactory USB and RS232 communications
The result will be reported through the had been established between a PC running the software
appropriate communications channel. and the device firmware; and continuous data transmission
had even been tested. Only basic commands had been tried
via WiFi as the limited bandwidth prevented continuous
transmission readings from being taken. We also carried out
data transfer tests via RS485 without a ModBus protocol, as
we only wished to test up to the connectivity layer without
having to use protocols that make these preliminary tests
more complex.
For the analog signal sampling tests, a Rigol DG1022
signal generator and a Tektronix TDS2001C Oscilloscope
were placed at the input, in order to have all the information
of the signal injected into the test board (Figs 6 and Fig. 7).
Furthermore, the PC software was asked to show the signal
that it detected on the corresponding channel in real time,
and this data was collected via a USB port. Fig. 8. Image of system output during the test at 100Hz