Gather and analyze sensor data on the edge

IBM Maximo Worker Insights is a cloud offering that enables companies to potentially minimize or avoid hazards and injuries by providing proactive protections with personalized risk assessment and near real-time protection. To achieve this, IBM Maximo Worker Insights puts compliance at the center of safety, making it easier to identify and eliminate hazards in the workplace.

IBM Maximo Worker Insights combines IoT data from wearables, environmental sensors, and other data with advanced analytics. It then analyzes and enriches the data with information from additional sources, like weather services. First, sensor data is sent to IBM Maximo Worker Insights for near real-time analysis. Then, insights gained from IBM Maximo Worker Insights is sent back to the employees to protect them.

To provide the advanced analytics, IBM Maximo Worker Insights supports two similar but essentially different deployment models that developers can use separately or in combination. First, it supports a mobile pattern, which exclusively relies on mobile phones to collect, process, and transmit sensor data. Second, it supports an edge pattern, which replaces the mobile phones whenever a phone cannot be used.

Setting up a connected workplace with Maximo Worker Insights

A common use case is a manufacturing site, such as a car manufacturer, where workers are equipped with sensors – a smart watch and safety shoes with built-in sensors. The smartwatch measures their heart rate, stress level, and blood oxygen. The safety shoes have built-in acceleration sensors which can be used to indicate if a worker is upright or lying on the ground. Additionally, the workplace, or manufacturing floor, is supplied with beacons. The beacons are positioned in strategic locations – close to dangerous machines or in areas where higher attention is required. With beacons, it’s possible to determine if someone is close to an object or in a certain area.

With these two sets of IoT devices in place, we can now consider two different architecture patterns for Maximo Worker Insights:

  • Mobile architecture pattern
  • Edge architecture pattern

In the mobile architecture pattern, workers carry a mobile phone that runs the Maximo Worker Insights mobile app, which connects to the sensors and beacons via Bluetooth. The metrics from the sensors and beacons are analyzed and evaluated according to rules customized for a worker’s needs. If a set of criteria are met, the app creates a notification for this incident, called a hazard in IBM Maximo Worker Insights. The hazard is sent to the Maximo Worker Insights instance in IBM Cloud.

In the edge architecture pattern, workers cannot carry a mobile phone and so mobile phones are replaced by edge gateways. The sensors connect via Bluetooth to these edge gateways. Sensors can also use wired connections or use other wireless technologies like wifi, LoRa, or 4G/5G if the gateway’s hardware supports it. Multiple workers’ sensors are connected to these edge gateways. When a hazard occurs, the edge gateways can flash a light and provide a visual indicator that a possible hazard occurred close to the gateway. Because most sites would require multiple edge gateways, Maximo Worker Insights works with IBM Edge Application Manager to manage them.

Technical overview of the mobile architecture pattern

The following architecture diagram shows one worker (Toolmaker Peter), one supervisor (Foreman Sakura), and one safety officer (Ranjan) and how they use Maximo Worker Insights on their mobile phone or their desktop and how it connects to Maximo Worker Insights in the IBM Cloud.

Architecture diagram of the mobile architecture pattern

The worker’s mobile phone is running Maximo Worker Insights which is collecting the sensor data. The worker can see the metrics from the smart watch and any other wearables.

Screen shot of the Maximo Worker Insights mobile app

The worker can also view their hazards and confirm them or reject false positive hazards.

Screen shot of the Maximo Worker Insights mobile app

The supervisor’s mobile phone is also running Maximo Worker Insights, but it focuses on the hazards that are being reported for all of the workers that she is responsible for.

Screen shot of the Maximo Worker Insights mobile app

The safety officer works with the Safety Officer Dashboard, a browser-based component of Maximo Worker Insights. The safety officer uses the dashboard to identify areas of concern, areas for improvement, or to recognize patterns in the types of hazards that are happening.

Screen shot of the Maximo Worker Insights mobile app

Technical overview of the edge architecture pattern

The following architecture diagram once again shows one worker (Toolmaker Peter), one supervisor (Foreman Sakura), and one safety officer (Ranjan). The supervisor still uses Maximo Worker Insights on the mobile phone and the safety officer still uses their analytics dashboard on their desktop. However, in this edge architecture pattern, the sensor data from the workers is now gathered by the edge gateway.

