Home/ Projects/ I2C Protocol

I2C Serial Communication Protocol

A custom I2C serial communication protocol for underwater robotics motor controls, developed for the ASUR (ASU Robotics) autonomous submarine at Arizona State University.

TimelineAug 2018 – May 2019
TeamASUR Underwater Robotics
ContextASU Capstone / Club Project
ROS Controller Control values float values I2C Protocol Layer Encode → Serial string Validate + transmit serial string Motor Driver Thruster control I2C bus (SDA / SCL)

Control values from ROS are encoded into serial-transferable strings by the protocol layer and transmitted over the I2C bus to the motor driver.

The problem

The ASUR autonomous submarine required precise, low-latency motor control across multiple thrusters. The existing communication between the ROS (Robot Operating System) control layer and the motor drivers lacked a well-defined serial protocol — control values needed to be reliably encoded, transmitted over I2C, and decoded on the receiving end without data corruption.

The project required a protocol that could handle the electrical noise and constraints of an underwater embedded environment, where unreliable communication directly impacts vehicle maneuverability.

What I built

A custom I2C serial communication protocol written in C++ for the ROS ecosystem. The protocol defines how motor control values are encoded into serial-transferable strings, transmitted over the I2C bus, and decoded by the motor driver microcontroller.

Technical decisions

I2C was chosen over SPI for its two-wire simplicity and multi-device addressability — important for a submarine with several independent motor controllers. The encoding scheme converts control values to fixed-length byte strings to ensure predictable frame sizes and simplify parsing on the microcontroller side.

Integration with ROS required wrapping the protocol in a C++ node with proper publisher/subscriber patterns, allowing the high-level autonomy stack to issue thrust commands without needing to know anything about the serial transport layer.

C++ ROS I2C Embedded Systems Serial Communication

Outcome