The Internet of Things has had a transformative effect on our society and culture. In barely two decades, IoT system engineers have taken the common "things" in our homes and businesses and have created smart ecosystems of technologies that empower people's lives with useful outcomes such as saving energy, time, money, and lives.
The transformative reality of IoT has accelerated change so quickly that the "things" now being connected are immensely diverse, and come in a wide variety of types with unique purposes. Thus, these "things" (what will be referred to in this article as devices) are both heterogeneous and feature a range of complexities, intelligence (often called smart devices), process/control architectures, and sensing/actuating capabilities. In the process of designing IoT systems, a developer must select an appropriate design for IoT device connectivity. This article provides an overview of the important elements to consider when designing a device with Internet connectivity.
Types of Connected Devices
The wide range of connected devices now available is increasing rapidly. The most common connected device is a sensor, which makes measurements about physical stimuli and converts them into an electrical signal. For example, an IoT device may use a sensor to detect the frequency, temperature, light intensity, pressure, and humidity of the environment around it. Because the data that is collected is very raw, it needs to be aggregated and converted into digital streams for data processing.
Typically, the processing of data is carried out by data acquisition centers (DAQ). A data acquisition center is simply a collection of hardware and software to measure and control the physical characteristics of something in the real world. Typically, the data is converted from an analog waveform to a digital signal for processing. Once the data is collected, it can either be processed locally or in the cloud. How the device sensor data is collected, processed, and analyzed depends very much on the device’s connectivity, which in large part depends on the IoT architecture, data processing design, and the communication protocols selected.
Connected devices also transmit and/or receive other types of information beyond the physical parameters of the external environment. This information can include device metadata, state information, commands, and operational information. Thus, sensors aren’t the only connected device that a developer needs to account for when designing new IoT systems, given the rich diversity of devices used today. Examples of other types of connected devices include:
- In the manufacturing industry, circuit breakers, motor starters, and motor drives are the connected devices of a plant’s automation machinery. In addition, manufacturing robots are also connected devices utilized in manufacturing.
- In the automotive industry, on-board diagnostics devices in cars use wireless technology to send data on geographical location and sub-system operating status. Moreover, autonomous vehicles are connected devices that use edge and cloud computing to control a vehicle’s movements.
- In the utilities industry, smart meters wirelessly transmit energy consumption data to servers that ultimately calculate bills to residential consumers.
- In the white goods industry, home appliances use device connectivity to provide remote control of home appliances, as well as safety, security and food stocking/delivery requests.
An IoT architecture determines how devices are connected to collect, store and process data. The architecture will also determine how data is gathered and sent over to the network, to the cloud or to a gateway. The architecture will also control how devices are managed, identified, monitored, maintained, etc. Device connectivity depends on the layered architecture used in the IoT system. The architecture is made of five successive layers with each succeeding layer dependent on the preceding one. The system quality can be computed at the end of the process. Let’s briefly discuss each layer of the architecture:
Objects Layer: This is a devices layer comprised of physical devices. Physical devices include different types of sensors. Data collected in this layer are passed to the object abstraction layer.
Object Abstraction Layer: This layer provides a secure transmission channel to transfer data, which are collected from objects, to the service management layer. The technologies used for data transfer are RFID, GSM, 3G/UMTS, Wi-Fi, Bluetooth, infrared, and ZigBee, among others. Cloud computing and data management are also present in this layer.
Service Management Layer: Services are combined in this layer as per request based on address and name. The service management layer provides flexibility to the programmer to work on different types of objects independent of the platform. This layer processes data streaming from the object abstraction layer and subsequently takes decisions for delivery of required services.
Application Layer: This layer enables different kinds of services when requested by the customer. The service type requested by the customer depends on the particular use. For example, if the use-case of a smart home is considered, then the customer may ask for specific parameters like heating, ventilation, and air-conditioning (HVAC) measurements, temperature, and/or humidity values.
Business Layer: This layer manages IoT services and activities. It assists in building various components such as graphs, flowcharts, and business models based on data received from the network layer. The business layer uses Big Data analysis to support decision-making activities. The layer also provides a comparison of obtained versus expected outputs to enhance the quality of the system.
An important aspect of an IoT architecture is the manner by which device data is processed. The choice of data processing design is often determined by performance, storage needs, costs, latency, security, and privacy. Data processing can be designed in the following ways:
Cloud: When you store, manage, or process data in the cloud it is referred to as cloud computing. You can connect an IoT device to the cloud using various methods, including Wi-Fi, LAN, Low Power Wide-area Networks (LPWAN), cellular, satellite, and Ethernet. Which method for connectivity you choose depends on your needs and system’s power requirements. In cloud computing, a centralized server takes care of the complete cloud computing architecture needed for the application or device.
Fog: When cloud computing extends closer to the edge of a network it is referred to as Fog Computing. In a fog network, a substantial amount of computation, storage, and communication occurs closer to local devices as a complement to cloud computing. Fog computing also performs local data analysis like Edge computing, but also meshes in the network connection between IoT devices and the cloud. With fog computing in place, the computing power is pushed toward extreme logical ends, thereby making the devices self-sustained to a certain extent and with the ability to make smart decisions.
Edge: When the data from IoT devices is processed closer to where it was created, it is known as Edge Computing. Embedded systems-on-a-chip (SoCs) such as the Raspberry Pi, can be used with sensors (such as GPS, camera, microphone, etc.) to prototype devices that are robust enough to handle complex algorithms and run full-fledged operating systems. Whereas many early IoT applications required gathering data from "things" and sending them to the cloud, the evolving computational capacity of devices enables complex computation to be done locally, closer to the edge or boundary of the network, rather than in the cloud. Edge analysis allows you to aggregate and pre-process raw IoT data locally, allowing you to send only the data that needs further processing to physical data centers or cloud-based systems. Edge computing is the current trend in data analysis and storage. Edge computing eliminates the need for uploading data to a central hub. The analysis and processing are done locally. Edge computing eliminates the need for data streaming and is ideal for deployment of IoT devices at any location where there is poor connectivity.
Raw IoT data can be collected using edge sensors and actuators. They can be linked to edge gateways or devices directly or through low-power radio technologies. Edge devices can run fully fledged operating systems and are often powered by a battery. Edge intelligence run by edge devices can be connected to a cloud platform directly or through an edge gateway. Like edge devices, edge gateways can run full-fledged operating systems, but generally have more storage and memory, CPU power and a dedicated power supply. They can act as an intermediary between edge devices and the cloud. Edge devices and gateways pre-process raw IoT data and forward select subsets of it to services running in the cloud.
Communication protocols are an important choice when designing IoT device connectivity. IoT protocols are generally divided into the following types: infrastructure (e.g. 6LowPAN), transport (Wi-Fi, Bluetooth), and (MQTT, CoAP, XMPP, AMQP, WebSocket) protocols. The specific protocol utilizes depends on what layer of the architecture that the communication or data transfer is taking place.
Typically, an IoT system has a three-level architecture, consisting of devices, gateways, and data systems. Data is transferred between these levels in the following way: device to device, device to gateway, gateway to data systems, and finally data system to data system. Devices can communicate with each other; however, some devices may connect via a gateway. Data needs to be aggregated and transferred to the cloud server, which shares the data, sends it back to the devices, or makes it available to applications or services provided (e.g., analytics).
Beyond the IoT architecture, the selection of a communication protocol depends on the requirements of the application. Range, frequency, bandwidth, security, data rates, power usage, and costs are deciding factors in the selection of a protocol.
Device-to-Cloud Connectivity Using Amber Pi
The Amber Pi is an expansion board that can be used to develop device-to-cloud connectivity on a Raspberry Pi. It is equipped with sensor boards and an 868 MHz radio housed in a Travos III module. Manufactured by Würth Elektronik, the radio module enables Raspberry Pi to operate on a sub GHz frequency which helps with data transmission through local mesh configuration. In a mesh configuration, each node connects directly, dynamically, and non-hierarchically to as many nodes as possible to efficiently route data to and from clients.
The following figure shows the block diagram of an IoT system using and Raspberry Pi:
Node1 through Node 4 are devices mounted on the Raspberry Pi and used to collect sensor data. Node 5 acts as a gateway, which collects data from the rest of the nodes and then sends the data to the cloud via LAN or Wi-Fi connectivity. All nodes exchange data locally via 868 MHz RF. The Raspberry Pi communicates with the via UART. A user can take advantage of to create multiple creative applications. Users must install a few development tools, like the Raspberry Pi driver and the Amber Pi library to use . Code blocks must also be installed. Code blocks is a cross-platform, open source IDE which supports a number of compilers, including GCC. A driver in C-code provided by Würth Elektronik includes functions not only for integrated RF modules but also the connected sensors to enable quick and easy development of custom applications.