Micromelon Robotics
Platform
Resources
NewsAbout UsDownload
Support
Build Your Kit

Stay in the loop

New activities, teaching guides, and product updates delivered to your inbox.

Micromelon Robotics

Australian-made educational robotics for the next generation of innovators.

contact@micromelon.com.au

Company

  • About Us
  • Privacy Policy
  • Terms and Conditions

Products

  • Micromelon Rover
  • Code Editor
  • Robot Simulator
  • Junior
  • Python Library

Support

  • Resources
  • News
  • Rover Repairs
  • Contact
  • Build Your Kit

© 2026 Micromelon Robotics Pty Ltd. All rights reserved.

ABN 56 623 302 296

← Back to Resources
Advanced GuidesAdvanced

How to Use UART

12 December 2024

How to Use UART

UART (Universal Asynchronous Receiver Transmitter) is a hardware communication protocol used between two devices. The Micromelon Rover features an expansion header that can be used to connect external devices like an Arduino or an IR sensor. This guide explains how UART works, how it’s implemented on the Rover, and how to connect a device using UART.

Rover expansion header where UART is exposed

Rover expansion header where UART is exposed

What is UART?

The UART communication protocol is used to transmit data packets over two wires, it’s useful because it allows serial data to be transmitted from one device to another. UART is asynchronous, meaning no clock is needed to send data. All that’s required is the transmit pin of one device connected to the receive pin of another.

Since there’s no clock, the transmitter and receiver must agree on a predetermined transmission rate called the baud rate. UART also has a standard packet structure so the receiving device knows when to read the bits:

Start bitData frameParity bitStop bits
1 bit5–9 data bits0–1 parity bit1–2 stop bits
  • The start bit is held high until data is ready to be sent and then set low, this tells the receiving UART to begin reading the transmission line.
  • The data frame contains the actual data and can be anywhere from 5 to 9 bits long, depending on whether the parity bit is used.
  • The parity bit verifies the data, it counts the number of 1 bits and sets the parity bit to 0 if the total is odd or 1 if it’s even. This ensures no bits have been changed during transfer.
  • The stop bit signals the end of a packet by pulling the transmission line to a high voltage. The receiver then stops reading.

Hardware Setup

UART wiring, RX to TX, TX to RX, plus shared ground

UART wiring, RX to TX, TX to RX, plus shared ground

Connecting two devices using UART requires two wires. Each device’s RX (receive) pin must be connected to the other’s TX (transmit) pin. A shared ground is also needed between both devices.

The UART pins are on the expansion header below the LCD screen on the Rover. The 3.3V and GND pins are also required to power the device communicating with the Rover. Jumper wires can be used.

Micromelon Rover expansion header pinout

Expansion Header Pinout

12-pin header. Pin 1 is top-left; top row reads left-to-right, bottom row reads right-to-left.

Pin 1I2C SCL3.3V logic
Pin 2Battery VoltageInternal
Pin 3I2C SDA3.3V logic
Pin 4UART RX3.3V logic
Pin 5UART TX3.3V logic
Pin 6GND
Pin 12ReservedInternal I2C
Pin 11ReservedInternal I2C
Pin 10ReservedNC
Pin 93.3V300mA
Pin 8ReservedNC
Pin 7USB VoltageFused to 1A

Note: The Rover’s power switch should be in the on position when the other device is powered on. Not doing so may cause the Rover to be back-powered, even if the 3.3V and GND pins aren’t connected.

Rover UART Packets

The Rover follows a particular format for UART data, this format allows commands to be sent to the Rover from an external device. Most languages have a function that handles the start bits, parity bits, and stop bits, so all that needs to be given is the data frame. The structure is:

Start byteOperation byteRegister byteData length byteData byte
Always 0x050x00 to read, 0x01 to writeEnum corresponding to a commandNumber of bytes of dataData related to the command
  • The start byte is always 0x05, which tells the Rover’s UART to begin reading the transmission line.
  • The operation byte is set based on whether the external device is going to read data (0x00) from the Rover or send commands (0x01) by writing data.
  • The register byte corresponds to the command being sent.
  • The data length byte is the number of bytes in the data.
  • The data byte is the data related to the command.

Software Interfacing

The final step is writing a program to initialise the connection, create packets, and send them. Implementation depends on the secondary device being used, but generally this is in either Python or C++.

For a Python implementation, see the OpenMV UART guide. For a C++/Arduino implementation, see the Arduino UART guide.

Continue Learning

How to Connect and Control the Micromelon Rover with OpenMVRelated resourceHow to Connect and Control the Micromelon Rover with OpenMVConnect an OpenMV camera to the Rover over UART and use it to detect objects and drive towards them.

Getting Started with Arduino and the Micromelon RoverRelated resourceGetting Started with Arduino and the Micromelon RoverConnect an Arduino Uno to the Micromelon Rover and control it over UART using software serial.

Showcase: Rover and Arduino Line FollowRelated resourceShowcase: Rover and Arduino Line FollowA showcase of using I2C and an Arduino Nano to drive an 8-channel QTR line sensor array for advanced line following.

← Return to Resources