Skip to content

Communication Protocol

A communication protocol describes how different parts of your IoT system talk to each other. You design and document how data is exchanged between, for example, sensors and a microcontroller, or between a microcontroller and a back-end system. You decide which data is sent when, in which format, and how you make sure that the data has arrived correctly.

For this product, you design and describe the communication protocol for your embedded or IoT system, including message formats, timing, reliability, and error handling.

Communication Protocols in IoT Systems

In an embedded or IoT project you often work with different types of communication:

  • Physical and data-link level protocols, such as UART/serial, I²C, SPI, or CAN
  • Network and application level protocols, such as Wi-Fi, MQTT, HTTP, CoAP, or custom binary formats

You decide which protocol(s) to use based on distance, speed, reliability, energy consumption, and complexity. You then define which messages are sent, in which structure, and how the receiver interprets them.

Quality indicators

When assessing this product, the following quality indicators will be considered:

  • The communication protocol document is self-contained, starting with an introduction/context and then describing the protocol in detail.
  • It clearly describes which communication channels are used (for example UART, I²C, Wi-Fi with MQTT/HTTP) and why they were chosen.
  • It describes the message formats or frames (fields, data types, units) for the most important messages.
  • It describes when messages are sent (for example intervals, triggers, request/response patterns).
  • It explains how reliability is handled (acknowledgements, retries, checksums, timeouts).
  • It describes how errors and invalid data are handled.
  • It includes diagrams, tables, or examples that show how devices communicate.
  • It includes references to the code in GitLab that implements the communication protocol.
  • It includes a list of sources used to design and implement the communication protocol.

Template

To document the communication protocol of your own project, you can use the following template:

# Communication Protocol

In this section, describe in a few sentences which devices or components communicate with each other and why a clear protocol is important. This is the main text of your document.

## Context & Requirements

Here you describe the context:
- Which devices are involved (for example sensors, microcontroller, gateway, back-end)
- What kind of data is exchanged
- Requirements regarding reliability, latency, bandwidth, and energy consumption

## Chosen Protocols

Here you describe which communication technologies you use:
- Physical/data-link protocols (UART, I²C, SPI, CAN, etc.)
- Network/application protocols (Wi-Fi, MQTT, HTTP, CoAP, etc.)
- Why these protocols are a good fit for your project

## Message Formats

Here you describe the structure of the messages:
- Which messages or topics exist
- Which fields each message contains (name, type, units, possible values)
- Examples of complete messages (in text, tables, or diagrams)

## Timing & Reliability

Here you describe:
- When messages are sent (intervals, triggers, request/response)
- How you ensure reliable delivery (acknowledgements, retries, checksums, timeouts)
- How you handle errors or invalid data

## Implementation

Here you briefly describe how the protocol is implemented in your code:
- Which libraries or APIs you use
- How sending and receiving is structured in the code

Add references to the code in GitLab and small code snippets to illustrate key parts.

## Sources

List here the sources you used to design and implement the communication protocol (documentation, articles, videos, books, etc.).
Also include sources that helped you write the code.