- Published on
SPARKPLUG B vs OPC UA: Comparison of Communication Protocols Part II
- Authors
- Name
- Martin Szerment
Introduction
In industrial automation and the Internet of Things (IIoT), communication protocols play a crucial role in ensuring efficient data exchange between various systems and devices. Two popular protocols in this field are OPC UA and Sparkplug B. This article provides a detailed comparison of these two protocols, their architectures, data formats, and applications.
OPC UA (OPC Unified Architecture)
OPC UA is a communication protocol developed by the OPC Foundation, aimed at standardizing the exchange of data and information between different industrial automation systems. It was introduced in 2008 as a successor to the OPC Classic protocols.

Key Features of OPC UA:
- Standardized Data Exchange
- Data Transmission Formats
- Client/Server Architecture
- Protocols Used
- Security
- Gateway Compatibility
- Extensive Documentation
Architecture of OPC UA: OPC UA is based on a client/server architecture and uses TCP/IP and HTTP/SOAP as foundational technologies. The OPC UA server converts hardware communication protocols so that device data is transmitted through a standard device model. The OPC UA client decides when and what data the server retrieves from the underlying systems.

Sparkplug B
Sparkplug B is a protocol based on MQTT, developed by Arlen Nipper, one of the creators of MQTT. It addresses the needs of the industry, offering a more standardized protocol than OPC UA, but with less complexity.
Key Features of Sparkplug B:
- Simple Implementation
- Quality of Service (QoS)
- Lightweight and Efficient
- Data Independence
- Session Continuity (Retention)
- Centralized Data Architecture

Comparison of OPC UA and Sparkplug B Architectures
- OPC UA: Client/Server Architecture, decentralized structure, protocols TCP/HTTP, and SOAP, security enhanced with TLS and certificates.
- Sparkplug B: Based on MQTT, centralized data architecture with an MQTT broker, simple implementation and lightweight.

Data Format: OPC UA vs Sparkplug B
- OPC UA: Prefers XML format but can also transmit data in JSON. Data includes headers with metadata, increasing complexity.
- Sparkplug B: Data format lighter and more efficient without additional metadata headers.

The main difference between the two protocols lies in the lack of centralization in OPC UA, which can be challenging when attempting to collect data.

Summary
Both protocols, OPC UA and Sparkplug B, have their unique advantages and are used in different industrial contexts. OPC UA offers a more comprehensive and secure structure, ideal for complex systems requiring high levels of security and standardization. On the other hand, Sparkplug B is lighter, simpler, and more efficient, making it an ideal choice for applications requiring low latency and ease of implementation.
← Back to the blog