satellite-dishReal-Time Vibration Monitoring with ThingsBoard and Calculated Fields

device profileThis guide shows how to build a complete end-to-end industrial vibration monitoring system from a real Balluff condition monitoring sensor, through a virtual PLC, to a live ThingsBoard dashboard with ISO 10816-compliant alarms.

Unlike the previous articlearrow-up-right, which used simulated telemetry from Node-RED, this guide uses real vibration data from a physical sensor connected via IO-Link and streamed live to ThingsBoard using OPC UA and MQTT.

By the end of this guide, you will have:

  • Real X/Y/Z vibration RMS data streaming from a Balluff condition monitoring sensor

  • A reComputer vPLC reading sensor data via Modbus TCP/IP over IO-Link

  • A reComputer R1100 bridging data from the vPLC (OPC UA) to ThingsBoard's MQTT Broker using Node-RED

  • ThingsBoard Calculated Fields compute ISO 10816 vibration severity and machine health status in real time

  • A professional dashboard with a colour-coded gauge, alarms, and a dynamic machine health card


Hardware & Software Used

Hardware

Component
Model

Edge Computer (vPLC host)

Seeed reComputer R2100 (OpenPLC Runtime)

Edge Gateway and ThingsBoard Host

Seeed reComputer R1100

IO-Link Master

Balluff BNI00L3

Condition Monitoring Sensor

Balluff BCM R15E-001-DI00-01,5-S4

Software

  • OpenPLC vPLC Runtime (on reComputer R2100)

  • Node-RED (on reComputer R1100)

  • ThingsBoard Community Edition (on reComputer R1100)


System Architecture

Before diving into the steps, it's helpful to understand how data flows through the system.

circle-info

๐Ÿ’ก Why two edge devices? The vPLC (reComputer R2100 running OpenPLC) is dedicated to real-time scan-cycle control and sensor I/O. A separate computer, R1100, handles the edge communication. This separation keeps the PLC runtime clean and follows industrial best practices for separating control logic from data forwarding.


This step is covered in detail in the Virtual PLC interfacing with IO-Link Masterarrow-up-right article.

In summary, the vPLC:

  1. Connects to the Balluff IO-Link Master over Modbus TCP/IP

  2. Reads X/Y/Z VRMS and Temperature from registers IW1โ€“IW8

  3. Uses a custom C++ WTOR function block to byte-swap Big-Endian 32-bit floats into usable REAL values

  4. Stores the results in rX_VRMS, rY_VRMS, rZ_VRMS, and rTemp

circle-info

Key point: The Balluff sensor sends each float split across 2 ร— 16-bit Modbus registers in Big-Endian format. A direct cast to REAL gives garbage values โ€” the byte swap is mandatory. The WTOR function block handles this automatically.

Once the vPLC is running and reading correct values, proceed to Step 2.


Step 2: Expose vPLC Data via OPC UA

The vPLC exposes its runtime variables as an OPC UA Server. This allows the reComputer R1100 to read live values without changing the PLC program.

circle-info

OpenPLC Runtime includes a built-in OPC UA server. No additional configuration is required; variables declared in the PLC program are automatically available as OPC UA nodes.

Note the OPC UA server address of the vPLC; you will need this in the next step:

Replace 192.168.100.10 with the actual IP address of your vPLC.


Step 3: Bridge OPC UA to MQTT using Node-RED

The reComputer R1100 runs Node-RED as the middleware layer. It acts as an OPC UA client that reads vibration values from the vPLC and publishes them to ThingsBoard's MQTT broker every second.

1

Install the OPC UA node in Node-RED

Open the Node-RED palette manager and install:

2

Build the flow

The flow consists of three parts:

chevron-rightTrigger (every 1 second)hashtag

Use an Inject node set to repeat every 1 second.

chevron-rightOPC UA Readhashtag

Add an OPC UA Client node and configure it:

  • Endpoint: opc.tcp://192.168.100.10:4840

  • Action: READ

  • Node IDs to read:

    • ns=4;i=1

    • ns=4;i=2

    • ns=4;i=3

    • ns=4;i=4

    • ns=4;i=5

    • ns=4;i=6

    • ns=4;i=7

circle-info

The exact node ID format depends on your OpenPLC version. Use the OPC UA browser (built into the OpcUa-Client node) to confirm the correct node paths for your setup.

3

Create a Device Profile in ThingsBoard

circle-info