Architecture diagram of the edge architecture pattern

With the addition of this edge gateway, the IBM Edge Application Manager solution is added to Maximo Worker Insights to deliver on the hardware and software requirements for most edge computing architectures. These requirements include a small footprint, offline capabilities, workload distribution, and security and integrity, just to name a few.

Let’s look at the architecture of the edge gateway (and the IBM Cloud) to see how IBM Edge Application Manager fits in to the edge solution. IBM Maximo Worker Insights provides its edge analytics software as Docker containers, which are stored in the IBM Container Registry in IBM Cloud, and the Worker Insights Edge Container runs on the edge gateway. IBM Edge Application Manager runs in IBM Cloud but it controls and configures the Edge Application Manager Agent that is running on the edge gateway.

Architecture diagram of the edge architecture pattern

Let’s zoom in even closer. The figure below reveals the information and data flows among the cloud components (IBM Maximo Worker Insights and IBM Edge Application Manager) and the Edge Gateway. The yellow arrows indicate that the operation is related to IBM Edge Application Manager, container provisioning, and maintenance in general. The red arrows indicate that the operation is related to IBM Maximo Worker Insights and actual payload, like sensor data, hazards, and shields. A shield is a set of rules that is used to determine if the conditions are met to trigger an hazard.

Architecture diagram of the edge architecture pattern

IBM Maximo Worker Insights uses continuous delivery, integration and testing practices to deliver new features and improvements in a timely manner. This also applies to the Worker Insights Edge Container. When the pipeline builds the Docker Image for Worker Insights Edge, the image is uploaded to a dedicated IBM Container Registry instance used exclusively by IBM Maximo Worker Insights.

Service Definitions are configuration files in JSON format. A service definition provides information to IBM Edge Application Manager and ultimately to the Docker runtime engine. The service definition contains properties, configuration settings, and dependencies that the service requires. The service definition also identifies which hardware architecture is supported. Following lines are an excerpt of a service definition.

Sample service definition

{
    "org": "IBM-MaximoWorkerInsight",
    "label": "Worker Insights Edge Container",
    "url": "com.ibm.iot.workerinsights.edge",
    "version": "2.0.1",
    "arch": "arm64",
    "requiredServices": [{
        "url": "com.ibm.iot.core-iot",
        "version": "[0.0.0,INFINITY)"
    }],
    "deployment": {
        "services": {
            "iot-gateway-client": {
                "image": "us.icr.io/mwi/edge-arm64:5bf41d7fe1701c6c3e003b6e94bb270eb9e82db00a7391cfb838e528315beb93"
            }
        }
    }
}

From the sample service definition, three lines are of particular note:

  • url – This is the property which uniquely identifies the service.
  • requiredServices – This property defines dependencies of the service to other services. In this case, the Maximo Worker Insights Edge Container has a dependency on any version of the IBM Watson IoT Platform Core service.
  • image – This property tells IBM Edge Application Manager which Docker image to use when this service is instantiated.

Deploying the Worker Insights Edge Container

After IBM Edge Application Manager has the service definition for the Worker Insights Edge Container, the IBM Edge Application Manager Agent automatically completes the deployment of the Worker Insights Edge Container.

Right after the installation of the agent, along with a configuration file provided by IBM Maximo Worker Insights, the agent authenticates itself against IBM Edge Application Manager and starts synchronization and integrity checks with IBM Edge Application Manager on cloud. Then the agent downloads Docker images from the cloud.

As shown in the previous figure, three containers are running in Docker on the Edge Gateway. We already know the first container, the Worker Insights Edge Container. The other two images for the MQTT Broker Edge Container and the Edge Connector Container were downloaded by the IBM Edge Application Manager agent, because of the requiredServices property from the service definition excerpt. The service com.ibm.iot.core-iot consists of two images. When the images are downloaded, they are executed on Docker automatically. The agent also checks on a regular basis if newer versions of the images are available and, if applicable, starts the newer containers, then terminates the old containers.

Now the Edge Gateway is ready for use.

Sending sensor data to Worker Insights

