[EN] Raspberry Pi VS Arduino : Which one to choose ?
"What should I choose between Raspberry Pi and Arduino?" is probably the question I most often hear from people who want to start a robotics project, that's why in this first article I will try to give you some elements to choose between the different platforms you can find on the internet.
If you don't understand some of the words I use, don't hesitate to comment on them!
The Big Picture:
Let's start with Arduino:
Arduino boards are programmable boards based on microcontrollers. The microcontrollers can be assimilated to very simple processors, i. e. they do not contain an operating system (there is no Windows, Linux or Mac), its computing power is very low (compared to that of a computer, a phone or even a Raspberry Pi) but they are very inexpensive and make it easy to interact with other components very quickly (what they can be used for...). Unlike the Arduinos, the Raspberry Pi has no analog inputs, so you will have to use an additional component to read some sensors.
Arduinos cards are programmed in a language derived from C++ thanks to Arduino IDE, an integrated development environment developed by Arduino to simplify the programming of its cards. Indeed, Arduino IDE includes everything you need to start your project (it includes a text editor, a compiler and a debugger, a serial interface and a library manager as well as all the drivers your computer will need, we'll see in detail each of these points in a future article) so you need to install only one software to start. One of the advantages of the Arduino is its low power consumption compared to the Raspberry Pis, in general, an Arduino consumes between 15 and 55mA and a Raspberry between 150 and 500mA. In counterpart, the Arduinos can perform only one task at a time.
The Raspberry Pis (often abbreviated RPi) as for them are kind of microcomputers, just like the ones you are used to using they have an operating system (based on Linux most of the time so you will have to learn to use it if you are not familiar with it), they also have USB ports, an HDMI port and Bluetooth and Wifi connectivity for some models. RPi has in common with the Arduinos 2 rows of GPIO to interact with the physical world in the programming language that you want (be it Python, JS, C++, Go, Ruby,...) where the Arduinos officially support C++ only. But you will need to install an operating system and the necessary tools to program a RPi. Moreover, RPi are more sensitive to damage related to their use (disconnect the power supply without having turned it off, short circuits,...) than Arduinos.
A metaphor often used to compare them is that the Raspberry Pi is the brain of the robot and the Arduinos are the muscles.
That is to say, on projects of a certain magnitude the RPi will do the tasks that require a lot of computing power (the software part: vision with a webcam, consequent web server, VPN server, a media center...) and the Arduinos will manage for example motors and sensors, the hardware part.
So you will have realized, this article should not have been called "Raspberry Pi VS Arduino" but rather "Raspberry Pi & Arduino"! And the order in which you will learn to use them will depend on your projects and the points you want to work on first. Personally, I started by learning how to use Arduino and I will start by writing some articles about Arduino until I receive my Raspberry Pi Zero. But it is quite possible to start by learning how to use the Raspberry Pi, both designed to be easy to use.
A little more in detail:
Now that the general idea has been formulated, I will give you more details about each of the options and the alternatives to these two products.
There are different Arduinos cards available, the 3 most common of which are the Arduino Uno (basic card, for beginners), Nano (smaller but as powerful as Uno), and Mega (more inputs/outputs). You can find more information on these 3 boards here. To compare with RPi, the Arduino Uno has a "RAM" of 0.002 MB and a 16 Mhz clock versus 1024MB of RAM and a 1Ghz clock for the most powerful Raspberry Pis.
An important thing to know about the Arduinos is that there is not only one manufacturer (the cards being open-source anyone can produce them), so we call "clones" the cards that were made by companies other than Arduino. Sometimes these clones are slightly different from the original version (to reduce production costs or to add new features for example) and you may need to install an additional driver so that your PC can communicate with the card. In this case, take a look at this video.
Arduinos generally use a 5V voltage to operate. They have 1 I2C port (which will be discussed in a future article), 1 Serial port (used to communicate with the PC) as well as a number of GPIOs (for General Purpose Input Output, the inputs/outputs of the card) varying according to versions.
The alternatives to Arduino include Attiny chips, STM32 cards, and Teensy cards. The easiest to use remain the Arduinos, I advise you to start on these then compare them to others according to your projects.
You can see different projects realized with Arduino here.
As said above, the Raspberry Pies are halfway between computers and microcontrollers, which is why we will find features of both worlds in RPi.
First of all, as for the Arduinos, you have the choice between different models but I will present 2 of them which have in common the following characteristics:
- a WIFI and Bluetooth module,
- a video and audio output,
- a specific port for the camera,
- a microSD card slot (on which everything will be stored),
- 40 GPIO pins (including I2C ports, serial interfaces,...) in 3.3V,
- The Raspberry Pi 3 (model B), is the most powerful with 1GB of RAM and a 1.2Ghz processor, 4 USB ports, and an Ethernet port, all for about 35€.
- The Raspberry Pi Zero W (W stands for wifi, as there has been a previous version without wifi module for only 5€) has 512MB of RAM and a 1Ghz processor for about 11€, there is a USB port but you need an adapter to connect a USB device.
For future articles about the Raspberry Pis, we are going to use a Raspberry Pi Zero W which seems to me to be an affordable solution with a wide connectivity.
Concerning the competitors of Raspberry Pi, we can quote Next Thing Co. with their C. H. I. P. card. (which has the advantage of having an internal memory), Orange Pi, or Onion with their Omega2.
You can see different projects realized with Raspberry Pi here.
In the next technical article, we will see how to use an Arduino, the basic components in electronics and some simple examples to help you get started!
But in the meantime I'd like to talk to you about other things, so see you next week for a less technical article!
See you soon!