The first question people ask me these days when I talk about either Raspberry Pi or Arduino is what is the difference between them. This was one of the prominent question that people asked me during my recent PyCon talk and Maker Party presentation.
Even though both Raspberry Pi and Arduino are created to solve different problems, there is a slight overlap and people get confused on which one to choose for their projects.
Instead of answering people individually, I thought I would rather write a blog post so that I can point people to it when ever the question arises again.
Raspberry Pi
Source: http://learn.adafruit.com/assets/2846
As most of you would know, Raspberry Pi is a full-fledged credit card sized computer with 512 MB RAM and 700 MHz micro processor. It can run a full Linux based operating system and has hardware support for SPI, I2C and Serial.
Pros
The following are some of the main advantages of Raspberry Pi
- Entire Linux software stack is available
- It is very easy to connect to internet
- Can be programmed using variety of programming languages
Cons
The following are some of the main limitations of Raspberry Pi
- Accessing hardware is not real-time. If the CPU is busy, then interfacing with hardware can be delayed
- No built-in Analog to Digital converter available
- Does not have enough power to drive inductive loads
- The hardware design is not open source. Even though it is not a big deal, for some people it might a deal breaker
When to use (and not use) Raspberry Pi
If you project has very limited hardware interaction but is slightly complex on the software side or need to be connected to internet then you should just go with Raspberry Pi. Also if you want to program using variety of programming languages (not limited to C/C++), then you should choose Raspberry Pi.
On the other hand, if you project requires a lot of hardware interaction and need to read data from lot of sensors or need to control lot of devices, then Raspberry Pi may not be best choice.
Arduino
Source: http://learn.adafruit.com/assets/3199
Arduino is a collection of three things. A hardware prototype platform, Arduino language and IDE & libraries. The board is based on 8-bit AVR microcontroller. It has built-in hardware support for SPI, I2C and Serial.
Pros
The following are some of the main advantages of Arduino.
- Very easy to get started
- Very easy to extend it and has tons of user contributed shields and libraries. Shields are available to do pretty much anything
- Can be used to for real-time applications
- Everything (both hardware, software and IDE) are open source
- Not much programming knowledge needed to do basic stuff
Cons
The following are some of the main limitations of Arduino.
- Not very powerful when compared with Raspberry Pi (Micro processor vs Micro controller)
- You need to program using either Arduino or C/C++ (or assembly if you really want to)
- Connecting to internet is slightly difficult (you have shields and libraries, but is not straight forward), but not impossible. I have in fact used Arduino with YQL and JSON parsing as well.
When to use (and not use) Arduino
If you project requires you to interact with lot of or complex external hardware, then you should consider using Arduino.
On the other hand, if your project requires lot you to write complex software or requires entire software stacks or protocols, then Arduino may not be the best options.
In Short
In short, this is the summary
Feature |
Raspberry Pi |
Arduino |
Processor Speed |
700 MHz |
16 MHz |
Programming Language |
No limit |
Arduno, C/C++ |
Real-time Hardware |
No real-time |
In real-time |
Analog to Digital Convertor |
No |
Yes |
Hardware Design |
Closed source |
Open source |
Internet Connection |
Very easy |
Not easy, but doable |
Best of both worlds
If you project requires both software and hardware equally, then you can also use both Arduino and Raspberry Pi together in your project and get the best of both worlds.
Source: http://learn.adafruit.com/assets/2846 and http://learn.adafruit.com/assets/3199
If you feel, I missed out any important points, then feel free to leave a comment below or ping me in Twitter and I will add them to the list.