Device profiles in ThingsBoard allow an administrator to define and centrally manage common settings for multiple devices. This greatly simplifies the management of a large number of similar devices, making it especially valuable in IoT solutions where numerous devices share identical configurations and behaviors.

Learn more about the device profile herearrow-up-right

Go to Profiles โ†’ Device Profiles in the left menu โ†’ click + โ†’ Create new device profile

4

Create a new device

Create a new device and link that to the device profile created above. In our case, the new device is named 'OpenPLC', linked to the device profile 'Vibration Sensor'.

Step 1: Go to Entities โ†’ Devices

Step 2: Click on OpenPLC (your device) to open its details

Step 3: Click the pencil/edit icon (โœ๏ธ) in the top right of the details panel

Step 4: Find the "Device profile" field โ€” currently shows default

Step 5: Click on it and select "Vibration Sensor" from the dropdown

Step 6: Click Save / Apply changes

5

Format and publish the PLC data to the MQTT Broker

Add a Function node in the Node-RED to format the payload:

Add an MQTT Out node with the ThingsBoard connection details as shown below.

Setting
Value

Broker

192.168.0.227 (IP of reComputer R1100)

Port

1883

Topic

v1/devices/me/telemetry

Username

Your ThingsBoard device username. Check thisarrow-up-right step to learn how to get the username.

Password

(leave blank)

6

Verify data is arriving in ThingsBoard

Go to your ThingsBoard device โ†’ Latest Telemetry tab. You should see the four keys updating every second:


Step 4: Create Calculated Fields in ThingsBoard

This is where the raw sensor data becomes actionable. ThingsBoard v4.0 introduced Calculated Fields, a built-in logic layer that transforms incoming telemetry in real time without any external scripts or rule chains.

We will create two calculated fields:

  1. Overall Vibration Severity: combines X/Y/Z into a single ISO 10816 metric

  2. Machine Status: classifies the severity into a human-readable health state

circle-info

Best Practice Note: Instead of attaching a calculated field to a specific device (e.g., IoT1), it is recommended to attach it to a Device Profile. This way, the calculated field automatically applies to all devices sharing that profile, making your setup scalable and maintainable without duplicating configuration.


1

Create the calculated fields

Go to Profiles โ†’ Device Profiles โ†’ Open your device profile ('Vibration Sensor')

Navigate to the Calculated Fields tab inside the profile. Click + and create a calculated field

2

Calculated Field 1: Overall Vibration Severity (ISO 10816)

Navigate to your Left tree menuโ†’ Calculated Fields tab โ†’ click +.

General settings:

Setting
Value

Title

Overall Vibration Severity (ISO 10816 compliant)

Type

Script

Add three arguments:

Argument name
Type
Key

plc_rSensorX_vrms

Latest telemetry

plc_rSensorX_vrms

plc_rSensorY_vrms

Latest telemetry

plc_rSensorY_vrms

plc_rSensorZ_vrms

Latest telemetry

plc_rSensorZ_vrms

Add this Script:

Output: Time series

circle-info

Why vector magnitude? Using sqrt(Xยฒ + Yยฒ + Zยฒ) rather than the maximum individual axis, it gives you the true Euclidean magnitude of the vibration vector. This is the correct approach for ISO 10816 compliance and eliminates false negatives, a situation where all three axes are below threshold individually, but combined vibration is dangerously high.

3

Calculated Field 2: Machine Status

Navigate to Calculated Fields โ†’ click + again.

General settings:

Setting
Value

Title

Machine Status

Type

Script

Arguments:

Argument name
Type
Key
Default value

vibration_severity

Latest telemetry

vibration_severity

0

โš ๏ธ Setting a default value of 0 is important. Without it, if vibration_severity has not yet been computed, the argument receives null, the comparison fails, and the status incorrectly shows CRITICAL.

Add this Script:

ISO 10816-3 zone reference:

Zone
Severity range
Status
Meaning

A

0 โ€“ 2.3 mm/s

HEALTHY

Good - new or recently serviced

B

2.3 โ€“ 4.5 mm/s

WARNING

Acceptable - monitor closely

C

4.5 โ€“ 7.1 mm/s

CRITICAL

Unsatisfactory - schedule maintenance

D

> 7.1 mm/s

EMERGENCY

Unacceptable - risk of damage


Step 5: Configure Alarms

Navigate to your Device Profile โ†’ Alarm Rules tab.

Create three alarm rules based on vibration_severity:


Alarm 1: Motor Vibration Warning

Setting
Value

Condition

return (vibration_severity > 2.3)

Additional info:

circle-exclamation

