Sensors and Gateways and Edge Devices, Oh My
Check out more of my writing on my Substack:
My last post on Edge Computing generated a few questions from people trying to understand what are all of these things and how do they go together. Let’s try to sort through these pieces and how they go together. We’ll be looking at sensors (aka nodes) and gateways through the eyes of an edge device.
For our purposes, we’ll assume that all data has to come through the Edge Device for now. I’ll give an example of that not being the case later, but your IoT architecture will dictate what role an Edge Device will actually play.
For this post, let’s use our Edge Device for store-and-forward approach. I.e. if the connection to the data center is interrupted, we’ll store the data at the edge and then transmit it when connectivity is restored. To do this, we installed an edge device in our factory. It’s in the main server room with fire suppression and backup power supply, along with monitoring and backups as well.
The first question to answer is: how do we get data from the sensors to this edge device? This is where gateways come in.
Gateway
A gateway is like a bridge between your sensors and your network. Since sensors can use all manner of wireless frequencies and topologies but your corporate network tends to be TCP/IP based, something needs to connect them together.
Let’s look at a couple of examples of how this would work. First, let’s start with something simple, a WiFi-based sensor network. Fair warning though, I’m not advocating for using WiFi for your IoT deployment unless you understand exactly what that means for the kind of environment you’re deploying your sensors in. Back to WiFi sensors; let’s say you built your sensor platform using Raspberry Pis (it’s not an unheard of practice, shall we say). Your gateway in this scenario is your WiFi Access Point. In your home, this Access Point would be your WiFi router. This allows the sensor to transmit it’s readings to your server using WiFi connection offered by your Gateway (Access Point).
Let’s look at a slightly more complicated example: you deployed sensors in your office building and those sensors use Thread protocol. It operates on its own frequencies, uses mesh networking and other bells & whistles. You need a gateway to connect your sensor to your server. The gateway will translate the data sent over Thread protocol to something your network in the office building will understand, TCP/IP, and send the data to the server. Thus, the temperature reading in that meeting room will be transmitted to your system from the sensor to the gateway — the gateway will transmit that reading to your Building Management System, which can then turn up AC to cool down the meeting room.
Lastly, let’s look at a really complicated example. You have a host of sensors monitoring a fuel pipeline spread over several hundred miles. There might be over a hundred miles between a sensor in this scenario. Also, running cable is prohibitive and you’re in the middle of the wilderness. In this scenario, one answer is to deploy a gateway that the sensors can talk to but to have the gateways be able to talk to each other. This allows one gateway to transmit its information to another gateway, using it as a relay to get to the corporate network that way. These gateways would have different radios with one being optimized to talk to the sensors and the other to transmit over long distances.
So when you’re thinking about gateways, just imagine data from a sensor being sent to your network. That’s the job a gateway is doing at the basic level. Of course there are complications and complexities, you are dealing with IoT after all, but those are details to be sorted for each project.
Sensor / Node
This is a device that’s measuring something and reporting the result to the gateway. A node can have multiple sensors attached to it and a sensor can sense multiple things. For example, a humidity sensor, usually, will have a temperature sensor in it as well.
These sensors will connect to your network in a myriad of ways. Most of them will use a gateway. Some will be able to leverage WiFi or wired connectivity and talk directly to your network. The important thing to remember, you need a way to get data from your sensors somehow. How is up to your project requirements and limitations.
Edge Devices
So we’re back to where we started now, but before we close, let’s cover a couple of things quickly.
Edge Computing can mean multiple things and it can be packaged with a gateway component to save on costs or space limitations or any number of other reasons. It can be a server farm too, such as when you’re running a lot of computational logic or need storage.
The goal of an edge device is to offload the work from the data center/cloud, provide backup capability in case of network failure, offer complex data processing closer to data acquisition and many other reasons. For some ideas on how you would leverage an Edge Device, check out my previous post.
There are many complicated scenarios and network topologies to deal with when it comes to IoT. You are trying to work around the limitations of the physical world after all. Gateways and Edge Devices are just a couple of patterns that have evolved over time to deal with these difficulties.
Given the fluidity of the industry, constantly discovering what’s working and how to do things better, you’re better of focusing on how to address your needs in a flexible and cost-effective manner. Sometimes it’s worth it to pay for all the data to be sent to the cloud and optimize later. Other times, you need to optimize at the start.