Overview of Architectures with Arduino Boards As Building Blocks for Data
Total Page:16
File Type:pdf, Size:1020Kb
PAPER OVERVIEW OF ARCHITECTURES WITH ARDUINO BOARDS AS BUILDING BLOCKS FOR DATA ACQUISITION AND CONTROL… Overview of Architectures with Arduino Boards as Building Blocks for Data Acquisition and Control Systems http://dx.doi.org/10.3991/ijoe.v12i07.5818 V.M. Cvjetkovic and M. Matijevic University of Kragujevac, Kragujevac, Serbia Abstract—Standard SBCs (Single Board Computer) with Some or all of these functionalities can be present in- number of standard shields and sensors can be used as cluding also some specific not mentioned here. Mentioned building blocks for rapid development of network of intelli- functionalities are quite general and do not pose limita- gent devices with sensing, control and Internet access. Ar- tions by themselves, as the real limits of IoT devices are duino family of boards having high popularity and large mainly determined by processing power, speed, available number of sold units featuring open access, reliability, ro- memory, power consumption and similar characteristics. bustness, standard connections and low prices, possesses If the task for some IoT device is too demanding, the large potential for implementation of autonomous remote possibility of logically redefining the task so that more measurement and control systems of various levels of com- than one IoT device could be used and combined to fulfill plexity. As Arduino boards can function independently, they the given task, should be considered. That further suggests are complete small computer platforms that can perform the use of a number of inexpensive IoT devices with small various tasks requiring some kind of interaction with the computing power in a network of devices possessing a outer world. Arduino boards can be used and programmed significant net effect not possible with a single IoT device. in various ways, and can be arranged in various combina- tions forming some typical implementation architectures Regardless of used architecture, including a single de- that this paper discusses. Starting from basic and simple vice or many devices, each device should operate reliably configurations, more advanced are gradually considered and in predictable way. from the aspects of chosen way of programming and com- Following chapters are organized in this way: bining with other boards. Special attention is devoted to Chapter 2 Overview of Arduino family, with currently NodeJS as programming platform for Arduino boards and available Arduino general purpose boards grouped accord- considerations of libraries used with Arduino boards like ing to processors on board. Johnny-Five, Galileo-io firmata equivalent, mraa library Chapter 3 Overview of programming modes and con- and other ways of program access to GPIO like Linux Sysfs. nections with Arduino boards, enabling various acquisi- As typical representatives of Arduino boards’ family, the tion and control configurations. Arduino Uno, Arduino Due and Arduino Galileo were se- lected, with justification that all other not mentioned boards Chapter 4 Overview of architectures with Arduino are somewhere between those selected, according to official boards hardware specifications. Chapter 5 Conclusion References and Authors Index Terms—Arduino, configurations, Johnny-Five, NodeJS II. OVERVIEW OF ARDUINO FAMILY Arduino family of boards was selected among others I. INTRODUCTION for its popularity resulting in a large number of users and a Appearance and development of various SBCs like Ar- number of boards to choose from. Besides boards that are duino [1, 2], BeagleBone [3], RaspberryPi [4], RIoT- more like general purpose computer devices, there are also board [5], PandaBoard [6], OLiMEX [7] and others to- boards called “shields” that extend functionalities of gether with mobile phones, created enormous potential for boards for purposes like Ethernet, WiFi and GSM com- building various devices capable of interaction with envi- munication, use of SD cards, motor and relays control, ronment, data processing and network communication. space orientation and other. Such devices are nowadays also seen and classified as Arduino boards are based on Atmel microcontroller being part of IoT (Internet of Things). Required function- units (MCU). On some more powerful devices there is an alities of IoT devices are usually: additional microprocessor based computer providing • M2M (Machine to Machine) communication greater processing power and network communication. Arduino boards [8] Uno, Nano, Mini 05, Mega 2560, • Some kind of data acquisition using adequate sensors Leonardo, Micro, Robot, Esplora are based on Atmel • Local processing of acquired data MCUs with AVR architecture. • Control of some local system • ATmega328 – Uno Nano and Mini 05 • Upload of acquired and processed data to some cloud • ATmega2560 – Mega 2560 network storage • ATmega32u4 – Leonardo, Micro, Robot, Esplora 10 http://www.i-joe.org PAPER OVERVIEW OF ARCHITECTURES WITH ARDUINO BOARDS AS BUILDING BLOCKS FOR DATA ACQUISITION AND CONTROL… Some of the boards have variants with added function- possess general purpose inputs and outputs (GPIO). Pres- alities: ence of GPIO is the main difference from usual computer • Arduino Ethernet (ATmega328) based on Uno, systems for everyday use – desktop, laptop, tablets and Ethernet enabled, Micro SD card smart phones. GPIO has two main types of input / output system, analog and digital. All Arduino boards have ana- • Mega ADK (Accessory Development Kit) (AT- log inputs (AI) for voltage measurement. Number of ana- mega2560) for use with Android phones log input pins and resolution varies for different boards. • Leonardo ETH (ATmega32u4) based on Leonardo, Analog output (AO) can be implemented with digital Ethernet enabled, Micro SD card outputs as PWM (Pulse Width Modulation) or with ADC All previously mentioned Arduino devices have AVR (Analog Digital Converter) circuit. Digital pins can be MCU operating at 16MHz frequency. used both as input and output (DIO). Arduino boards support USB communication with external computer Arduino Due is different, as it is based on Atmel running Arduino IDE (Integrated Development Environ- SAM3X8E MCU with 32-bit ARM Cortex-M3 CPU ment) for programming in language resembling C. Other (Central Processing Unit) core running on 84MHz. Also, supported communications types are UART (Universal Due has significantly larger memory – SRAM (Static Asynchronous Receiver Transmitter) TTL (Transistor RAM) for program and flash memory for uploaded code. Transistor Logic), I2C (Internal IC) / TWI (Two Wire Arduino M0 and M0 Pro are advanced versions of Uno Interface) and SPI (Serial Peripheral Interface). SPI is based on SAMD21 MCU, with 32-bit ARM Cortex M0 mainly used for connecting boards with various shields as core running at 48MHz. it provides very fast communication. UART is hardware Arduino boards Industrial 101, Tian, Yun, Yun Mini, implemented for USB on digital lines 0 and 1, but it can are MCU based, but also have additional MIPS processor be also quite easily software implemented with provided [9] based computer supporting Linino [10] Linux distribu- SoftwareSerial library using digital I/O. Serial communi- tion based on OpenWRT [11]. Additional Linux computer cation is convenient for data exchange between boards. provides extra processing power for support of MCU TWI can also be used for communication between boards acquisition and control tasks. or other devices with provided Wire library and using Boards Intel Galileo and Intel Galileo Gen 2 are based SDA (Serial DAta) and SCL (Serial CLock) lines. on Intel Quark SoC X10000, a 32-bit Intel Pentium pro- Besides GPIO, very important programming aspect is cessor-class system on a chip (SoC). That processor runs available memory which is limited as it is part of MCU, both the Linux and Arduino acquisition code. Intel Galileo and organized as flash memory for code, SRAM (Static boards are pin to pin and software compatible with other RAM) for program execution and EEPROM (Electrically Arduino boards. Erasable Programmable Read-Only Memory) as perma- Finally, the Intel Edison board is based on two proces- nent storage for data. Some boards like Yun, Galileo, sors, the Intel Atom 500MHz dual-core, dual-threaded Arduino Ethernet and shields like Ethernet, also provide CPU and an Intel Quark 100MHz MCU. program access to SD memory cards. Dynamic character- istics of boards like maximum rate of measurements de- From this brief overview of current Arduino boards, it pend on many factors, with MCU operating frequency as can be seen that there are two kinds of boards: one of the important but rough indicators. Rates for digital • With MCU as single processor capable of running IO operations are higher than for analog measurements Arduino code, called sketch which use analog digital converter (ADC) circuit that in • Boards with added processor for running Linux general requires many processor cycles for conversion. which provides additional processing power and sup- Features of selected boards are compared in Table 1. ports acquisition and control tasks of MCU • Intel Galileo and Intel Galileo Gen 2 boards as a spe- TABLE I. cial case of boards running Linux where Intel proces- FEATURES OF SELECTED BOARDS sor executes both Arduino sketch and Linux Board Arduino Uno board is a typical representative of MCU Uno Due Galileo only based boards, as an effort was made for other boards features to be pin to pin and software compatible. AI 6, 10 bits 12, 12 bits 6, 12 bits Arduino Due is a top representative of high perfor- AO 6, PWM, 8