As mentioned previously, our goal in this section of the ebook isn’t to go into detail about specific sensor/device types. However, nearly every IoT system needs some way to connect its sensors/devices to the cloud so that data can be sent back-and-forth between them. So in this chapter we’ll be exploring a particular type of IoT hardware called the gateway, which makes that connection to the cloud possible.
Gateways act as bridges between sensors/devices and the cloud. Many sensors/devices will “talk” to a gateway and the gateway will then take all that information and “talk” to the cloud.
But you may be wondering, what benefit is there to taking that extra step between the sensors/devices and the cloud? There are several benefits:
As you may be noticing, battery life tends to be a critical consideration for many IoT systems. For example, take an IoT solution that operates in a remote area. To get data from sensors/devices to the cloud, there will need to be a long-range connection, usually provided by satellite. As will be explained in greater depth in the connectivity section, longer range typically means increased power consumption (and costs); this can be a problem for small sensors/devices with limited battery life.
If you’re doing Smart Agriculture, you want your field sensors to last years, not months or weeks. By using an elevated gateway installed near the top of an outbuilding or grain silo, the sensors/devices only have to send data a relatively short distance to the gateway and the gateway can then send the data to the cloud through a single higher bandwidth connection like satellite.
Gateways allow sensors/devices to communicate over shorter distances, boosting battery life.
A complete IoT application might involve many different kinds of sensors and devices. Using Smart Agriculture again, you might want sensors for temperature, moisture, and sunlight and devices such as automated irrigation and fertilizer systems.
All of the different sensors and devices can use varying transmission protocols (basically, the rules and format for the information being transmitted). Protocols include LPWAN, Wi-Fi, Bluetooth, and Zigbee, among many others.
Gateways can communicate with sensors/devices over varying protocols and then translate that data into a standard protocol such as MQTT to be sent to the cloud.
Sometimes, sensors/devices can generate so much data that it’s overwhelming to the system or extremely costly to transmit and store. Often in such cases, only a small fraction of the data is actually valuable. For example, a security camera doesn’t need to send video data of an empty hallway.
Gateways can pre-process and filter the data being generated by sensors/devices to decrease transmission, processing, and storage requirements. There are also techniques that can be employed on the sensor processor itself (if there is enough processing power) to limit the amount of unfiltered data sent to the gateway or directly across the network.
Time can be critical for certain IoT applications; the sensors/devices can’t afford to transmit data to the cloud and wait to get a response before taking action. This is true for life-or-death situations in the medical realm or for fast-moving objects like cars.
Higher latency can be avoided by processing the data on the gateway or on the sensor itself and giving commands locally. However, many sensors/devices in IoT applications are too small and too power constrained to do the processing themselves.
Gateways can reduce latency in time-critical applications by performing processing on the gateway itself rather than in the cloud.
Every sensor/device that is connected to the internet becomes vulnerable to being hacked. Hacked sensors/devices are bad. Not just for the owner, but for everyone else too.
Gateways reduce the number of sensors/devices connected to the internet because the sensors/devices are only connected to the gateway. However, this makes gateways themselves targets and also the first line of defense. This is why security needs to be a priority for any gateway.
Not all IoT applications will need a gateway, but they’re an important class of hardware that’s often a requirement for certain use cases because they’re needed to provide the connectivity to the sensors/devices.
In the next section we’ll explore connectivity as a whole for IoT as well as specific connectivity and network standards that you may need to consider.