To analyze the data and identify hazards in the Worker Insights Edge Container, first the data needs to be provided to the container. To better understand how the data is provided, let’s look at the other edge gateway containers and components in more detail:

  • MQTT Broker Edge Container – As the name indicates, this container runs an MQTT Broker. MQTT is a lightweight, message-oriented protocol built on top of the publish-subscribe pattern. The MQTT broker acts as a post office. MQTT clients connect to the broker and publish messages on topics. These topics are like postal addresses. Other clients subscribe to these topics. Whenever a client publishes a message to a topic, all clients that subscribed to that topic receive a copy of the message. Because of the characteristics of the MQTT broker, this edge container can also be used as a service bus on a small scale.

  • Edge Connector Container – The Edge Connector is a component that links the MQTT Broker Edge Container, the local host system, and IBM Maximo Worker Insights on IBM Cloud together. Depending on the topic of the MQTT message, the Edge Connector Container routes the message to the local MQTT Broker Edge Container or to the IBM Cloud. Additionally, the Edge Connector Container is able to persist and buffer messages in case the cloud is not accessible when the message is sent.

  • Sensor Data Adapter – This adapter is not an actual component that comes with IBM Maximo Worker Insights or IBM Edge Application Manager. It is a placeholder in the figure for a custom application that is capable of reading data from the sensors, translating it into the expected MQTT message format, and sending it to the Edge Connector Container. Therefore, the sensor data adapter is an MQTT client as well. To continue with our example of wearable sensors, the Sensor Data Adapter must connect to the smartwatch and the safety shoes via Bluetooth. When the adapter receives data from the sensors, the value needs to be embedded in an MQTT message and then forwarded to the Edge Connector Container using a specific MQTT topic.

  • Worker Insights Edge Container – This container runs the IBM Maximo Worker Insights analytics engine. The shields that are used to detect hazards are automatically downloaded from the cloud. The shields that are used on a particular Edge Gateway are configurable on the cloud. The Worker Insights Edge Container is also an MQTT client. The Worker Insights Edge Container subscribes to and publishes MQTT messages on topics for the MQTT Broker Edge Container.

Now that roles of the individual components have been explained, let’s have a look on a short example which highlights the flow of data and sending of a hazard.

The Sensor Data Adapter receives new data from the acceleration sensor in the safety shoes. The adapter embeds the data in an MQTT message, then sends it to the Edge Connector. The Edge Connector determines on the basis of the used MQTT topic if the message should be forwarded to IBM Maximo Worker Insights on cloud or the MQTT Broker. In this case, the used MQTT topic belongs to a set of MQTT topics with those the Edge Connector knows that they are locally used. Therefore, the message is forwarded from the Edge Connector to the local MQTT Broker.

As mentioned previously, the Worker Insights Edge Container also subscribes to the local MQTT Broker. As soon as the MQTT Broker receives the message, it forwards a copy of it to the Worker Insights Edge Container. Now, Worker Insights’ analytics engine evaluates the data and sender of the message in one of its shields.

Let’s assume the data causes a hazard. The hazard is formatted as an MQTT message and is sent to the MQTT Broker on a specific topic. The Edge Connector receives a copy of the message because it subscribes to this topic on the MQTT broker. Because of the topic used for the hazard message, the Edge Connector decides that this message needs to be sent to IBM Maximo Worker Insights on cloud.

Summary and next steps

With the two very powerful patterns – mobile and edge – IBM Maximo Worker Insights is suitable for almost every field of application where compliance is key and workers must be protected. Pairing IBM Maximo Worker Insights with IBM Edge Application Manager you can deliver on the hardware and software requirements for most edge computing architectures.

Compared to the mobile pattern, the edge pattern has a few additional advantages:

  • One edge gateway can serve multiple workers
  • Thanks to IBM Edge Application Manager, no technician is needed on site or needs to connect remotely to the gateway.
  • Computations and analysis that exceed the resources of a mobile phone can be done on the edge gateway.
  • Due to the containerization and the design of the software, IBM Maximo Worker Insights can run on ARM and AMD platforms, and it supports major Linux distributions, which in return provides a maximum of freedom to choose suitable hardware for a particular environment.

To get more details on the capabilities of IBM Maximo Worker Insights, check out the Knowledge Center. For more information on IBM Edge Application Manager, explore the edge computing content on IBM Developer.