1

I am thinking about buying Arduino or Raspberry Pi. I generally know Arduino advantages (fast start-up, low consumption, ADC converters) and disadvantages (low memory, low connectivity, hard programming), but I simply cannot figure out maybe the most important issue: current output for controlling devices.

One of the common cited advantages of Arduino system compared to Raspberry Pi system is that power per I/O pin is much larger. Arduino Uno allegedly has up to 20 mA @ 5 V per pin and 50 mA @ 3.3 V per pin making quite substantial power of 0.15 W, compared to say typical 10 mA @ 5 V per pin for Raspberry Pi (although there is no official number available).

On the other hand

  • this power is far too low to control any motors and you still have to provide shields,
  • new version Arduino 101 reduced that current to 20 mA and even less for some other Arduino models.

So, what is really the importance (if any) of these higher currents for home projects, compared between different Arduinos themselves and compared to Raspberry Pi?

There is also a question of total current for all pins together, which is also limited, but it is soooooo difficult to get official limits (for both Arduino and Raspberry Pi).

Please give me some insight into this issue, so I can decide.

Pygmalion
  • 113
  • 6
  • I have a silly question which might help - how much drive current does your project actually need? Do you have lots of LEDs (which an Arduino might be able to handle directly) or are you driving motors (which all common microcontrollers will need a driver circuit for)? – Andy Mar 18 '16 at 17:05
  • The problem is that I need microcontroller for learning and playing and I do not want to limit my ideas by bad choice of device in advance. – Pygmalion Mar 18 '16 at 17:31

3 Answers3

3

The simple answer is: It doesn't matter.

Both Arduino and the Raspberry Pi, and every other common microcontroller board, are designed to control things, not provide power to things.

Digital IO pins aren't designed to drive heavy loads. Yes, some (like the Arduino) can provide slightly more current, but that is really unimportant for most projects.

Yes, some boards have more powerful power supply circuits on them so you can draw more current from their power supplies, but again that is largely irrelevant.

The one thing that you seem to be forgetting (or haven't realised) is that the microcontroller board does not have to supply all the power.

The Arduino, Pi, Teensy, chipKIT, whatever, is merely a controller. If your system needs more current it is up to you to provide that current. The Arduino etc merely controls the circuit or device that it is connected to.

It is very common to have multiple power supplies in a large project - each providing different voltages, or being used for different specific tasks within the project.

Just one thing you need to remember: Connect the grounds.

Majenko
  • 105,095
  • 5
  • 79
  • 137
  • ...or use an opto-isolator ;) – fabrosell Mar 18 '16 at 17:20
  • 5
    @fabrosell ... or a relay ... or an arrangement of motors, pulleys, elastic bands, and small rodents. – Majenko Mar 18 '16 at 17:47
  • 1
    Where can I get this small-rodent-isolator? mouser.com? – Gerben Mar 18 '16 at 19:07
  • 1
    I mean, you can avoid connecting grounds if you use an opto-coupler. – fabrosell Mar 18 '16 at 19:17
  • @gerbem of course. They specialize in them. – Majenko Mar 18 '16 at 19:17
  • So Arduino 101 should't be worse than Arduino Uno in any aspect? – Pygmalion Mar 18 '16 at 19:34
  • @Pygmalion As long as you're not driving heavy loads, and interfacing things with the correct driver circuits, then there should be no real difference – Majenko Mar 18 '16 at 19:34
  • After doing a lot of study I realized that opto isolators are themselves current hungry devices. So if you need, say input 20 mA to run opto isolator you are back to square one. Or are there some low-current opto isolators? – Pygmalion Mar 21 '16 at 09:43
  • You don't need 20mA to run an optoisolatoe. That value is an upper limit. Check the datashete and look at the pretty graphs to see the switching characteristics. Most will switch from aroud 5mA. – Majenko Mar 21 '16 at 09:44
  • Since RPi provides pathetic total 50mA for all GPIO combined (to use all 17 pins you need at least 175mA = 85mA, not mentioning usage of SPI and I2C), it seems that RPi sucks* for serious projects. Do you know by any chance what is total current for all pins for Arduino 101? – Pygmalion Mar 21 '16 at 09:48
  • Nobody outside of intel knows and they aren't telling anyone. – Majenko Mar 21 '16 at 10:01
  • Oh well. Arduino and RPi are great projects, but occasionally I get an impression that some details are not well conceived. They are particularly tight with currents... – Pygmalion Mar 21 '16 at 11:12
  • My conclusion would be "Both Arduino and the Raspberry Pi are designed to control things, but they did not really provide enough current to safely use all control pins." :) – Pygmalion Mar 21 '16 at 11:22
  • @Pygmalion That depends on how you define "use". Drive heavy loads - not always. Interface with logic and other similar devices - perfectly adequate. – Majenko Mar 21 '16 at 11:35
  • I partially agree. But let stop here and not turn this discussion into a flame. – Pygmalion Mar 21 '16 at 11:40
