Arduino vs Raspberry Pi - Which one is better?

preview_player
Показать описание
The Arduino microcontroller is a complete ecosystem of boards, software, 3rd party libraries, clones, and an online community. Likewise, the Raspberry Pi is a complete maker ecosystem of boards, software, 3rd party libraries, and an online community. You can get an Arduino board for less than $10 and similarly you can get a Raspberry Pi board for less than $10. So, what are the differences and which is best?




#garyexplains
Affiliate Disclosure:
When you buy through links in our description Gary Explains may earn an affiliate commission.
Рекомендации по теме
Комментарии
Автор

Ok ;) Few important notes. You can make Raspberry Pi Zero to boot up almost as fast as Arduino. It boots up so long because it starts complex OS from SD card which is totally OPTIONAL. Arduino has no OS whatsoever, just pre-programmed bootloader which allows to upload your hand-crafted firmware to the MCU. So... you can make hand crafted firmware to Raspberry Pi Zero as well, see projects which uses RPi to emulate Commodore 1541 floppy drive and it's OS or BBC Micro turbo module. This is kind of use in which RPI starts almost instantly. SDCard corrupts because OS makes accesses to the card when power fails. If it's read-only filesystem that alone makes it way less vulnerable. Flash-writes during loss of power might corrupt that flash region on MCU as well, but with SD card you can actually damage system files but with MCU you only get invalid data in eeprom emulating flash region which doesn't process code, only holds data. Arduino original product is also made to support foundation, so substantial portion of the official price is "donation" ;) Most clones are way cheaper, MKR1000 clones will probably be as low as 10$ anyway - that's component price + manufacturing fee + small profit margin. And last but not least - MCU has on-die advanced timers which really allows you to generate pwm, count fast impulses etc. It also has powerful ADC with speed way over acoustic band (and less noise) plus almost as powerful DAC. And can power down to draw microamps so is well suited to battery powered nodes. Also MKR can support directly capacity touch buttons, sliders etc. (due to having decent ADC and libraries) when RPi cannot without external hardware. So basically in most of the times when you have to run multiple applications under system it's way better to stick with Raspberry (or Orange, or Banana, or CHIP, or Nano or whatever Pi). If you need specific firmware solution with wifi connectivity it's either mkr or just esp32. Which actually offers most of the things MKR offer, has faster core and costs less.

Promilus
Автор

ESP32 is such a cool arduino-device. Its got everything, can even run old gameconsole-emulators and cost from like $5.

AndrewTSq
Автор

Good video! I would say though, with the whole Arduino vs Pi thing, you kind of make it sound like the Pi can do everything an Arduino can and more. While that is kind of true, people should not think that they should just ignore Arduino and go straight for a Pi. Just because you COULD plow a field with a Monster Truck (Pi), it would be better to use a Tractor (Arduino). Lol

bluegizmo
Автор

You gotta be in business ...

Meaning you have to actually use both types to understand what the differences are and what they are useful for.
If you dont have a general interest for automation, programming or electronics, you will never quite understand what these bugs are 😎

Being educated as an electronics engineer back in the '70es, I feel like heaven on earth with all the possibilities now available.
Back then we had to look for bargains on BC237's in multipacks, to get something done 😛

CXensation
Автор

you can get an atmega328p clone board for 2-3 bucks, and even then they get murdered by 80 mhz STM32s left and right going for the same price,
and they barely even deliver in the GPIO part (where ESP32s shit the bad with low analog input polling rates and all)
the STM can do a gameboy with way lower level instructions, the r-pi can emulate 8 and 16 consoles with decent results regardless of massive amounts of OS and emulator overhead,
STM can't even dream of matching the r-pi in value proposition when it comes to raw punching power, let alone the atmegas lol

i mean, 8mhz on arduino (20 mhz before it burns up with some oscillator crystals) vs 1ghz, that doesn't require any IPC measurements to tell me who's the winner there,
not to mention 8-bit vs 32-bit, it can literally push 4x more data in a single clock cycle too AND be more precise too,
a factor of literally 100 isn't even off the table when it comes to calculation speeds.

but yeah, if youre looking for a low-power controller for your projects (going as low as 20 milliamps at 5v, 1/10th of a watthour),
nothing wrong with it, for embedded hardware -> less is more.
then again, the extra hardwre on the arduino makes it WAY less power efficient than just the atmega...
one goes for days on a battery, the other one can go for months if you use the power states right and just wake up from an external trigger
so the arduino kind of undermines the whole power thing in favor of flashing your own atmegas (regardless of whether it has the arduino bootloader or not)
never even bothered using the GPIO on the regular r-pi, why dedicate a powerhouse like that for it when it's raining atmega, stm32 and esp32s for 3 bucks.


the power of the pi zero is the fact it has 2 usb controllers, and you can flash the firmware on them to make your own HID usb devices (Although the controller on the arduino leonardo specifially can do that too), and has ample ram to run more than 3 libraries, pretty sure that was the original MSRP orso, haven't seen one under 10 for at least 3 years, they have been inflated forever... closer to 13 than the 8 bucks they used to be (but that's with the wifi these day though)

if you're really looking to work with barely any resources, try a digispark, it's a rush to work around the insane limitations of 1kb ram and 6kb program memory,
and usually they are used like rubber duckies with a USB keyboard/mouse library that already eats away at that 6kb.
but i find hard walls like that works inspiring.

either way, they're sooo much different, but everyone who really wants to look into coding embedded stuff and learn about electronics themselves, should have an arduino,
hell i'd say you haven't really optimized code, and learned the ropes, until you had microcontroller beat your ass with limitations like it was 1985
code is hell to maintain, and it's usually best practice to just delegate the job to multiple controllers even if you could do it on 1, but it's a great learning experience :D

