Hi, I'm Becky Stern.
And today we are learning the difference between microcontrollers
and single board computers- or, SBCs.
I often get asked what processor type is best
for a particular DIY electronics project: Arduino or Raspberry Pi.
And I'm here to answer that question
and explain the difference between the two with plenty of examples.
My short answer is that Raspberry Pi and other single board
computers are akin to the computer in your touchscreen phone or tablet.
and Arduino and other microcontrollers
are akin to the computer inside your coffee machine or kid's toy.
Single board computers have processing power that is two orders
of magnitude larger than that of most microcontrollers.
Microcontrollers are single threaded processors,
which means they can only do one thing at a time.
They can't multitask.
They're not as powerful as single board computers, but they don't have to be.
Microcontrollers are purpose-built
to handle real time operations, and they're great at it.
Arduino is just one microcontroller platform,
but it is a very popular one for hobbyists.
Likewise, Raspberry Pi isn't the only single board computer.
Just the most famous one.
Here's a beagle bone, for example.
The more complex
circuitry is capable of running a full on operating system.
The OS manages the applications running concurrently on the system,
interfacing with the user file management, etc.
You've likely heard of operating systems like Microsoft Windows,
Mac OS Linux, iOS and Android.
Generally, single board computers are great for projects that need to drive
video displays, playback audio and listen for user input all at the same time.
For instance, a mini arcade cabinet is a popular Raspberry Pi project
where you need the display to update and the input controls
to be registered fast enough
to play the games on a console emulator that is also running in the background.
By contrast, smaller battery powered devices that have simpler or zero graphics
are better off with microcontrollers.
An Arduino can run one simple game;
A Raspberry Pi can emulate each of your favorite gaming systems
and all of the games that run on them.
Both have digital GPIO pins.
But if you want to use analog inputs, consider a microcontroller first.
Raspberry PI's inputs are only digital, so you would need
additional hardware for interfacing with analog sensors.
For instance, my webcam privacy project uses
a potentiometer, a button, and a micro servo.
So a low cost microcontroller is the best option.
Anything more would just be overkill.
It's not about which one is better, but which one is more suited
to your specific project, budget, and also your prior experience.
For instance, if you're already a Linux systems administrator,
I would encourage you to use your existing software
skills to build Raspberry Pi projects and gradually add more electronics
along the way.
if you're new to programing or working with kids,
you might prefer one of the blocks coding compatible
microcontrollers like the Micro:bit or Circuit Playground.
it's easiest to highlight
the most extreme differences between these various hardware approaches.
But to be honest, the overlap area between the two has never been larger.
If you saw my previous episode,
you know there are sophisticated sensor modules
that can take on some of the complex computing these days,
leaving only the output functions for your microcontroller.
to make things even more confusing.
Raspberry Pi has made a microcontroller the RP 2040, a.k.a.
Raspberry Pi Pico.
And lots of other microcontroller brands
have made boards with the RP2040, including Arduino.
So here are some examples to demonstrate the difference.
Are you controlling LEDs and not a whole lot else?
Microcontroller.
Are you controlling LEDs and not a whole lot else?
Smart Mirror? SBC.
Web Server?
Up until recently, only computers, but some Wi-Fi microcontrollers
like the ESP-32 can also do some sophisticated web stuff these days,
like report your weather station sensor values to the cloud.
A weather station is a use case where either a computer or a microcontroller
could do the job, depending on the specific features you want.
And what seems most approachable to you.
Computers generally use more power than microcontrollers,
so if battery power is important to you, that fact may influence your decision
to use one over the other.
Raspberry Pi wants a steady and beefy USB power supply to keep itself running.
While Arduino boards can be far more flexible with their power requirements
and draw much less current for the main included components
than a full computer does.
You might also consider the available online community
resources for the project you are trying to build.
Finding some open source library for that specific API
you want to use might influence you to use the platform that supports it,
and that's okay.
So my advice is to make a list of the features you want for your project,
research each one,
then look at your results to help you decide which type of hardware
you will proceed with to build your project.
Knowing there is plenty of support for whichever you choose.
I've put links to some resources in the description.
Leave your advice about when to use a microcontroller
or single board computer in the comments.
So we can all learn together.
Check out the playlist with the rest of the series and subscribe
so you don't miss the next one.