Using MQTT Protocol for Smarter Automation

In my previous blog post, “Edge Gateways to Support Real-Time Condition Monitoring Data,” I talked about the importance of using an edge gateway to gather the IoT data from sensors in parallel with a PLC. This was because of the large data load and the need to avoid interfering with the existing machine communications. In this post, I want to delve deeper into the topic and explain the process of implementing an edge gateway.

Using the existing Ethernet infrastructure

One way to collect IoT data with an edge gateway is by using the existing Ethernet infrastructure. With most devices already communicating on an industrial Ethernet protocol, an edge gateway can gather the data on the same physical Ethernet port but at a separate software-defined number associated to a network protocol communication.

Message Queue Telemetry Transport (MQTT)

One of the most commonly used IoT protocols is Message Queue Telemetry Transport (MQTT). It is an ISO standard and has a dedicated software Ethernet port of 1883 and 8883 for secure encrypted communications. One reason for its popularity is that it is designed to be lightweight and efficient. Lightweight means that the protocol requires a minimum coding and it uses low-bandwidth connections.

Brokers and clients

The MQTT protocol defines two entities: a broker and client. The edge gateway typically serves as a message broker that receives client messages and routes them to the appropriate destination clients. A client is any device that runs an MQTT library and connects to an MQTT broker.

MQTT works on a publisher and subscriber model. Smart IoT devices are set up to be publishers, where they publish different condition data as topics to an edge gateway. Other clients, such as PC and data centers, can be set up as subscribers. The edge gateway, serving as a broker receives all the published data and forwards it only to the subscribers interested in that topic.

One client can publish many different topics as well as be a subscriber to other topics. There can also be many clients subscribing to the same topic, making the architecture flexible and scalable.

The edge gateway serving as the broker makes it possible for devices to communicate with each other if the device supports the MQTT protocol. MQTT can connect a wide range of devices, from sensors to actuators on machines to mobile devices and cloud servers. While MQTT isn’t the only way to gather data, it offers a simple and reliable way for customers to start gathering that data with their existing Ethernet infrastructures.

Edge Gateways To Support Real-Time Condition Monitoring Data

In my previous blog post from early summer, I talked about IO-Link sensors with condition monitoring features that work with PLCs. I covered how condition monitoring variables can be set up as alarms and how simple logic can be set up inside the sensor so it only sets off those alarms to the PLC in real time to alert operators when something is wrong. Many companies, however, take advantage of the IoT sensor data with the long-term goal of analyzing the environmental data conditions to predict maintenance needs in real-time versus relying on a schedule. Some even want to connect directly to their MES systems to inform maintenance personnel of daily maintenance orders, which requires a separate device, such as an IoT edge gateway.

Edge gateway benefits

The biggest benefit of an IoT edge gateway is the ability to process and store large amounts of data quickly, enabling real-time applications to use that data efficiently.

An IoT edge gateway typically sits at the end or edge of your network and gathers all the sensor data either directly from the sensors or from the PLC. Since there will be a large amount of data from all the sensors on the network, part of the edge gateway setup is to filter the relevant and important information and process this vast amount of data. The edge gateway must also handle the amount of data required reliably, and it must have low latency. These important factors are often associated with the gateway’s CPU and memory specifications.

After looking at the performance of the edge gateway, comes the ‘gateway’ aspect which provides a translation to different communications networks, whether local or cloud-based. There are the hardware specs of the gateway, whether it’s using serial, USB or Ethernet for that connection, as well as the environmental ratings on the gateway. Then, more importantly, is the software side of the edge gateway. There are cloud-based communications standards designed for different applications and for either private or public cloud networks.

Edge gateways support different communications protocols, such as HTTPS, MQTT, RESTful API, C/Python API. The gateway portion also helps in the conversion of those protocols and the ease of interoperability to different platforms, such as AWS, Azure, Ignition, and Wonderware. This provides data transparency so that all the data gathered can be used across the many different software platforms.

To get to the IoT end goal, an edge gateway is necessary and it’s important to choose the correct one.

Control Meets IIoT, Providing Insights into a New World

In manufacturing and automation control, the programmable logic controller (PLC) is an essential tool. And since the PLC is integrated into the machine already, it’s understandable that you might see the PLC as all that you need to do anything in automation on the manufacturing floor.

Condition monitoring in machine automation

For example, process or condition monitoring is emerging as an important automation feature that can help ensure that machines are running smoothly. This can be done by monitoring motor or mechanical vibration, temperature or pressure. You can also add functionality for a machine or line configuration or setup by adding sensors to verify fixture locations for machine configuration at changeovers.

One way to do this is to wire these sensors to the PLC and modify its code and use it as an all-in-one device. After all, it’s on the machine already. But there’s a definite downside to using a PLC this way. Its processing power is limited, and there are limits to the number of additional processes and functions it can run. Why risk possible complications that could impact the reliability of your control systems? There are alternatives.

External monitoring and support processes

Consider using more flexible platforms, such as an edge gateway, Linux, and IO-Link. These external sources open a whole new world of alternatives that provide better reliability and more options for today and the future. It also makes it easier to access and integrate condition monitoring and configuration data into enterprise IT/OT (information technology/operational technology) systems, which PLCs are not well suited to interface with, if they can be integrated at all.

Here are some practical examples of this type of augmented or add-on/retrofit functionality:

      • Motor or pump vibration condition monitoring
      • Support-process related pressure, vibration and temperature monitoring
      • Monitoring of product or process flow
      • Portable battery based/cloud condition monitoring
      • Mold and Die cloud-based cycle/usage monitoring
      • Product changeover, operator guidance system
      • Automatic inventory monitoring warehouse system

Using external systems for these additional functions means you can readily take advantage of the ever-widening availability of more powerful computing systems and the simple connectivity and networking of smart sensors and transducers. Augmenting and improving your control systems with external monitoring and support processes is one of the notable benefits of employing Industrial Internet of Things (IIoT) and Industry 4.0 tools.

The ease of with which you can integrate these systems into IT/OT systems, even including cloud-based access, can dramatically change what is now available for process information-gathering and monitoring and augment processes without touching or effecting the rudimentary control system of new or existing machines or lines. In many cases, external systems can even be added at lower price points than PLC modification, which means they can be more easily justified for their ROI and functionality.