Real-Time FPGA-Based Systems To Remote Monitoring
Real-Time FPGA-Based Systems To Remote Monitoring
4,500
Open access books available
118,000
International authors and editors
130M Downloads
154
Countries delivered to
TOP 1%
most cited scientists
12.2%
Contributors from top 500 universities
Abstract
1. Introduction
1
Real-Time Systems
Figure 1.
Real-time processing system hardware in the loop.
2
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
Figure 2.
Embedded system architecture. In addition to hardware, a SoC includes classic application software- and
hardware-dependent software that must be co-designed with hardware interfaces. The API hides hardware
details such as interrupt controllers or memory and I/O systems [4].
In both cases, access to information at any time depends on the control and
measurement tasks used [5].
Commercial DAQ cards are differentiated by their viabilities such as sampling
frequency, scale of acquired signal, power, and requirements but are generally high in
cost, and they need a PC at the collection site. Embedded systems to data acquisition
often require the participation of the embedded operating system. The modern on-
board FPGA can not only overcome the deficiency of the microcontroller unit (MCU)
or the digital signal processor (DSP) and meet the requirements of system for real-time
and synchronization but also for embedded applications using SoC FPGA platforms
with the high level coordination, versatility, and full-stacked operative system [6].
3
Real-Time Systems
Figure 3.
Bluetooth frequency bands and RF channels. Each RF channel is ordered in channel number n as follows:
f = 2402 + n MHz, where n = 0, …, 78 (BR/EDR) and f = 2402 + n*2 MHz, with n = 0, …, 39 (LE).
2. Low Energy (LE) mode, where only 40 RF channels with 2 MHz spacing are
available and adaptive frequency hopping (AFH) is used (Figure 3) [7, 8].
Since its appearance, Bluetooth protocol has continuously evolved, so there are
several versions that are differentiated with a number. Bluetooth versions 1.0–3.0
are known as Bluetooth Classic category and originally supported a maximum
data rate of 721 kbps. This is referred to as Basic Rate (BR). The Bluetooth 2.0
EDR specification added support for data rates up to 2.1 Mbps. This is referred
to as Enhanced Data Rate (EDR). The Bluetooth 3.0 High Speed (HS) specifica-
tion enhanced it even further to 24 Mbps. Bluetooth Low Energy (BLE) is a new
category that include versions 4.0 and 5.0. Geared toward applications requiring
low power consumption, BLE returns to a lower data throughput of 1 Mbps using
the GFSK modulation scheme. The Bluetooth 4.0 specification did not add any
additional data rates; it only reduced the current consumption to enable low-energy
devices. In Bluetooth 5.0, in addition to low power consumption, four different data
rates are offered to accommodate a variety of transmission ranges: 2 Mbps, 1 Mbps,
500 kbps, and 125 kbps. The lower data rate of 125 kbps was added to compensate
for the increase in transmission range [9].
Bluetooth module generally consists of four components: radio transceiver,
baseband/link controller, link manager, and a host controller interface (HCI) [8].
HCI is the interface to access the Bluetooth module setup from the host. Bluetooth
communication is based on the following two network topologies:
4
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
Figure 4.
Bluetooth network topologies. (a) Piconet. (b) Scatternet.
to extend the number of Bluetooth devices that can communicate with each
other. They allow more than seven devices to communicate with each other [10].
ZigBee, also known as IEEE 802.15.4, was initially conceived in 1998, standardized
in 2003, and finally revised in 2006; it is a low power standard for short-range com-
munications between wireless devices. ZigBee is classified as a wireless personal area
network (WPAN). ZigBee devices operate in one of three bands: 868 MHz (Europe),
915 MHz (North America), and 2.4 GHz (worldwide). The 2.4 GHz band is the
most used by the ZigBee transceivers and uses offset quadrature phase-shift keying
(OQPSK) modulation stream. This type of modulation, which is a derivation of tra-
ditional QPSK, is used for requiring less transmission power and achieving the same
or better performance than similar ones. OQPSK modulation combined with the use
of a 5 MHz channel bandwidth allows devices to reach a data rate of up to 250 kbits/s
efficiently [11]. The IEEE 802.15.4 has three different operation modes (Figure 5):
2. Local Coordinator (ZigBee Router, ZR): This device must be associated with a
ZC or with another ZR previously associated with a network, because it does
not create its own network. ZR is a full-functional device (FFD) that imple-
ments the full protocol stack. This device participates in multi-hop routing
of message in mesh and cluster-tree networks (in the latter case they are also
called cluster heads (CHs)). ZR provides synchronization services through
beacon transmission.
3. End device (ZigBee end device, ZED): It is a device that does not implement
the previous functionalities and should associate with a ZC or ZR before
interacting with the network. In ZigBee, it is just a sensor/actuator node; it can
be a reduced function device (RFD) that implements a reduced subset of the
protocol stack [12].
5
Real-Time Systems
Figure 5.
ZigBee network topologies. (a) Star topology contains a unique node that operates as ZC, which establishes the
PAN identifier. The identifier should not be used by any other ZigBee network in the vicinity. Also in the star
topology, the communication is centralized, so each device (FFD or RFD) joining the network and willing to
communicate with other devices must send its data to the ZC, which sends it to the adequate destination. (b)
Mesh topology includes a ZC that identifies the entire network. Communication in this topology is decentralized,
so each node can communicate directly with any other node within its radio. (c) In cluster tree topology, there is
a single routing path between any pair of nodes, and there is a distributed synchronization mechanism (IEEE
802.15.4 beacon-enabled mode). There is only one ZC that identifies the entire network and one ZR per cluster.
Any of the FFDs can act as a ZR that provides synchronization services to other devices and ZRs [13].
Wi-Fi is the name given by the Wi-Fi Alliance [15] to the IEEE 802.11 suite
of standards. 802.11 defined the initial standard for wireless local area networks
(WLANs).
The evolution of Wi-Fi technology has focused on increasing speed, lower
latency, and better user experiences in a multitude of environments and with a vari-
ety of device types. Wi-Fi Alliance has introduced generational names to devices and
product descriptions. The latest generation of Wi-Fi devices, based on the 802.11ax
standard, is known as Wi-Fi devices 6. If the device contains 802.11 ac, 5 GHz
technology is known as Wi-Fi 5, or if the device uses technology 802.11n, 2.4 GHz
is known as Wi-Fi 4 [16]. Generations of Wi-Fi prior to Wi-Fi 4 will not be assigned
names. Most of devices available in the market today are identified as Wi-Fi 5.
6
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
Figure 6.
BSS controlled by a single coordination function (CF). The CF determines when a STA transmits and when it
receives.
1. Ad hoc mode: Wireless stations communicate directly with one another, with a
peer-to-peer network model. A BSS operating in ad hoc mode is isolated, that
is, there is no connection to other Wi-Fi or wired LAN networks. The utility of
this network is in situations that demand a quick setup in places where there is
no network infrastructure.
2. Infrastructure mode: This mode requires the BSS to contain a wireless access
point (AP). An AP is an STA with additional functionality that allows extend-
ing access to wired networks for clients of a wireless network. Any wireless
device that tries to join the BSS must first be associated with the AP. A distri-
bution system (DS) is generated when an AP provides access to its associated
STAs. The DS can allow communication between APs as shown in Figure 7.
Figure 7.
All wireless communication to or from an associated STA goes through an AP. This type of setup is similar to the
“star topology” used in wired networks.
7
Real-Time Systems
The IEEE 802.11 standard does not define any specific implementations. Instead,
nine services are specified that all implementations must provide; these are:
Authentication – The STA must identify itself to the AP before it can access
network services.
De-authentication - This service voids an existing authentication.
Privacy - An STA must be able to encrypt the frame to protect the message
content to be transmitted, so that only the recipient can read it.
MAC service data unit (MSDU) delivery - An MSDU is a data frame that must be
transmitted to the proper destination.
3. Hardware description
The elements used for the realization of the proposed system are shown in
Figure 8. The platform is composed of four components: the FPGA board that
includes A/D converter and three wireless interface Bluetooth, XBee (ZigBee
protocol-based), and Wi-Fi module. The wireless modules provide the FPGA device
the capacity to communicate with other system or the Internet.
Figure 8.
Hardware components used for the real-time monitoring system.
8
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
Figure 9.
(a) Block diagram LTC2308 device. Eight analog input and operation modes can be programmed by a 6-bit
DIN word through SDI terminal. (b) Timing with a long pulse. The configuration signals are S/D can be
single-ended/differential-bit; O/S can be odd/sing-bit; S1 and S0 addressing select bit; UNI can be unipolar/
bipolar and SLP active sleep mode [19].
The A/D converter chip used is the integrated circuit (IC) LTC2308, Linear
Technology, whose characteristics are low noise and power consumption, up to 500
Kbps, 8-channel, 12-bit, and SPI/MICROWIRE compatible serial interface. The
internal conversion clock allows the external serial output data clock (SCK) to oper-
ate at any frequency up to 40 MHz [18]. Figure 9 shows the block diagram of ADC.
The Digi XBee series modules implement the IEEE 802.15.4 radio and ZigBee
networking protocol for its physical layer and MAC. Outdoor transmission distances
to 0–90 meters depending on power output and environmental characteristics.
XBee devices work in ISM 2.4 GHz frequency bands having a serial interface data
9
Real-Time Systems
Figure 10.
Cyclone V SoC device block diagram is composed of two distinct portions: A dual-core ARM cortex-A9 hard
processor system (HPS) and an FPGA. The cortex-A9 processor has two 32-bit CPUs and associated subsystems
on the Intel Cyclone V SoC chip, where hardware circuits can be implemented, which reduce the size of the
board and increase the performance of the developed system [20].
rate from 1200 bps to 250Kbps. The following are the supported network topolo-
gies: point-to-point, point-to-multipoint, and peer-to-peer.
This module implements TCP/IP and full 802.11 b/g/n (support 2.4 GHz, up to
72.2 Mbps) WLAN MAC protocol. It can perform either as a stand-alone applica-
tion or as the slave to a host MCU, so it supports Basic Service Set (BSS) STA and
SoftAP operations under the distributed control function (DCF). ESP8266 includes
a CPU Tensilica L106 32-bit processor, and it has peripheral interfaces: UART, SDIO,
SPI, I2C, I2S, and IR. Power management is handled with minimum host interaction
to minimize active duty period. ESP8266EX can be applied to any microcontroller
design as a Wi-Fi adaptor through SPI/SDIO or UART interfaces [22].
4. System architectures
10
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
Figure 11.
Block diagram of architectures implemented on FPGA. This module comprises five blocks: ADC controller,
FIFO memory, Wi-fi, UART drivers, and a finite state machine (FSM).
width, it is strongly recommended that the operations have the same bit width as
the measured variable. Finally, the system output must be congruent with the bus
width wireless interface.
A dual-clock First-In First-Out (FIFO) buffer was used to cross data between the
two different clock domains: sampling frequency A/D converter (from 1 to 25 MHz)
and transmission rate (from 9600 to 921,600 bps), Figure 13. In the systems’ clock
frequency domain, the serialized outputs are continuously stored in 12 bits shift
11
Real-Time Systems
Figure 12.
SPI controller architecture. (a) 12 bits a/D conversion general architecture. (b) ADC_Core architecture. (c)
ADC_Nano architecture generates signal control to ADC. The 4-bit counter counts 16 cycles in high for the
acquisition of the signal and 16 cycles in low for the sending of the 12 output bits parallel to the configuration
instruction for the next sample. The control ADC architecture is based on shift register.
register, before they will be sent to FIFO buffer. The finite state machine (FSM)
FIFO, in the system controller, wait until collected data of the last active channel
will be sent through wireless module, before starting a new acquisition.
12
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
Figure 13.
Dual-clock FIFO architecture. Two counters are used to addressing the data to read and write operations. RAM
of 12-bit and 16 words is used to store data.
The following source code corresponds to the FIFO_LOGIC and RAM entities of
the design.
Code 1. FIFO_LOGIC.vhd [24].
13
Real-Time Systems
Code 2. RAM_16.vhd.
Serial communications depend on the two UART devices (the FPGA architecture
and the wireless module) to be configured with compatible settings: baud rate,
parity, control (start and stop bits), and data bits (Figure 14).
In this system, a general port input/output (GPIO) is used to send serial data.
Subsystem architecture (Figure 15) is used to set the baud rate in the output. UART
interface will read out the data when it is filled in the FIFO and send to the host
Figure 14.
UART data packet has data format structure: Data bits, parity, and stop bits. In the graph, the data 0x9B
(decimal number “155,” ASCII character “ø”) is transmitted through the wireless module with format: 8-N-1 [25].
14
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
Figure 15.
UART driver diagram. Serial transmission uses baud rate module (DIVISOR_8333). MAQUINAFSM together
with MUXSALIDA sends data from FIFO to serial data in the transmission format. The parity is verified with
PARIDAD.
through the wireless link (Bluetooth or XBee modules), and finally the data can be
displayed in the host with software application.
Code 3. DIVISOR_8333.vhd.
15
Real-Time Systems
Code 4. MUX_SALIDA.vhd.
Code 5. MAQUINA_FSM.vhd.
16
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
Code 6. PARIDAD.vhd.
17
Real-Time Systems
ESP8266 Wi-Fi module is used to transmit the sensor data wirelessly to the
Wi-Fi modem at the other end with Internet connection. ESP8266 can be initial-
ized using a set of AT commands. Initialization process includes (a) verifying the
communication between ESP8266 module and FPGA architecture (RST command)
and (b) searching for a Wi-Fi network within its range and connecting to it, with
the required credentials (CWJAP command). Sending process includes (a) setting
the Wi-Fi module as a TCP/IP client (CIPSTART command); (b) transmitting data
involves communication with cloud server using IP address (CIPSEND command).
Address IP of the server is required to access the data from personal computing
devices such laptop, tablet, and smartphone. Figure 16 shows the AT command
sequence and a block of Wi-Fi architecture:
Figure 16.
AT command sequence. (a) Flow diagram of WEB connection [27]. (b) Block WI-FI driver module. (c) Code
for AT command definition inside FPGA; green letters are comments about hexadecimal data.
18
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
An analog signal is generated by the function generator to test the system, and
the final data sent to the PC or WEB page is observed. Figures 17, 18 and 19 show
the corresponding practical wave and storage wave.
The GUI (Figure 18) was made using Java Eclipse Oxygen [29] and serial commu-
nication libraries (jSerialComm). jSerialComm is a Java library designed to provide a
platform-independent way to access standard serial ports without requiring external
Figure 17.
Measurements of real signal sent to the host and WEB page. The signal has an offset = 3.98Vdc and 8.06Vpp
and frequency of 60 Hz with harmonics of 3rd, 5th, 7th, and 9th. This signal is obtained from digital
oscilloscope.
Figure 18.
Data received from the remote DAQ system (Bluetooth or XBee module) using GUI development. Each cycle is
represented by 133 samples (sampling frequency = 8 kHz). The UART baud rate is 115,200 bps.
19
Real-Time Systems
Figure 19.
Data sent to WEB page through Wi-fi module. The WEB page was made on a XAMPP package that includes
apache WEB server, MySQL, and PHP [31].
libraries, native code, or any other tools. It is meant as an alternative to Rx-Tx and
the (deprecated) Java Communications API, with increased ease of use, an enhanced
support for timeouts, and the ability to open multiple ports simultaneously [30].
6. Conclusions
20
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
Author details
© 2019 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms
of the Creative Commons Attribution License (http://creativecommons.org/licenses/
by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,
provided the original work is properly cited.
21
Real-Time Systems
References
[1] Siewert S, Pratt J, editors. Real-time [9] Symmetry Electronics, Bluetooth 1.0
embedded components and system with vs 2.0,vs 3.0 vs 4.0 vs 5.0—How They
linux and RTOS. Mercury Learning and Compare. Available from: https://www.
Information LLC; 2016. 483 p. ISBN: semiconductorstore.com/blog/2018/
978-1942270041 Bluetooth-1-0-vs-2-0-vs-3-0-vs-4-0-
vs-5-0-How-They-Differ-Symmetry-
[2] Mohit A editor. Embedded system Blog/3147
design: Introduction to SoC system
architecture. Learning Bytes Publishing; [10] Gupta NK, editor. Inside Bluetooth
2016. 214 p. ISBN: 978-0997297201 Low Energy. Artech House; 2016. 458 p.
ISBN: 978-1630810894
[3] Rajsuman R editor. System-on-a-
Chip: Design and Test. Artech House; [11] National Instruments. The Basic of
2000. 294 p. ISBN: 978-1580531078 ZigBee Transmitter Testing. Available
from: www.ni.com
[4] Jerraya AA, Mint WW. Hardware/
software interface codesign for [12] Jaiswal L, Kaur J, Singh G.
embedded systems. Computer, IEEE. Performance analysis of backoff
2005;38:63-69 exponent behaviour at MAC layer in
ZigBee sensor networks. International
[5] Kirianaki N, Yurish S, Shpak N, Journal of Computer Applications.
Deynega V. Data Acquisition and Signal 2012;57(22)
Processing for Smart Sensors. John
Wiley & Sons Ltd; 2002. 291 p. ISBN: [13] Cunha A, Koubâa A, Severino R,
0-470843179 Alves M. Open-ZB: An open-
source implementation of the IEEE
[6] Velásquez-AguilarJG,Aquino-RobleroF, 802.15.4/ZigBee protocol stack on
Limón-MendozaM,Cisneros-VillalobosL, TinyOS. Available from: https://
Zamudio-Lara A. Multi-channel www.cister.isep.ipp.pt/docs/
data acquisition and wireless open_zb__an_open_source_
communication FPGA-based system, implementation_of_the_ieee_802_15_4_
to real-time remote monitoring. zigbee_protocol_stack_on_tinyos/381/
In: 2017 International Conference view.pdf
on Mechatronics, Electronics and
Automotive Engineering (ICMEAE); [14] Tennina S et al. editors. IEEE
21-24 November 2017; Cuernavaca, 802.15.4 and ZigBee as enabling
México. IEEE; 2017. pp. 181-186 Technologies for Low-Power Wireless
Systems with Quality-of-Service
[7] Collotta M, Pau G, Salerno VM, Constraints. Springer; 2013. 173 p. DOI:
Scatá G, editors. Wireless Sensor 10.1007/978-3-642-37368-8
Networks to Improve Road Monitoring.
IntechOpen; 2012. pp. 323-346. DOI: [15] Available from: https://www.wi-fi.org
10.5772/48505.ch15
[16] Wi-Fi Alliance. Generational
[8] National Instruments. Introduction Wi-Fi User Guide. Available
to Bluetooth Device Testing: From from: https://www.wi-fi.org/file/
Theory to Transmitter and Receiver generational-wi-fi-user-guide
Measurements. Available from: http://
download.ni.com/evaluation/rf/ [17] Rabbit Web site. An
intro_to_bluetooth_test.pdf Introduction to Wi-Fi. Available
22
Real-Time FPGA-Based Systems to Remote Monitoring
DOI: http://dx.doi.org/10.5772/intechopen.89629
23