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
| Board | MCU | Clock | Flash / SRAM | I/O Pins | Key Feature |
|---|---|---|---|---|---|
| Uno R3 | ATmega328P | 16 MHz | 32 KB / 2 KB | 14 digital, 6 analog | Most popular, huge community |
| Mega 2560 | ATmega2560 | 16 MHz | 256 KB / 8 KB | 54 digital, 16 analog | More I/O for complex robots |
| Nano 33 BLE Sense | nRF52840 | 64 MHz | 1 MB / 256 KB | 22 digital | BLE + 9-axis IMU on-board |
| Arduino Due | SAM3X8E (ARM) | 84 MHz | 512 KB / 96 KB | 54 digital, 12 analog | 32-bit, 3.3 V, native USB |
| Arduino Portenta H7 | STM32H747 dual-core | 480 MHz | 2 MB / 1 MB | 78 digital | Industrial-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
| Model | SoC | CPU | RAM | Notable Addition |
|---|---|---|---|---|
| Pi 3 Model B+ | BCM2837B0 | Cortex-A53 quad @ 1.4 GHz | 1 GB | Gigabit Ethernet, dual-band Wi-Fi |
| Pi 4 Model B | BCM2711 | Cortex-A72 quad @ 1.8 GHz | 1–8 GB | USB 3.0, 4K video, faster GPIO |
| Pi 5 | BCM2712 | Cortex-A76 quad @ 2.4 GHz | 4–16 GB | PCIe 2.0, RP1 I/O chip, faster camera |
| Pi Zero 2 W | RP3A0 | Cortex-A53 quad @ 1 GHz | 512 MB | Ultra-compact, Wi-Fi, low cost |
| Pi Pico / Pico 2 | RP2040 / RP2350 | Cortex-M0+ dual @ 133–150 MHz | 264–512 KB | Microcontroller 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).