Posts with «iot and connectivity» label

Upline: a minimal serial protocol for 8-bit IoT

Upline is a minimal serial protocol that turns any microcontroller into an IoT device. The project sheet describes a system based on newline-delimited ASCII records, with a complete Arduino implementation in a single header. The project, by smlcrft, targets 8-bit chips with very limited resources.

The operation is simple. The byte stream is split into lines using LF or CR terminators, ignoring empty lines and those that do not start with the ‘^’ character. Each line is a list of independent entries, delimited by the same ‘^’ character. Each entry represents an operation on a specific key.

How the Upline protocol works

Entries are only processed if fully delimited by two carets. This way partial data is never applied, and an interrupted communication does not leave the device in an inconsistent state. Writes are confirmed via an echo of the value actually in use: this distinguishes a rejection from a loss of communication.

A periodic heartbeat demonstrates that the device is alive and speaks the Upline protocol. This limits the receiver’s wait time, which immediately knows if the node is operational. The protocol also supports escaping special characters with six symbolic sequences, and does not require floating-point numbers: it uses the fixN format for decimals.

  • 4,060 bytes of flash on ATmega328P, 358 bytes of SRAM
  • 3,168 bytes of flash on ATtiny85, 253 bytes of SRAM
  • 2,100 bytes of flash on ATtiny85 in transmit-only mode
  • 98 bytes for a universal line reader on ATmega328P

The numbers are remarkable for a complete protocol. On ATmega328P, 4,060 bytes of flash and 358 bytes of SRAM are needed. On ATtiny85, consumption drops to 3,168 bytes, and in transmit-only mode to 2,100 bytes. The project sheet also reports 98 bytes for a universal line reader on ATmega328P.

Why Upline matters to makers

Upline lets you turn any microcontroller into an IoT device with a minimal, efficient, and robust protocol. The philosophy is the opposite of heavy frameworks: here everything fits in one header and runs even on 8-bit chips with only a few hundred free bytes. An Arduino Nano ESP32 board can use the same protocol as an ATtiny85, simplifying communication between heterogeneous nodes.

The protocol is particularly suited to those building distributed sensors, remote actuators, or small monitoring nodes. Moreover, the echo confirmation makes the system reliable even over noisy radio links. To connect a node to a PC and read the record stream, just use a 3.3 V / 5 V USB-serial converter: Upline speaks over any UART.

Getting started with Upline

To start, simply download the upline-arduino header and include it in an Arduino project. The fact sheet lists support for ATmega328P, ATtiny85, SAMD21, ESP32, and RP2040, among others. An Uno R3 with an ATmega328 is a great test bench to learn the protocol without soldering anything: those are the 4,060 bytes of flash measured by the author.

The source code is a single header file, so integration is immediate. No external libraries or complex build tools are needed. A USB ATtiny85 board is instead the project’s edge case: 3,168 bytes of flash and 253 of SRAM, and the protocol fits entirely inside.

Finally, the project documentation reports precise numbers for each configuration. This helps choose the right microcontroller based on flash and SRAM budget. For the smallest projects, transmit-only mode on ATtiny85 requires just 112 bytes of SRAM.

Source: https://github.com/smlcrft/upline-serial-protocol

Related products

The post Upline: a minimal serial protocol for 8-bit IoT appeared first on Open Electronics.