Arduino: The Microcontroller

An Arduino is not a computer; it is a microcontroller development board. The classic Arduino Uno is built around an ATmega328P: an 8-bit AVR processor running at 16 MHz with 2 KB of SRAM and 32 KB of flash storage. There is no operating system, no filesystem, and no multitasking scheduler. You upload a single program, and it runs in a tight loop.

That constraint is also its biggest advantage. Without an OS getting in the way, an Arduino can toggle a pin or read a sensor in microseconds, reliably, every time. This predictability, called determinism, is exactly what motor control, encoder reading, and PWM generation require. A Raspberry Pi running Linux can be interrupted by kernel tasks at any moment, which makes it a poor choice for anything that needs guaranteed sub-millisecond timing.

Where Arduino falls short: it cannot run complex algorithms, handle a camera feed, connect to Wi-Fi out of the box (without a shield or a wireless-capable board), or run the full ROS stack. Its 2 KB of RAM fills up fast. It is a specialist tool, not a general-purpose computer.

Beyond the Uno, the Arduino ecosystem spans boards with far more powerful chips. The Arduino Portenta H7, for example, pairs an Arm Cortex-M7 running at 480 MHz with a Cortex-M4, and supports MicroPython. But the same principle applies: it is a microcontroller family, optimized for low-level, real-time work.

Raspberry Pi: The Linux SBC

A Raspberry Pi is a single-board computer running a full Linux operating system. The current model, the Raspberry Pi 5, uses a Broadcom BCM2712 quad-core Arm Cortex-A76 processor at 2.4 GHz and ships in 2 GB, 4 GB, 8 GB, and 16 GB LPDDR4X RAM variants (a 1 GB version also exists). It runs Raspberry Pi OS (Debian-based), supports USB, HDMI, camera connectors, Ethernet, and Wi-Fi, and installs software from standard Linux package repositories.

For robotics, the Pi's strengths are in computation: it can run computer vision pipelines with OpenCV, execute path-planning algorithms, host a web interface for your robot, or run ROS 2 nodes. That is a category of work an Arduino cannot touch.

The tradeoff is that Linux introduces timing variability. The Pi's GPIO pins can be toggled in software, but you cannot guarantee microsecond precision, because the kernel can preempt your process at any moment. Driving a servo directly from the Pi's GPIO is workable for slow, non-critical motion; it is not appropriate for a brushless motor controller or anything that needs hard real-time guarantees.

The Pi is also more expensive, more power-hungry, and slower to boot than an Arduino. It is the right brain for a robot, not the right reflexes.

ROS: The Middleware Layer

ROS, the Robot Operating System, is neither an operating system nor a programming language. It is a middleware framework: a set of libraries, tools, and conventions that let the different software components of a robot communicate with each other. ROS runs on top of Linux (most commonly Ubuntu, and it also runs on Raspberry Pi OS).

The core idea is that a robot's software is broken into small, independent programs called nodes. A camera node publishes image frames. A navigation node subscribes to those frames and publishes velocity commands. A motor-controller node subscribes to velocity commands and sends signals to hardware. Nodes pass structured messages over named channels called topics, and none of them need to know how the others work internally. This makes it practical to build, test, and reuse complex robot behaviors without rebuilding everything from scratch.

ROS also provides a large ecosystem of ready-made packages: Nav2 for autonomous navigation, MoveIt 2 for motion planning and robot-arm control, Gazebo for simulation, and tools like RViz for visualizing robot state in real time. These packages represent thousands of engineering hours that a team can drop into a project rather than write themselves.

ROS 1 (final release Noetic) reached end of life in May 2025 and is no longer actively maintained. The current standard is ROS 2, which replaced the fragile central rosmaster with a distributed DDS communication layer, added real-time-friendly design, and introduced security features. For any new project, ROS 2 Jazzy (an LTS release supported through May 2029) is the right starting point.

When to Use Which

Use Arduino alone when the task is simple and hardware-focused: blinking LEDs, reading sensors, driving a servo, or building a line-following robot. The low cost, instant-on behavior, and ease of getting started make it the right first tool for beginners and for any embedded task that does not require heavy computation.

