The Arduino vs Raspberry Pi question is something that is often asked by beginners in the maker community. They are both pretty cheap, the same size, and look very similar - the confusion revolves around what the two boards actually do, and what kind of project each board is designed for.
The Raspberry Pi is a mini-computer running a choice of different Linux operating systems. You can think of the Raspberry Pi like your desktop computer, only a lot smaller and with some extras to control certain electronics. The Arduino is a microcontroller - a barebones chip designed to run only the code you have programmed for it, without the overhead of a full operating system.
The Arduino is a programmable microcontroller where the only functionality is has it what you specifically program it to do. It doesn't run an operating system, and you can't plug in a keyboard and monitor to the device. To create a program (known as a 'sketch') to run on the Arduino, you must first write it in on a computer and then compile and upload to the board.
When you upload the sketch, it overwrites any existing program on the chip, and when you power on the Arduino that sketch is run automatically.
The fundamental function of the Arduino is to read data from sensors and switches, run computations on the data it collects, and send control data back out. It can output serial data over a USB connection to a computer, or by using SPI or I2C to connect to other serial devices such as LCD screens or WiFi modules.
The Arduino can send digital signals out of its pins. By sending a high or low value out, you can turn on LEDs, control stepper motors, and activate relays to turn on really high power devices. It can also send out analog signals as PWM - using this you can control devices with a variable voltage, such as dimming an LED, or reducing the speed of a motor.
To read data, the digital pins can read either a high or low value (for example when pressing a switch or if a motion detector is activated) and the analog pins can read variable values between 0 and 1023. The analog pins can read data such as the position of a potentiometer knob or an ambient light sensor.
The Arduino is used in many different types of projects, from musical applications and interactive art exhibitions, to robotics and gaming gadgets. There are quite a few different types of Arduino boards aimed at different uses, from boards with more I/O pins, to boards that can be embedded directly in projects.
As the board is open source, there are also lots of "compatible" boards that offer the same functionality for a fraction of the price. The main ATMega chip can be taken out of the Arduino and replaced easily, or embedded directly into a project after prototyping.
The Raspberry Pi is on the opposite end of the spectrum - it features a fully fledged Linux operating system loaded onto an SD card. It has a variety of different connection options, such as audio out, HDMI video output, Bluetooth, WiFi and an Ethernet port.
It also features some digital pins similar to the Arduino for controlling hardware components. This allows you to use your Raspberry Pi as a computer, complete with internet browsing, games and everything else you can do with a PC. Plug in a keyboard, mouse and monitor, and you have an amazingly cheap computer.
The way to communicate with the hardware pins is a little different however. You first need to install any relevant GPIO packages onto the operating system, an then write your code directly on the Pi. You can use a multitude of different languages, but the most common is Python. There is also a C++ library which makes it familiar to Arduino users, and can be embedded in custom C++ project.
Raspberry Pi projects are often more software based than hardware based. As it is basically a Linux computer, most projects are based around software hacks, media centres and graphics/sound and multimedia. You can run web services, scripts in different programming languages, and larger projects that require more computer power. It can however do some simple hardware control with the GPIO pins.
Arduino vs Raspberry Pi
Choosing between Arduino or Raspberry Pi depends on the type of project you want to make, and your experience in programming. If you have no experience in programming or electronics, you will find the Arduino a steeper learning curve than the Pi as you will have to learn both skills at the same time.
They have both been around for quite a while now and there are tons of useful tutorials around to get you started. If you have some basic experience in programming you should have no problem getting to grips with either board.
As the programs you write for Arduino are run directly on the chip, there is little overhead and your sketches can run fast and with minimal latency. This makes it a brilliant platform for robotics control.
For the Raspberry Pi, you need no experience or components to get it working - just plug and play! It's basically a computer so you can plug in in any peripherals you need and get started right away. As it runs a full operating system, you might find there are conflicts in the process scheduling and performance, although generally faster, may not have consistent performance including random stutters.
The Pi is more suited to running as a low-power computer, for example running as a basic storage or media server. As the Arduino can plug into a Pi, you can use the Pi as a main controller which hands off commands to the Arduino for further processing.
If you want to make a hardware project then the Arduino is often the best choice. It's low power, cheap to buy, and the digital and analog pins add a whole spectrum of connectivity. The large amount of I/O pins let you connect multiple sensors and components, and you can remove the actual micro controller of the Arduino (on the 8-bit ATMega versions) and embed it directly into your project with only a couple of additional components. However, the Arduino is not as powerful as the Pi, so there's no audio, video or internet built it.
If you want to make a software project then the Pi is the way to go. The audio, video and internet capabilities make it the winner in this aspect. There's no need to attach external components, so there's no real need to learn electronics. The option to control electronics is a great addition, so you can control LEDs and relays as part of your project. As it's a Linux box, there's also a ton of source code out there to help get you up and running.
The Arduino can be powered using a standard barrel jack (7V-12V) or via USB to a host computer. It has 14 digital pins (which can be set to either inputs or outputs) and 6 of them can be used as PWM output, for emulating analog outputs (for example a dimmable LED). It has 6 pins dedicated to analog inputs, so you can read an input value between 0V and 5V.
To connect to other devices, the Arduino features I2C, SPI and UART connections, which should allow you to connect to most sensors and modules on the market. As a bonus, the Arduino can run as a HID device, so you can create a peripheral for a computer (or a Pi!) such as a custom macro keyboard.
The Pi is more focussed on consumer peripherals. It features ethernet, WiFi, and bluetooth connectivity, along with a UART connector. The GPIO (general purpose input/output) is a 40 pin header with 26 addressable pins. Like the Arduino it can communicate over I2C, SPI and UART. The pins are all digital though, so you can't read a variable voltage input from a sensor without connecting via one of the other mentioned methods.
It features 2 micro HDMI ports for connecting to a monitor, and 2x USB2 and 2x USB3 ports for connecting to other hardware. It also has a PCI express connector, which allows an SSD to be connected, and a MicroSD slot for running a basic OS.
If you want to connect to other USB devices, have a device online, or have a HD monitor as part of your setup, the Pi comes out top.
The Arduino runs an 8-bit ATmega328P processor running at 16 MHz with 2KB of SRAM and 32KB flash storage. It's not going to win any performance records, but as it's dedicated to only running a single sketch, you can pretty much guarantee it'll run a well thought out project with no issues and rock-solid reliability.
On the other hand, the Pi is a relative powerhouse. It sports a quad-core Arm Cortex A76 processor running at 2.4GHz. It can be configured with either 4GB or 8GB of RAM and is capable of running two 4K monitors at 60Hz. Don't expect to play the latest AAA title on it as the GPU is pretty basic and can sometimes stutter when trying to decode 4k video.
The performance difference of the Raspberry Pi vs Arduino is like a mile-wide canyon, but they have very different functions.
The Pi and the Arduino have quite different power requirements. The Arduino is so low power, it can run directly over the USB port from a host computer. Obviously if you run a lot of hardware components you may hit this limit, but at idle it will be around a quarter of a watt. If you run it in low power mode using interrupts, and are frugal with your components, there's no reason it can't run from a battery source.
The Pi on the other hand is a bit of a beast. The recommended supply should be 5.1V at 5A, which gives the full 27W needed. It can be run from a 3A supply, but it would limit the power to any peripherals and isn't advised. At idle it can draw around 3 or 4 watts, and even when shut down it can draw an amp!
If low-power is a requirement as you want it to run off-grid or untethered, then the Arduino is a clear winner here.
The Arduino Uno costs around $30 for an official one, ot as it's open source you can find 'clones' on the internet for a few dollars. It comes bundled with a USB cable, so you can get started right away, however it's based on hardware control, which means you won't get far without some components: LEDs, LCDs, resistors, motors, sensors etc.
For around $45 you can get a complete starter kit, which contains an Arduino clone, a breadboard & jumper cables, and a massive load of components to get up and running. Another alternative is to get components as and when you need them from places like Amazon and Ali Express. If you go the Ali Express route, you will be waiting quite a while for the components, but you can pick up a multitude of different components for pennies on the dollar. You probably want to take a look at the the best budget multimeter as well as it's an invaluable tool when working on electronics.
Over a decade ago when this article was first written, the Arduino Uno and Raspberry Pi were roughly the same cost. Now the base Raspberry Pi 5 (with 4GB RAM) costs a whopping $60, not including the additional bespoke accessories you need to get it up and running.
You need a MicroSD card to load the operating system on to, a hefty 27W power supply to run it, an active cooler (and probably case) to get the most performance, a monitor and cables to view the output, and a keyboard and mouse to control it. Unlike the previous generations, you probably won't have any of the parts, as you need a non-standard 5A power supply, a class 10 MicroSD card, a Micro HDMI to HDMI cable, and a heatsink and fan.
If you were to get a starter kit for the Raspberry Pi, you'd be looking at $150 for everything all in just to be up and running. If you want to control hardware, you'd be looking at additional costs on top of that.
Arduino vs Raspberry Pi Summary
To summarise, the Arduino is more suited for projects like LED controllers, alarm systems, robots, weather stations, and hardware hacks. Anything where it will have a single dedicated function which is mostly hardware based. On the other hand, the Raspberry Pi is perfect for software projects such a NAS server, web server, gaming emulator, media center and magic mirror.
The Arduino vs Raspberry Pi comparison is summarised in the following table...