Why should I use Raspberry over Arduino?

Hi All,

I have a new robotic project in the form of a complete autonome electric power generator.

I am use to Arduino and my logical choice will be an Arduino Due which is my preferred choice. This Arduino Due works at 3.3V only which is not a real problem. However, I follow the Raspberry thread since the beginning and I am impressed with what members here accomplish with Raspberry/Xojo.

If you have some time, I will appreciate it when you can give your opinion about why I should use Raspberry over Arduino Due? Before I decide, I want to base my decision on experienced Raspberry users which many people here are. All your remarks, negative or positive about Raspberry/Arduino are most welcome. I just want to make a good decision and minimise the risk of a failure.

Thank you very much for your time spend on my question, which will be appreciated very much.

Wish you a very nice day.

Friendly greetings,

Chris

my main point of view about this is the “overkill” dilemna…
adapt the task to be done to the good dev platform
using a rasberry to display a temperature is wayyyy overkill (and energy waste)
you can do that with a $3 esp8266 and nothing else ! (except a temperature sensor)

if you need a responsive user interface, like a complete tactile screen to do a home automation
then a rasberry with a xojo app inside is a better choice

also why dont you mix both of the devices ? make the arduino do what he knows, and the rasberry what he knows too ?

for example, it seems not possible to read analog values from the rasberry (except the last update of bjorn from einhugur module)
but the arduino knows how to do that from the beginning !

My opinion.
I am in the middle of the project to drive 4 relays,2 temp sensors(thermocouples) 1 open-close valve and 1 stepper.
Raspberry+xojo for gui, this is missing from Arduino,or you need external programs for visualization (codesys,rex,etc).
Raspberry Performance.
If you have large project you can bridge (with shields) raspberry with Arduino to extend the capabilities of Raspberry to Arduino gpio and drive them from raspberry.

Thank you both for your input which I find very usefull and appreciate.

For the generator, there is no visible user interface, it simply has to work on itself. There can be for one or two months, nobody around to watch it. All the time, it has to work and deal with possible errors. There are several sensors for measuring current, voltage, heat. At best there is a small LCD screen to show the state and parameters of the generator. There will be switches for emergency break and switch it on or off.

I did not think about combining the two systems, Raspberry and Arduino which is due my own small thinking. I agree in doing this, it is making use of the best of both worlds. It would be very nice to check and make adjustements when I am in Botswana while the generator is in Belgium. I am sure the Raspberry is better equiped for that then Arduino.

A question which is coming up with me now is; how will Raspberry deal with power cuts? The Arduino will continue flawlessly after a complete power cuttoff when the power gets back on. Will Raspberry just do the same, after a complete powercut, will it start working when the power is back on, without any human interference?

You both supplied me with new interesting ideas to think about. Thank you Jean-Yves and Loannis for your interesting suggestions, really do appreciate that!

Wish you both a very nice weekend,

Chris

The Pi does not require much power. A decent UPS suitable for a desktop computer will surely provide several hours of power to a Pi. That solves the power cut issue and you get power surge protection as a bonus.

Think the most important reason to use Raspberry over Arduino is that Xojo supports Raspberry Pi very well. :slight_smile:

a raspberry is a linux computer : so yes you can start process automatically at startup but it will be more painful to program (especially from the command line …)
with the arduino you have nothing to do : as soon as the power comes back, the program restarts and everything goes as before.

I assume today you will use an esp8266 which is an arduino with integrated wifi.
you can make a complete web server with that, that you can see from anywhere in the world at any time … for $3
the raspberry will come for $35 (or may be a little more) so if you can do the same result for 10+ times the price what would you choose ?
again I would use a raspberry where the arduino cannot do the task (too much computing power needed, or a tactile screen interface, or complex linux programs like databases to embed)
for the simple tasks you need (motors, voltage, amp measurements,) the arduino is enought.
the only and main lack of the esp8266 is not a lot of I/Os available (but you have i2c and spi so you can expand the I/Os)

just search on the net :
esp8266 light sleep mode is around 0.5mA
raspberry pi in sleep mode ( you can wake up when you want) is … 120mA !!!

Hi Chris,

As mentioned by Jean-Yves this question answers its self depending on the project.
I am a hardware (and software) developer of more years than I wish to remember and most projects come down to cost, commercially at least, plus the time required to develop.

Currently I have a project that would be perfect for a fast 32 bit embedded PIC (my favourite) and a bespoke 7 inch touch screen.
But due to development requirements it is now using a Pi with official touch screen, largely because the initial development required is to generate the concept for production.

But as Jean-Yves said the Pi runs linux, and as an OS it is extremely painful to use, you have to deal with command line and the fact that its open source and free means there are serious holes in it everywhere, lots of unfinished projects, unsupported but well meaning branches etc, for me Linux makes windows seem a welcome place to visit.
The Pi is also unoptimised for battery operation and you are stuck with all the peripherals even if they are not needed, which for production is important, development not.