Use a Raspberry Pi alone when you need computation but not hard real-time control: a robot that navigates via a camera and drives motors slowly enough that Linux jitter does not matter, or a teleoperated robot where a human is in the control loop. The Pi 5's power makes a lot possible without needing a second board.

Add ROS when your robot's software grows complex enough that managing the connections between components becomes the hard part. A mobile robot with lidar, cameras, a navigation stack, and an arm is a realistic candidate. ROS 2 gives you a communication backbone, a rich package ecosystem, and simulation tools that dramatically shorten development time.

Do not reach for ROS early. For a two-wheeled robot following a wall, ROS adds overhead without benefit. Start simple, and add layers when the complexity justifies them.

How Real Robots Combine All Three

The combination of Raspberry Pi as brain, Arduino as hardware interface, and ROS as coordination layer is common enough to be a standard pattern in robotics education and research.

In a typical setup, the Raspberry Pi runs ROS 2 and hosts the high-level nodes: navigation, perception, and planning. An Arduino connects via USB serial and handles motor PWM, encoder reading, and any sensors that need fast, consistent polling. The Pi never touches the motors directly. To bridge the two, a node on the Pi reads and writes a simple serial protocol to the Arduino, translating between ROS topics and the bytes the microcontroller understands.

An important detail trips up newcomers here. In ROS 1, the rosserial package let a microcontroller act as a ROS node over serial, but rosserial is part of the now end-of-life ROS 1 and was never ported to ROS 2. Its ROS 2 successor is micro-ROS, which does let a microcontroller publish and subscribe to ROS 2 topics directly. The catch is that micro-ROS requires a 32-bit MCU (such as an ESP32, STM32, Teensy, Arduino Portenta H7, or Nano RP2040 Connect); it will not run on a classic 8-bit Uno or Mega. With an 8-bit Arduino, the practical path is a custom serial bridge on the Pi rather than micro-ROS.

This division mirrors how a biological system works. The brain (Pi) decides where to go and what to do. The spinal cord and muscles (Arduino) execute precise, low-level actions without waiting for the brain to weigh in on every millisecond.

A concrete example: a six-axis robot arm might run ROS 2 on a Raspberry Pi 5, with MoveIt 2 computing joint trajectories. Those trajectories are published as ROS messages. A 32-bit microcontroller running micro-ROS (a Teensy or an STM32 board, say) subscribes to them and drives the servo controllers with precise PWM timing. If the low-level board is an 8-bit Arduino instead, a serial-bridge node on the Pi forwards the same commands. Either way, neither side could do the other's job well.

Practical Starting Points

If you are new to robotics, start with an Arduino and a simple actuator. Understanding how a microcontroller controls real hardware is foundational; the feedback loop between writing code and watching something physical move is the fastest way to build intuition.

When you outgrow Arduino's processing limits, add a Raspberry Pi. Connect the two over USB serial and write a simple protocol for passing sensor data and commands back and forth. This teaches you the core problem that ROS solves, which makes ROS much easier to learn when you get there.

Learn ROS 2 when you are ready to build something with multiple sensors, autonomous behavior, or a navigation stack. The official ROS 2 documentation at ros.org is thorough, and the Gazebo simulator lets you develop and test nodes without physical hardware. Running ROS 2 on a Raspberry Pi 5 is well-supported and documented by the community.

The three tools are not rivals; they are layers. Most robots worth building eventually use all of them.

Key takeaways

  • Arduino is a microcontroller platform, best at deterministic, real-time hardware control with as little as 2 KB of RAM and no operating system.
  • Raspberry Pi is a Linux single-board computer, capable of running a full OS, camera pipelines, and machine learning, but not suited to hard real-time motor control.
  • ROS (now ROS 2) is middleware, not an OS: it provides the communication framework, tools, and libraries that let software components talk to each other across a robot.
  • The most capable hobby and research robots combine all three: the Pi as high-level brain, an Arduino as low-level hardware interface, and ROS 2 as the coordination layer.
  • ROS 1 reached end of life in May 2025; new projects should start on ROS 2 Jazzy (LTS through May 2029). Its rosserial package has no ROS 2 port; micro-ROS replaces it, but only on 32-bit microcontrollers.