3

Bottom line is: the controllers are just not meant for supplying power.

They do have the ability to do so, within limits - fairly stringent limits for a controller chip itself, and slightly more generous limits for the on-board power supply. If you really need an all-in-one, you might consider making building your own controller board with a more capable on-board power supply and a number of transistor switches to provide power for the hungrier devices, that can be switched by the MCU chip.

Note that this will not improve the chip's ability to supply power - you can't, by any practical means - but the board can, through the switching transistors.

Figure out your project's power budget, or the budget you'd like to have for your future projects, and design an on-board power supply to exceed that by a healthy margin-of-safety. Likewise, for the individual switched circuits, in order to choose a sufficiently robust switching transistor.

If you prefer an off-the-shelf solution, one of the available motor-driver boards is probably a good choice but it will need to have an independent power supply if there isn't one on the driver board.

JRobert
  • 15,246
  • 3
  • 23
  • 51
3

I bought a Pi a while back, and found it so tedious to use I put it in my parts drawer and haven't used it since. A Pi is like a small Unix PC - you have to install an operating system, boot it up (which takes time) and then install device drivers etc.

The Arduino (particularly the Uno) boots in under a second, and "just works". It is much easier to use for small to medium projects.

As for the current, as others have replied, you aren't supposed to be powering things, like motors, from the output pins. 20 mA is a nice amount of current to flash an LED, or send data to another device. The output pins are for data not for driving things like motors. If you need more than 20 mA you should be looking at driver circuits, like transistors or MOSFETs.

... hard programming ...

I wouldn't say that. You program in C++. What are you going to program the Pi in? There are many libraries for the Arduino to simplify programming, but you can get down to the "bare metal" quite simply.

Nick Gammon
  • 38,184
  • 13
  • 65
  • 124
  • I actually did program Raspberry Pi for a research project and I used Python. I know both Python and C++ and the former is far more user friendly. Which is a bonus if you want your kids not only to learn electronics but programming too.

    Otherwise, yes, I like the fact that Arduino "just works", but it also has extremely small memory, far too small for a serious project.

    – Pygmalion Mar 19 '16 at 08:44
  • @Pygmalion Python is beginner friendly. C++ is programmer friendly. Choose which you want to be in the long term. – Majenko Mar 19 '16 at 09:49
  • it also has extremely small memory, far too small for a serious project - it depends on your definition of "serious". I have one right now controlling access to my house. It's been there for a few years now, and works perfectly. It's a microcontroller, not a supercomputer. For projects - ones suitable for a microcontroller - it does a great job. – Nick Gammon Mar 19 '16 at 21:10
  • I did a lot of programming for controlling relatively small science projects and I usually end with a source code of cca 20 kB. I know that C++ source code is compiled, but this by the rule of thumb only increases the required space. – Pygmalion Mar 21 '16 at 10:29
  • The AVR compiler is quite good at generating compact code. Especially if you choose sensible data types, like 1-byte or 2-byte types. Once you start using long and float code necessarily bloats somewhat. – Nick Gammon Mar 21 '16 at 19:38