Xojo works extremely well with the Pi and personally I would not use a Pi for anything without being able to write the app in Xojo.

But in the end the project will be on an embedded processor written in C as that is the only real way for it to be manufactured at a reasonable cost, that point will never happen without the Pi being there at the start.

I think you said you were looking at a robotic project? I did not understand your initial message properly.
Any thing that has motors or high powered switching will cause serious issues with connected devices, as I am sure you know, something like the Pi in that situation will need special attention as it is very sensitive to its power input, the system will crash very happily when the power supply is poor.
An embedded system is very easy to protect and, as mentioned previously, the start up time of an embedded system is a few milliseconds, a PI is 30 to 60 seconds depending on the installation.

Chris,
What does the application do?

I develop for Pi with Xojo, Perl, Python, and even Scratch on occasion. I use what is appropriate/convenient/expedient for the task at hand.
I also have a small hardware project that emulates a USB HID device, to which I connect a Mac running a Xojo/MBS built application. Via several LCA110 electronic relays I interface this project board with the physical world. For this piece I used the Teensy board running code developed in assembly. The Teensy was the cheapest option, much more resilient to power outages, and a virtually instant on time. I could have done it on a Pi with Xojo faster, but speed wasn’t the deciding factor.

My point being the Pi/Arduino/Teensy, et al and the languages and dev tools they support are not a one size fits all solution. You can use many tools to get the same results.

You ask what you should use a Pi over Arduino, but that is a question only you can answer, and answer in conjunction with the project you are working on at that time.

Hello Mark and David,

Thank you both very much for your interesting answers which I appreciate very much.

I do not know Raspberry PI very good and besides information on the internet, I liked to know the ideas and opinions of people here who have experience with Raspberry. What got my interest in the first place for Raspberry was the fact I can program it with Xojo. For the Arduino I use the C like language.

The project is not a secret, so I can perfectly share that information. On this moment I am planning a generator which can provide a normal home of electricity. Taxes and energy here in Belgium are very high, even when I am not here for a longer period (some periods of the year I am in Botswana, other periods I am in Belgium but my home is in Botswana). I want to find a clean, cheaper and safe solution for the moments I am not here. So I am designing a completely autonomious generator which is driven by a fast DC motor with a slow rotation speed DC generator. We like the generator to produce around 7000 KWH a year. We intend to use a gear train of 2:1 or (better 4:1). By operating at 48V DC we reduce the currents and by using the gear train we reduce the power the DC motor needs to drive the generator. We will use two true sinus invertors to convert the power from 48 VDC to 230 VAC. There are starting batteries (two blocks of 2 batteries each) which provide the starting energy and when the generator cannot keep up. Also the batteries are loaded when their energy fall below 40% of their capacity. When one block is loaded, the other takes over. I have to point out that this is not an unlimited free energy solution like those magnetic motors seen on websites like YouTube which are all a hoax. In our design we respect the natural law who says that you cannot get out more energy than you put in.

There are in fact two microcontrollers present with each their own sensors. The Arduino Due will do the complete process controlling while a second smaller controller is concerned with safety and checking the values of the main microcontroller as detecting fires, gas levels (coming from the loading of batteries).

On this moment the project is in a preluminary design stage, on which we did not make much calculations. On this moment we are checking if our theories will work like we expect. In other words if there are no flaws in our thinking. When we have done all the calculations and the result is positive, we will start building the generator.

Based on the replies I tend to use Arduino. A startup or restart time of 30 seconds is too long for our application. From the moment the system gets its power back, those microcontrollers have to be ready. For whatever reason the generator stops working, those microcontrollers has to find out how they can safely restart again. For that reason when the main power is off, they will automaticly be powered by the batteries. The generator can stop for several reasons :

  1. they are overloaded
  2. the motor, generator or invertors get too hot
  3. there is a short circuit, in that case the system has to check if there is a route to provide power again to the most important lines (heating in winter time)

There is no need of a graphical interface or controls on the generator itself. Access over the internet is enough so it can be checked and in case of a failure to intervene over the internet. Here in Belgium I have a fast DSL connection which is always on.

It is a project I am doing with a friend. I am responsible for the electronics and programming the solution, my friend takes the mechanical part for his account. I find this a very interesting project because besides of incubators, I did never do a project of this scale and I believe in it.

I asked for advice here on this forum and I am happily surprised about the replies I received. Be assured that I appreciate the efforts of all people who contributed here very much. I want to say a BIG BIG THANK YOU to everybody for your input. To show ypu all my appreciation, I decided to share the project with you. It is in a very early stage but I will keep you informed here about the progress we made. When we have our theoretical results (positive or negative), I will give here the details too. I believe in this project that it can work out. I have to make clear that this is not a commercial project, so there are no secrets. When it is working on a small scale, we will happily share it freely.

I wish you all a very nice day and all the best.

Friendly greetings,

Chris