Alarm 2: Motor Vibration Critical

Setting
Value

Condition

return (vibration_severity > 4.5)

Additional info:

triangle-exclamation

Alarm 3: Motor Vibration Emergency

Setting
Value

Condition

return (vibration_severity > 7.1

Additional info:

triangle-exclamation
circle-check

Step 6: Build the Dashboard

1

Machine Health card (HTML Value Card)

Add widget โ†’ Cards โ†’ HTML Value Card

Type: Entity

Data key: machine_status

Navigate to 'Appearance'. Paste the following into the HTML section:

Replace the CSS section with:

2

Widget 1: Warning Card

  1. Click + Add widget โ†’ Cards โ†’ Alarm count

  2. Configure:

Setting
Value

Label

Warnings

Alarm severity filter

Warning

Alarm status filter

Active

Icon

Warning triangle, Size 20px

Icon color

White

Icon background

#2E7D6B (dark teal, as shown)

3

Widget 2: Critical Alarms Card

Same steps as above but:

Setting
Value

Label

Critical Alarms

Alarm severity filter

Critical

Icon background

#C62828 (dark red)

4

Widget 3: Motor Image

  • Click + Add widget โ†’ Traditional SCADA Fluid systemโ†’ Right motor pump

Setting
Value

Running

True

Warning State

Use alarm status: Warning Alarm Type: Motor Vibration

Critical State

Use alarm status: Critical and Major Alarm Type: Motor Vibration

5

Vibration Severity Gauge (ISO 10816 bands)

Add widget โ†’ Gauges โ†’ Speed Gauge

Type: Entity

Antity Alias: OpenPLC

Data key: vibration_severity

Configure the colour bands to match ISO 10816 zones in the Scale settings:

From
To
Colour

0

2.3

#4CAF50 (green)

2.3

4.5

#FFEB3B (yellow)

4.5

7.1

#FF9800 (orange)

7.1

10.0

#F44336 (red)

Additional settings:

Setting
Value

Min

0

Max

10

Decimals

1

Units

mm/s

Title

Vibration Severity (ISO 10816)

6

Tri-Axial Vibration Chart

Add widget โ†’ Charts โ†’ Time series chart

Data keys: plc_rSensorX_vrms, plc_rSensorY_vrms, plc_rSensorZ_vrms

7

Motor Temperature Trend

Similarly, you can also make a trend of Motor Temperature

8

Vibration Severity Trend Chart

Add widget โ†’ Charts โ†’ Time series chart

Data key: vibration_severity

Add threshold lines at 2.3, 4.5, and 7.1 mm/s so operators can immediately see how close the severity is to each ISO zone boundary.

9

Add Alarm Table

Add widget โ†’ Tablesโ†’ Alarms table

Setting
Value

Time window

Use widget time window

Alarm source

Entity Alias > MachineData

Alarm Status list

Active Cleared Acknowledged Unacknowledged

Alarm Severity list

Critical Major Warning

Alarm type list

Motor Vibration

10

Final dashboard layout

Arrange the widgets as follows for the clearest operator view:

circle-check

How It All Connects

Looking back at the full pipeline:

  1. The Balluff BCM sensor measures tri-axial vibration (X/Y/Z RMS) and temperature continuously

  2. The Balluff IO-Link Master exposes sensor data over Modbus TCP

  3. The reComputer vPLC reads registers every scan cycle, byte-swaps Big-Endian floats, and exposes clean REAL values via its OPC UA server

  4. Node-RED on the reComputer R1100 polls the OPC UA server every second and publishes a JSON payload to ThingsBoard via MQTT

  5. ThingsBoard Calculated Fields compute vibration severity (sqrt(Xยฒ+Yยฒ+Zยฒ)) and classify machine health (HEALTHY / WARNING / CRITICAL / EMERGENCY) in real time, no external scripts needed

  6. Alarm rules fire when severity crosses ISO 10816 zone boundaries, with structured alarm messages including rounded axis values

  7. The dashboard gives operators instant visual feedback through a colour-coded health card, ISO-banded gauge, and trend charts


Resources

ThingsBoard Dashboard

circle-info

To learn how to import a dashboard, kindly refer to the last article here ThingsBoard (Edge Setup)

โ™ฅ๏ธ Work With Me

I regularly test industrial automation and IIoT devices. If youโ€™d like me to review your product or showcase it in my courses and YouTube channel:

๐Ÿ“ง Email: [email protected] or drop me a message on LinkedInarrow-up-right

Last updated