1

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.

2
  • Highly related raspberrypi.stackexchange.com/questions/3565/… while not addressing the Mega 2560 the general idea is the same. Arduino has analog inputs, more hardware pwm outputs, more gpio, and more UARTS but much, much less raw computing power and RAM than the Pi.
    – Ghanima
    Aug 26, 2016 at 19:55
  • The Arduino and Pi make a great pair when connected via serial link (no need for a USB cable -- but always remember you do need a level shifter in the middle!); the Arduino has a greater variety of pins for low level purposes, and the Pi a nice array of high level ports (networking, HID, displays, etc.). The Arduino IDE and loader can be used directly on Raspbian, I believe (I've never bothered with that, but pretty sure it is in the repos).
    – goldilocks
    Aug 26, 2016 at 20:25

5 Answers 5

2

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.

2
  • 1
    How about a zebra vs. a barrel of monkeys? Worth mentioning that because the Pi can run a multi-tasking OS kernel, it is better for doing an arbitrary collection of all-or-mostly unrelated tasks in parallel, but, except in so far as dedicated bits of clock driven hardware are involved, is more awkward for doing very precisely timed things (as you say), whereas the Arduino, which does one thing after another in a procedural loop, is more predictable, but much more limited because of the gargantuan gap in speed and memory.
    – goldilocks
    Aug 26, 2016 at 20:19
  • 2
    I prefer "pool of squirrels" to "barrel of monkeys", personally.
    – Jacobm001
    Aug 26, 2016 at 20:20
1

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

1

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.

0

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.