I am fairly new to the programming world and have been using an “Arduino Mega 2560”, I was curious on how this would compare to a “Raspberry Pi 3”. So far my primary usage of the Arduino is using it to control stepper motors and high-speed cameras such as photron. I also just started a circuit’s class for engineers that are not EE.
5 Answers
It's an apples to oranges kind of thing.
Arduinos are comparatively much simpler than the RPi. Arduinos, as a platform, are all microcontrollers. They have much less computational power, but are very good at managing things that are time sensitive or require low amounts of power.
The Raspberry Pi on the other hand is much closer to a traditional desktop/laptop setup. It will pull a hell of a lot more power, but it has a full desktop/server OS. That gives you a lot of flexibility, but introduces other tradeoffs.
- 11,904
- 7
- 47
- 58
Arduino is only a microcontroller, which means that it can only do one thing at a time. It is designed for doing more with hardware. An arduino has more physical capabilities like analog inputs and PWMs, but can only store and execute one program at a time. A raspberry pi on the other hand is a single board computer, which means that if you plug in your peripherals then you can run a raspberry pi as a full computer.
You should also have a look this great comparison between the two, I think you will like it: Raspberry Pi Vs Arduino
- 3
- 2
- 436
- 1
- 4
- 13
Why compromise? It's very simple to drive an Arduino over USB connected to a Raspberry Pi. It makes a virtual serial port, that you can then use as a communication channel.
Say you need a cheap Arduino mega to control 40 relays and 10 digital inputs you can simply write the whole logic, network part, interface part etc on the Pi then have it send 2 DWORD's of data to the Arduino every time the output pin layout changes. You can even use the last word for a checksum. On the Arduino you just write a simple serial monitor and digitalWrite the bits accordingly.
For your input pins you do the same but from the Arduino to the Pi.
At 115200 baud you can make your Arduino pins change state 3600 times every second.
You don't want relays to switch every 277 microseconds and be alive for very long. Believe me.
- 6,357
- 3
- 25
- 39
- 11
- 2
Well, to make it short:
On a Raspberry Pi you can install Linux and use it for far more stuff than a Arduino, which is a microcontroller.
- 242
- 2
- 10
You don't need to choose between arduino and learning python. On a PI you can make very fast code with WiringPI, in the same simplified flavour of C++ as used for arduinos. You get the benefit of much more memory and faster CPU, networking and a tolerable operating system.
The GPIO pins on PI are less rugged, so be more careful. Source (as a rule) only 8mA per output. The pins use 3V3 logic. It's plenty for driving transistors, logic-level MOSFETs etc.
WiringPI is available here. It is very well documented.
- 681
- 5
- 8