Component · Controller

Raspberry Pi

The Raspberry Pi is a full Linux computer the size of a card—the brain for robots that need vision, ROS, or compute an Arduino can't handle.

What it is

The Raspberry Pi is a full computer the size of a credit card. Where an Arduino Uno is a microcontroller that runs one program forever, a Pi runs Linux—so it can drive a camera, talk to the network, run ROS 2, and execute your robot code all at once. It is the brain you reach for when a robot needs to think, not just react.

That power is also its trade-off: Linux multitasking makes the Pi worse at the microsecond-precise timing a microcontroller does effortlessly. The two are partners, not rivals.

Labelled diagram of a Raspberry Pi single-board computer: a green PCB with a 40-pin GPIO header of gold pads along the top edge, a Broadcom system-on-chip and a RAM chip in the centre, a stacked USB and Ethernet block on the right edge, HDMI and USB-C power on the bottom edge, and a microSD card slot on the left.
A Raspberry Pi packs a computer onto one board: the SoC and RAM run Linux, the 40-pin GPIO header talks to robot hardware, and the microSD holds the OS. Download SVG

How it works

The Pi boots an operating system (usually Raspberry Pi OS) from a microSD card, then behaves like any Linux machine. For robotics, the important part is the 40-pin GPIO header: digital inputs and outputs, plus I²C, SPI, and UART buses, that let the Pi read sensors and command hardware. On top of that sit the computer parts—USB, Ethernet, Wi-Fi, and a camera interface—that a microcontroller simply doesn’t have.

A common architecture is a two-brain robot: the Pi handles perception and planning (vision, SLAM, ROS nodes) and hands motor commands down to an Arduino that does the real-time control.

When to use it

Reach for a Pi when the robot needs a computer’s abilities:

  • Computer vision — a camera plus OpenCV for detecting markers, objects, or lines.
  • ROS 2 — running nodes, topics, and the navigation stack.
  • Mapping / SLAM — building and localising in a map.
  • Networking — a web dashboard, remote control, or telemetry.

Stick with an Arduino or ESP32 for pure real-time control jobs—they’re cheaper, simpler, and better at precise timing.

Wiring and gotchas

  • 3.3 V logic, and not 5 V-tolerant. Feeding a GPIO pin 5 V can damage the Pi. Level-shift signals from 5 V parts (e.g. an HC-05 TX line).
  • It still can’t power motors. GPIO drives signals; motor current goes through a driver like the L298N.
  • Power is fussy. Give it a stable 5 V at enough current; brown-outs corrupt the SD card and cause random reboots.
  • Shut it down cleanly. Yanking power from a running Linux system can corrupt the card—design a safe power-down or use a read-only filesystem.

Explore the graph

Used in these builds

Projects, learning paths, and simulators that include the Raspberry Pi.

Compare

Alternatives

Questions

Raspberry Pi FAQ

What is a Raspberry Pi?

A Raspberry Pi is a small, low-cost single-board computer that runs a full Linux operating system. Unlike an Arduino, which runs one program on a microcontroller, a Pi is a real computer—it can run a camera, a browser, ROS, and your robot code at the same time.

Raspberry Pi vs Arduino—which do I need?

Use an Arduino for real-time control of motors and sensors; use a Raspberry Pi when the robot needs vision, mapping, ROS, or networking. Many robots use both—the Pi as the high-level brain and an Arduino as the real-time hands. The Pi's Linux multitasking makes it worse, not better, at microsecond-precise timing.

Can a Raspberry Pi control motors?

Its GPIO pins can send PWM and direction signals, but—like an Arduino—it cannot power a motor from a pin. You still drive motors through an H-bridge such as the L298N. The Pi's pins are also 3.3 V, so mind logic levels when wiring to 5 V parts.

Do you need a Raspberry Pi for a robot?

No. Most beginner robots (line follower, obstacle avoider) run happily on an Arduino for a fraction of the cost and complexity. Reach for a Pi only when the task genuinely needs a computer—computer vision, SLAM, running ROS 2, or a web interface.

What are the best Raspberry Pi models for robotics?

The Raspberry Pi 4 and Pi 5 are the usual picks—enough CPU and RAM for computer vision and ROS. The Pi Zero 2 W is a tiny, low-power option for lighter robots where space and battery matter more than raw speed. Skip the oldest models (Pi 1 and 2) for anything compute-heavy.

Further reading

References