Skip to content
SDB
Embedded Control and Mechatronics

2 hours

Embedded Hardware Platforms – Arduino and Raspberry Pi

Practical Guide to the Most Widely Used Robotics Platforms

Subhendu Datta BhowmikRobotics Tutorials

The Arduino Ecosystem

Arduino is an open-source electronics platform combining easy-to-use hardware and software. Introduced in 2005 at the Interaction Design Institute Ivrea (Italy), it was designed to give non-engineers access to microcontroller programming.

The Arduino ecosystem consists of:

  • Hardware: a family of boards built around AVR (Uno, Mega) or ARM (Due, Zero, Nano 33) microcontrollers, with standardised shield connectors
  • Arduino IDE / CLI: a simplified C++ environment with the setup() / loop() programming model
  • Library ecosystem: thousands of open-source libraries for sensors, displays, motor drivers, communication protocols, and more
  • Shield ecosystem: plug-on expansion boards for motor control (L298N shield), Wi-Fi (ESP8266 shield), GPS, relay boards, and so on

In robotics, Arduino is commonly used for:

  • Low-level motor PWM generation and encoder reading
  • Sensor polling (ultrasonic, IR, IMU)
  • Actuation of servo motors and stepper motors
  • Serial communication with a host computer or SBC running ROS

Arduino Board Comparison

BoardMCUClockFlash / SRAMI/O PinsKey Feature
Uno R3ATmega328P16 MHz32 KB / 2 KB14 digital, 6 analogMost popular, huge community
Mega 2560ATmega256016 MHz256 KB / 8 KB54 digital, 16 analogMore I/O for complex robots
Nano 33 BLE SensenRF5284064 MHz1 MB / 256 KB22 digitalBLE + 9-axis IMU on-board
Arduino DueSAM3X8E (ARM)84 MHz512 KB / 96 KB54 digital, 12 analog32-bit, 3.3 V, native USB
Arduino Portenta H7STM32H747 dual-core480 MHz2 MB / 1 MB78 digitalIndustrial-grade, runs MicroPython/TF Lite

The Raspberry Pi Platform

Raspberry Pi is a low-cost single-board computer (SBC) developed by the Raspberry Pi Foundation (UK, 2012). Unlike Arduino, it runs a full Linux operating system, making it suitable for high-level tasks such as:

  • Running ROS 2 as a robot compute node
  • Computer vision pipelines (OpenCV, TensorFlow Lite)
  • Web servers, dashboards, and SSH-based remote operation
  • Node-RED visual programming for rapid prototyping

The Raspberry Pi exposes a 40-pin GPIO header that provides digital I/O, SPI, I²C, UART, and PWM — enabling direct hardware interfacing similar to a microcontroller. However, Linux is not a real-time OS, so timing-critical tasks (e.g., generating precise PWM for servos) are better handled by a co-processor or hardware PWM channels.

Raspberry Pi OS (formerly Raspbian) is the recommended distribution, based on Debian. For robotics, Ubuntu Server 22.04 or 24.04 for Raspberry Pi is popular as the official ROS 2 supported platform.

Raspberry Pi Hardware Generations

ModelSoCCPURAMNotable Addition
Pi 3 Model B+BCM2837B0Cortex-A53 quad @ 1.4 GHz1 GBGigabit Ethernet, dual-band Wi-Fi
Pi 4 Model BBCM2711Cortex-A72 quad @ 1.8 GHz1–8 GBUSB 3.0, 4K video, faster GPIO
Pi 5BCM2712Cortex-A76 quad @ 2.4 GHz4–16 GBPCIe 2.0, RP1 I/O chip, faster camera
Pi Zero 2 WRP3A0Cortex-A53 quad @ 1 GHz512 MBUltra-compact, Wi-Fi, low cost
Pi Pico / Pico 2RP2040 / RP2350Cortex-M0+ dual @ 133–150 MHz264–512 KBMicrocontroller class, bare-metal/MicroPython

Arduino vs Raspberry Pi in Robotics

Arduino

  • Microcontroller — deterministic real-time execution
  • Ideal for motor PWM, encoder interrupts, sensor polling
  • Low power consumption (50–500 mA)
  • Simple C++ programming model
  • Boots in milliseconds; no OS overhead
  • Limited to simple sequential or interrupt-driven logic
  • Cannot run ROS 2 natively (use micro-ROS for bridge)

Raspberry Pi

  • Single-board computer — full Linux OS
  • Ideal for perception, planning, ROS 2 nodes
  • Higher power (2.5–5 W typical)
  • Python, C++, Node.js, ROS 2 all supported natively
  • Boot time 20–60 s; OS overhead adds timing variability
  • GPIO accessible but not real-time without RT kernel
  • Runs full ROS 2 stack natively on Ubuntu

Arduino + Raspberry Pi: A Common Architecture

A widely used robotics pattern uses both platforms together:

  • Raspberry Pi handles perception (cameras, LIDAR), path planning, ROS 2 nodes, and high-level decision making
  • Arduino (or STM32) handles low-level real-time tasks: reading encoders, generating motor PWM, reading IMU at high frequency

Communication between them typically uses:

  • Serial UART (USB or hardware UART) — simple and universal
  • I²C — multi-device bus; Pi as master, Arduino as slave
  • micro-ROS over serial or UDP — Arduino publishes/subscribes ROS 2 topics directly

This separation of concerns is called a two-tier architecture and is common in mobile robots (e.g., TurtleBot 3 uses OpenCR as the low-level controller and Raspberry Pi for ROS 2).

Embedded Control and Mechatronics