Communication Protocols
Basically rules of communication.
1. Embedded System Communication Protocols
Used within a robot, mostly for sensor-actuator-microcontroller communication. These are typically wired, low-latency, and real-time.
UART / USART
- Type: Point-to-point, asynchronous
- Use: Serial sensors (e.g., GPS), debug consoles
- Pros: Simple, full-duplex
- Cons: Needs same baud rate, limited distance
I²C (Inter‑Integrated Circuit)
- Type: Multi-slave, two-wire
- Use: Connecting IMUs, temperature sensors
- Pros: Multiple devices on one bus
- Cons: Lower speed, short range
SPI (Serial Peripheral Interface)
- Type: Master-slave, four-wire
- Use: Flash memory, IMUs, ADCs
- Pros: High speed, full-duplex
- Cons: More wires, extra chip-select lines
CAN (Controller Area Network)
- Type: Multi-master bus
- Use: Motor controllers, drive systems
- Pros: Robust, error-checking, priority arbitration
- Cons: Limited speed (~1 Mbps)
RS‑485
- Type: Differential, multi-drop
- Use: Long-range communication
- Pros: Good noise immunity, multiple devices
- Cons: Half-duplex, requires direction control
EtherCAT
- Type: Industrial Ethernet Fieldbus
- Use: Real-time control of actuators
- Pros: Ultra-low latency, jitter control
- Cons: Expensive, complex
Cyphal (UAVCAN v2)
- Type: Real-time pub/sub over CAN or UDP
- Use: Distributed robotic systems
- Pros: Deterministic, open standard
- Cons: Less mainstream adoption
2. IoT / Network Communication Protocols
Used to communicate between robots, to cloud systems, or to user interfaces. These work over Wi-Fi, Ethernet, or Cellular.
MQTT (Message Queuing Telemetry Transport)
- Type: Lightweight publish-subscribe
- Use: Cloud telemetry, IoT dashboards
- Pros: Low overhead, works well on low bandwidth
- Cons: Not real-time
DDS (Data Distribution Service)
- Type: Real-time pub-sub middleware
- Use: ROS 2, multi-agent communication
- Pros: Real-time, QoS, reliable
- Cons: Complex, resource-intensive
HTTPS (HTTP Secure)
- Type: Web-based REST API protocol
- Use: Remote control panels, logging, APIs
- Pros: Secure, standard
- Cons: High latency, not for real-time
WebSocket
- Type: Full-duplex over TCP
- Use: Live dashboards, real-time UI ↔ Robot
- Pros: Bi-directional, efficient
- Cons: Client/server model complexity
3. Summary Table
Protocol | Type | Speed | Direction | Use-case |
---|---|---|---|---|
UART | Serial | Low (~1 Mbps) | Duplex | Serial sensors, GPS |
I²C | Serial | Low (100 kbps–3.4 Mbps) | Half-duplex | IMUs, EEPROMs |
SPI | Serial | High (>10 Mbps) | Full-duplex | Flash, ADCs |
CAN | Bus | Medium (1 Mbps) | Multi-node | Motor control, drive systems |
RS-485 | Serial | Medium | Multi-drop | Industrial robotics |
EtherCAT | Ethernet | Very High | Real-time | Industrial actuators |
Cyphal | Bus/UDP | Medium | Pub-sub | Distributed robotics |
MQTT | Network | Medium | Pub-sub | Cloud telemetry |
DDS | Network | High | Pub-sub | ROS 2 messaging |
HTTPS | Network | Medium | Request-response | Web APIs |
WebSocket | Network | High | Full-duplex | Real-time dashboards |