i find r-pis the best way to learn your way around linux though, as a sysadmin i learned the ropes of Redhat 5 back in 99, but never saw linux as a good desktop operating system,
i still don't by the way, window managers can't help but suck shit even today, that's why i'm a CLI warrior.

in fact, i havea midi controller in the works that uses the zero as USB to midi interface, but the actual self-sufficient processes like the internal sequencer and oscillators are delegated to atmegas, way easier to maintain code and debug, and more shots at redundancy too,
and let's face it... i don't expect microsecond precision from a r-pi running a full-blown operating system, in terms of timing precision not even the fastest x86 pc has anything on the atmegas, despite all the nanotime functions and 64-bit floats they can return, they'd be lucky to get 2ms precision in the loop with the operating system bullshit keeping it down, i reckon it's a lot better on ring 0, haven't tried using pure ring 0 on a pi to be honest, the arduino will murder any general purpose computer in GPIO functionality and timing precision.
(people still hold on to r-pi 1's for GPIO as they're better at it, custom timings and stuff)

source:
i have 2 r-pi 3bs, an r-pi 4, an arduino uno, a leonardo, a mega knockoff, about 5-6 atmega382p nano knockoffs, and like 8 dip versions of the atmega chips themselves (without arduino bootloader)
about 3 stm32s and about 3 ESPs (of which 1x esp32, and 2 old ones that still allow for wifi deauthing ;)

yes, most of them are in the big old aliexpress drawer of shame, reminding me of all the projects i haven't finished yet,
(i'm a computer geek, but a shitty electrician)

tl; dr: i think the arduino isn't worth putting money on anymore at this point, not even the atmega chip itself really. it's been a good run though,

dutchdykefinger
Автор

esp32/8266 and micropython are a perfect alternative for arduino, has wifi and boots fast and if you need the arduino ecosystem you can use it too. Has a ADC and works with every sensor.

alexshield
Автор


nice reference to the "full" rpi board price

fuseteam
Автор

I'm glad I watched the video bc I was about to rip you a new one based on the title. I can see why people would hate on you for the title, but I can see why you would title it as it is. People who don't know much about this would come in thinking "Let's see what this guy's opinion in, " when it in fact turns out to be a video saying, "yeah, you can't compare these things." I think a good analogy would be Arduino as a car and a pi as an airplane. Could you take a plane anywhere you take a car? Sure. But it would be pretty stupid to take a plane to the store or take a car across multiple continents. Different use cases require different tools.

JoelSolomonivoriesablaze
Автор

great video, i love the fact that the cost now is kind of just down to the 'manufacturing' process and handling, and not anymore the complexity of those CPU's, or MCU's, whatever.
Each weigh about 20g raw material, and thats just the cost

spwim
Автор

Esp32 is my preferred device now. Rpi in in otrer level, like server where I need a bunch of iot devices be coordinated, controlled and monitored. The simplicity is a plus in complex protects that provides more strong and flexible ecosistema. Each device have their utility.

papablopapapablo
Автор

Great video! Suggestion, show a little love for the ESP32?

stalbaum
Автор

Arduino is a microcontroller
Rpi is a microprocessor

anishkamble
Автор

I use the esp8266 nodemcu and d1 mini all the time for home automation with Home Assistant. Esphome is wonderful. Esp32 are great for the bigger jobs.

smoke.
Автор

For the $20 price difference you could get a 20000mAh battery pack that would protect your sd storage and help buffer the power draw difference. I don't really know why else one would choose an Arduino other than price.

cheako
Автор

I did a quick search for Arduino and Raspberry projects some days ago and found a lot more interesting projects for the Arduino than for the Raspberry. Those were the same boring stuff as always like a display built in the mirror. I just thought that is rather strange.

id
Автор

I've been wanting to build a CO2 scrubber for a while now. Looks like the Pi Zero W I bought is a bit overkill.

I'll just use it for a robot, though.

ancapftw
Автор

If your considering Servo or other PWM devices, the Pi is very poor as it lacks true hardware level PWM control. On the other hand, the Arduino can read and write digital signals; It can detect for example a high, low, rising or falling of the signal. And allows you to generate your own custom signal in real time.

stylesoftware
Автор

Prices can be misleading because we are talking retail prices. Once you scale production up you should notice that microcontroller boards can be indeed a lot cheaper than more complex SoC. It may be possible that Arduino is making small batches of the board to reduce stock sizes and that is what drives prices high, particularly because the MKR system is less popular than previous boards and also is in their "Industrial" niche. I do agree with your points about system complexity and booting times, but there are many other reasons you would use an Arduino instead of a Pi, for example ADC and DAC, PWM, UARTS, USARTS, TIMERS, I2C and many other peripherals of which microcontrollers tend to have plenty more than a Raspberry-Pi.

reiniertl
Автор

*You CANNOT try different operating systems of any kind on an Arduino! And Arduino doesn't have an OS, its IDE is a compiler and uploader for the libraries to the compatible devices* .
The biggest differences between the two are Pi's can have an OS for more memory-hungry and complicated tasks (complex robots etc.) while Arduino are for basic to moderate mechanical tasks. Also Arduino is only the interface for the microprocessor itself, but the microprocessor can be removed (from some Arduinos) to make the device/circuit smaller or make copies of the microprocessor for more than one device.

sjonjones
Автор

I know arduions\microcontrollers almost always meet real time sysem requirements like hard timing constraints. But does the pi? With an OS you're not always going to meet hard deadlines, as it could be scheduling other tasks so the important task might miss it. Though this depends on what your hard timing constraints are.

matthwc