Skip to main content
This 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 article, 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 color-coded gauge, alarms, and a dynamic machine health card

Want to get started with ThingsBoard? Sign up here.


Hardware & Software Used

Hardware

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.
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 Master 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
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.
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

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
The flow consists of three parts:
Use an Inject node set to repeat every 1 second.
3

Create a Device Profile in ThingsBoard

Device profiles in ThingsBoard enable administrators 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 here
Go to Profiles → Device Profiles in the left menu → click + → Create new device profile
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
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’.
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Step 1: Go to Entities → DevicesStep 2: Click on OpenPLC (your device) to open its detailsStep 3: Click the pencil/edit icon () in the top right of the details panelStep 4: Find the “Device profile” field — currently shows defaultStep 5: Click on it and select “Vibration Sensor” from the dropdown
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Step 6: Click Save / Apply changes
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
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.
6

Verify data is arriving in ThingsBoard

Go to your ThingsBoard device → Latest Telemetry tab. You should see the four keys updating every second:
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields

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
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
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
2

Calculated Field 1: Overall Vibration Severity (ISO 10816)

Navigate to your Left tree menu→ Calculated Fields tab → click +.General settings:Add three arguments:
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Add this Script:
Output: Time series
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:Arguments:
Argument nameTypeKeyDefault value
vibration_severityLatest telemetryvibration_severity0
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
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:
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
ISO 10816-3 zone reference:
ZoneSeverity rangeStatusMeaning
A0 – 2.3 mm/sHEALTHYGood - new or recently serviced
B2.3 – 4.5 mm/sWARNINGAcceptable - monitor closely
C4.5 – 7.1 mm/sCRITICALUnsatisfactory - schedule maintenance
D> 7.1 mm/sEMERGENCYUnacceptable - risk of damage

Step 5: Configure Alarms

Navigate to your Device Profile → Alarm Rules tab. Create three alarm rules based on vibration_severity:
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields

Alarm 1: Motor Vibration Warning

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Additional info:
[WARNING] Motor Vibration entering Zone B (ISO 10816) Severity: ${vibration_severity} mm/s | Threshold: 2.3 mm/s Axis breakdown — X: ${plc_rSensorX_vrms} mm/s | Y: ${plc_rSensorY_vrms} mm/s | Z: ${plc_rSensorZ_vrms} mm/s Action: Monitor closely. Schedule inspection if sustained.

Alarm 2: Motor Vibration Critical

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Additional info:
[CRITICAL] Motor Vibration in Zone C — Maintenance Required (ISO 10816) Severity: ${vibration_severity} mm/s | Threshold: 4.5 mm/s Axis breakdown — X: ${plc_rSensorX_vrms} mm/s | Y: ${plc_rSensorY_vrms} mm/s | Z: ${plc_rSensorZ_vrms} mm/s Action: Reduce load and schedule immediate inspection.

Alarm 3: Motor Vibration Emergency

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Additional info:
[EMERGENCY] Motor Vibration in Zone D — Shutdown Risk (ISO 10816) Severity: ${vibration_severity_r} mm/s | Threshold: 7.1 mm/s Axis breakdown — X: ${plc_rSensorX_vrms_r} mm/s | Y: ${plc_rSensorY_vrms_r} mm/s | Z: ${plc_rSensorZ_vrms_r} mm/s Action: Stop machine immediately. Risk of mechanical damage.
Why use vibration_severity for alarms instead of individual axes?Alarming on individual X/Y/Z values creates two problems: false negatives (all axes below threshold but combined severity is dangerous) and false positives (one axis spikes from a single knock while overall severity stays in Zone A). The combined severity metric is ISO-compliant and gives a much cleaner alarm signal.

Step 6: Build the Dashboard

1

Machine Health card (HTML Value Card)

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Add widget → Cards → HTML Value CardType: EntityData key: machine_statusNavigate to ‘Appearance’. Paste the following into the HTML section:
Replace the CSS section with:
2

Widget 1: Warning Card

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
  1. Click + Add widget → Cards → Alarm count
  2. Configure:
3

Widget 2: Critical Alarms Card

Same steps as above but:
4

Widget 3: Motor Image

  • Click + Add widget → Traditional SCADA Fluid system→ Right motor pump
5

Vibration Severity Gauge (ISO 10816 bands)

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Add widget → Gauges → Speed GaugeType: EntityAntity Alias: OpenPLCData key: vibration_severityConfigure the colour bands to match ISO 10816 zones in the Scale settings:
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Additional settings:
6

Tri-Axial Vibration Chart

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Add widget → Charts → Time series chartData keys: plc_rSensorX_vrms, plc_rSensorY_vrms, plc_rSensorZ_vrms
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
7

Motor Temperature Trend

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Similarly, you can also make a trend of Motor Temperature
8

Vibration Severity Trend Chart

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Add widget → Charts → Time series chartData key: vibration_severityAdd 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.
Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
9

Add Alarm Table

Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields
Add widget → Tables→ Alarms table
10

Final dashboard layout

Arrange the widgets as follows for the clearest operator view:
Reading order:The left column gives instant health status. The centre column shows the vibration detail over time. The right column shows the temperature and the ISO-calibrated gauge. The alarms table at the bottom provides a full audit history.

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

machine_dashboard (1).json

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: rajvir@codeandcompile.com or drop me a message on LinkedIn