OPC UA in simple terms
OPC UA provides secure, platform-independent access to industrial data and information models. Clients can browse a server, read and write permitted values, subscribe to changes and call supported methods.
Its value is not only protocol transport. It can represent equipment hierarchy, data types, engineering units and relationships.
MQTT in simple terms
MQTT is a lightweight publish-subscribe protocol. Publishers send messages to topics on a broker, and subscribers receive the topics for which they are authorized.
The broker decouples producers from consumers, making MQTT effective for event distribution, intermittent connections and scalable information flows.
Core comparison
| Feature | OPC UA | MQTT |
|---|---|---|
| Communication pattern | Client-server and PubSub options | Publish-subscribe through broker |
| Data model | Rich typed address space | Payload defined by application |
| Discovery | Browse server objects | Topic convention and registry |
| Typical use | Machine and system integration | Telemetry and event distribution |
| Security | Certificates users encryption | Broker TLS authentication ACLs |
| Control suitability | Possible with strict engineering | Generally information layer not deterministic control |
Combined architecture
The edge gateway can browse structured OPC UA data, apply context and publish selected values or events to MQTT topics. This avoids exposing every PLC tag to every enterprise application.
Namespace and topic design
OPC UA namespaces should remain stable and meaningful. MQTT topics should represent organization, site, area, equipment and message type without embedding uncontrolled business logic.
Example topic structure: enterprise/site/area/asset/telemetry. Payloads should include timestamp, quality, unit and schema version when required.
Security design
OPC UA deployments need certificate trust, endpoint policy, user roles and controlled write access. MQTT deployments need TLS, broker authentication, topic-level authorization and secure credential storage.
Never use anonymous write access in a production architecture. Certificate renewal and broker backup must be part of lifecycle planning.
Quality and timestamps
Industrial data must communicate whether a value is good, uncertain or bad and when it was produced. Gateway designs should not replace source timestamps with receipt time without a clear reason.
Systems must define behavior during communication loss, including buffering, stale-data indication and resynchronization.
Sparkplug and standardized payloads
MQTT by itself does not define an industrial data model. Frameworks such as Sparkplug can add topic, state and payload conventions where supported by the selected products.
Standardization can improve interoperability, but teams must still manage versions, device identity and mapping to plant models.
When to use which
Use OPC UA when applications need structured browsing, typed data, methods and close industrial integration. Use MQTT when several consumers need selected events or telemetry through a broker, especially across network boundaries.
Use both when an edge layer must obtain rich machine context and distribute governed information at scale.
Common mistakes
Publishing every PLC tag, using inconsistent topics, omitting quality, allowing uncontrolled writes, ignoring certificate lifecycle and treating MQTT as deterministic control are common design errors.
A proof of concept should test failure and recovery—not only normal data transfer.
Training exercise
A practical lab can expose PLC values through an OPC UA server, read them in an edge application, publish selected data to an MQTT broker, subscribe with a second client and store messages in SQL.
The exercise should include communication interruption, certificate rejection, stale data and broker restart.
Frequently Asked Questions
Is MQTT better than OPC UA?
No. They have different strengths and are often complementary.
Can MQTT control a PLC?
It can carry commands in some architectures, but it should not be assumed suitable for deterministic or safety-critical control.
Does OPC UA require a Windows PC?
No. OPC UA is platform-independent and is available in controllers, gateways, servers and embedded devices.
What is an MQTT broker?
It receives published messages and distributes them to authorized subscribers based on topics.
Why are timestamps important?
They distinguish when a value was produced from when it was received and support correct sequence and analysis.
What is retained data in MQTT?
A broker may store the last retained message for a topic so new subscribers receive an immediate current value.
Can OPC UA data be sent to cloud platforms?
Yes, commonly through gateways, PubSub or applications that transform approved data.
What should beginners learn first?
Learn PLC tags, networking and client-server concepts, then build one secure OPC UA and MQTT integration lab.
Build practical automation skills
Learn PLC, HMI, SCADA, VFD, industrial networking, OPC UA, SQL reporting, SCL and Python through live practical training with Softwell Automation.
Enquire Now