Building Blocks of an IoT Thing
Neil Carter
Managing Director of Award Winning - Electronic Design & Software Development Consultancy With a Heart
These days, everyone is talking about the ‘Internet of Things’ and ‘connected devices’ . Smart cities Industry 4.0, connected home, connected car and the connected workers have indeed ushered in an era where things can communicate. Karl Steinbuch, a german computer science pioneer said: ‘In a few decades time, computers will be interwoven into almost every industrial product.’ Most would agree that his vision is already a reality, but we still have a high potential for further development.
Its also interesting to reflect that IoT is an industry where traditionaly the research has been proven to be correct, for example look at the roadmap created by SRI Consulting Business Intelligence under reflection of the 2008 Report on Global Trends 2025 (elaborated by the U.S. National Intelligence Council). I think most would agree its been pretty much spot on.
So as everyone is either starting to embrace the IoT with their product development, or expand its scope I thought it might be useful to consider some of the lessons I have learnt arround the building blocks I have used in developing IoT products
.What the IoT is made up of
The IoT can be designed at different scales for different uses. It can start from our homes with simple lighting or appliance control, and expand into the realm of factories and industries with automated machines, smart security systems and central management systems often referred to and Industry 4.0. It has scaled up to entire cities with smart parking, smart metering, waste management, fire control, traffic management. However, irrespective of the scale of application, the main IoT backbone remains similar.
The IoT architecture is multi-layered with delicate components intricately connected to each other. It starts with sensors, which are the source of data being collected. Sensors pass data onto an edge or gateway device, which converts data into readable digital values and stores these temporarily. When the edge senses a suitable wireless network or the Internet, it pushes the locally stored data to a cloud server. The data is processed, analysed, stored and forwarded to the end-user device, and context provided by application software. The main design fundamentals and challenges of building an IoT product offering revolve around these layers.
Designing the perfect system
Successfully setting up a complete IoT chain comes with challenges that are best considered at the onset rather than trying to address retrospectively. Designers need to consider all business requirements like prolonged battery life and low power consumption, secured network gateways, ruggedised hardware and more. Electromagnetic compliance (EMC) and resistance to electromagnetic interference (EMI) are also essential. Introducing new devices that can be proved not to interfere with, or be interfered by existing system is one of the most demanding skills for an IoT design.
Components like the microcontroller unit (MCU), sensors and wireless network are built and handled with special care for an optimal system design. Based on the scale of application, the design is bound to alter. While basics remain the same, minute detailing into engineering improves a system build by leaps and bounds.
Pick the right MCU
An MCU is the central nervous system of the IoT setup. Data collected by sensor nodes is processed by the MCU using software programs, enabling the system to respond accordingly. The MCU for an IoT system is chosen based on application-specific requirements. However there is a wide range of vendors, and even within vendors a wide range of choice
A popular IoT MCU - The ESP32
For basic applications with limited amount of data to be transmitted every day, an 8-bit MCU will suffice. On the other hand, large-scale connected systems require 32-bit controllers. As 32-bits MCUs have a bigger RAM size and larger flash that can hold a complete network stack and application codes, these are optimal for embedded systems that will apply radio-frequency (RF) program stacks or complex algorithms.
MCUs with floating-point units (FPUs) have further compatibility for some applications and ease the computation process. An FPU-supported controller enables precision up to long decimal values. This gives a lot of flexibility in data calculation and eliminates the requirement of overflow-checks in the program.
MCUs with FPUs can be of great advantage in applications like location tracking, processing of measurement data from accelerometers and gyrometers, or any application where data precision is quite important. You also have to consider what you are going to be connected to and if there is a library for that connection. ESP chips have good support for Azure, but less so ARM chips for example.
Talking to the rest of the world
How would you want your devices to interact? At the moment, major wireless options include Wi-Fi, Bluetooth Low Energy (BLE), Cellular, LoRa and Zigbee. Designers need to pay attention to some essential criteria for choosing a connectivity module. Some of these factors include data throughput, connectivity range and speed required, power requirement, scalability, robustness and upgraded protocol. Designers must choose a technology that is and will continue to be available and will do the job in the place where you want to deploy your devices. No good building a GPRS device for the USA only to find AT&T no longer support it.
A Popular Cellular building block - the A9G
Building an effective point to point connectivity model depends on two components: transceiver of the module (which essentially consists of a receiver, a transmitter and an antenna) and network frequency. The receiver of a transceiver sets the threshold for the signal to be received and also ensures that the signal is distinguishable from the other signals in the same frequency and the ambient noise. Making sure you are using a high-quality receiver is imperative. Lower data rate improves sensitivity of the receiver. But don’t forget that the quality of your receiver is irrelevant unless your antenna is good enough.
The transmitter, on the other hand, controls the output power of the transceiver—how much it can amplify. Experts suggest a 6dB gain capacity can double the amplitude of the output signal. While higher transmitter power means higher output signal, there is a trade-off in battery life. Hence this decision should depend completely on the type of application, the data to be amplified and the geographic location.
You also have to work out the right frequency to use as this determines the range and data-throughput capacity. For IoT applications, sub-1.0GHz and 2.4GHz are the most used frequency ranges. Unlike the large data flow during media streaming or voice/video calls, IoT applications are associated with small data packets.
Now, many developers opt for 2.4GHz frequency range owing to its popularity in mainstream applications. This frequency range does provide higher data throughput capacity but not without challenges. First, the 2.4GHz array has a lower range of coverage and poor penetration through obstacles. More importantly, this frequency has a heavy traffic of data packets coming from other devices like microwave ovens and Wi-Fi devices. This creates the problem of signal interference.
Sub-1.0GHz range, on the other hand, offers greater coverage range and sensitivity in lieu of data volume throughput. Distributed infrastructure can greatly benefit from its long-range characteristics. Moreover, data transmission through obstacles is possible.
Since sensors of an IoT system generate small data throughout the day, sub-1.0GHz frequency is a good fit for many applications as it consumes much less power and provides connectivity for years on a battery. IoT systems in agricultural fields or oil and gas industries will share very low-volume data such as soil pH, moisture level and gas level. A sub-1.0GHz frequency can efficiently cover the complete perimeter while consuming much less power.
However different regions have different frequency bands available meaning you need different products, or multiband antennas if you want to sell in both the USA and Europe for example.
Coming to wireless standards, while 802.11ac is the most popular Wi-Fi standard in the market, a newer iteration called IEEE 802.15.4 is gaining prominence for the IoT. There is however always the chance that if you wait until the next great thing, someone will get there first.
Creating a power-efficient system
For IoT applications, designers need to focus on power requirements. Batteries used in these systems are expected to last up to 20 years without requiring much manual intervention. The uniqueness of IoT design elements is their ability to sleep when not in use.
Implementing a scheme where the transceiver wakes up only when it is supposed to transmit data, and as soon as it is done, it goes back to sleep, effectively leaving the hardware asleep for the majority of the time is the best way to conserves energy.”
IoT systems consume power in two modes: dynamic (when the hardware is active) and static (when the hardware is asleep or in standby mode). It is essential to keep these factors in check. Consumption of both the MCU and the transceiver are considered. 32-bit MCUs can transmit data faster. Therefore their dynamic consumption can be much less, enabling the chip to save more energy. FPU compatibility further enhances efficiency. Large-scale applications in businesses can greatly benefit from FPU-supported MCUs. If your device requires recharging this need sto be considered as well. If you have a hundred devices that need to be charged at the same time, a hundred plug top chargers with a hundred micro USB leads each plugged into a device may not be the correct answer.
Software for security
Security solutions are essential to ensure that no part of the system (hardware, software or network gateway level) is compromised.
There are two main elements to securing an IoT system, checking the authenticity of the devices talking to each other, and encrypting the data whilst its moving and when at rest. By hiding the data in motion with advanced encryption schemes (AES). Data cannot be breached while being transmitted through the network. Data itself should be tested in the application layer to ensure it is infection-free.” Authentication levels, including passwords and biometrics, provide secured access to all components and data.