Before we get started with the schools, let's understand why.
Why use both Raspberry Pi and Arduino?
And why not just Raspberry Pi, all just Arduino?
In this video, I would explain this to you with a practical mindset so you can start with a better
understanding which will help you throughout the course.
Use the first.
And maybe the biggest difference is that Arduino is run by a microcontroller, whereas the Raspberry
Pi is run by a microprocessor.
So the microcontroller on the Arduino is quite simple.
It's going to run just one program at the maximum speed capacity.
That's it.
On the Raspberry Pi, you have a microprocessor, which is something completely different.
A microprocessor is what you also have on your computer, on your phone, etc. You usually install an
operating system on it and then you can run many programs to do many different things.
If you compare the specs on the microcontroller, Arduino, Uno and the microprocessor on the Raspberry
Pi four.
Well, there is a world of difference.
But and that's what we're going to see now with those specs and a few more details.
I'm going to add later.
You will see that the Arduino is better suited for controlling hardware components in the Raspberry
Pi is better suited for software applications with more processing power.
Now, you might say, well, there are some applications that you can do with either an Arduino or Rutenberg
by, for example, if you try to control an eddy with a push button.
This can be done with both modes with the same result.
So, yes, for a few applications, both modes are going to overlap.
And for both kinds of applications, there is no right or wrong solution.
Now, let's focus on what the Arduino can do better than the Raspberry Pi.
First, there are some hardware functionalities that are only possible with aluminum.
The GPIO panel on the Raspberry Pi is great, but quite limited when you compare it to the pins on the
Arduino, for example, only with Arduino.
You can read from an analog sensor that can be a potential meter, a photo resistor, etc. There is
no way to do that directly with the Raspberry Pi.
Also, some of the pins have a P.W. in functionality, which very basically allows you to send a custom
voltage to a component instead of just, for example, zero and five volt on Arduino B. The value is
native and is handled by the hardware, which means that it's not going to take away any software resources
on the Raspberry Pi.
You could use P.W in, but this is not a hardware one.
This is a software Peter Godwin, which means that it's going to take resources from your CPU, and
it's maybe not going to be as stable as on the Arduino.
Then the adeno is best suited to control models.
And one additional thing here, which is quite important, is the capability to respect real time constraints.
So what is the real time constraint?
Let's use an example here.
So let's say that you are controlling a model and you need to give a command to the model every 20 microseconds.
If you fail to give the next command before 20 microseconds, the model will not behave very smoothly.
So we are, you know, no problem because of the nature of the microcontroller is just running one per
run.
And it's what we call deterministic, which means that you know exactly how long a command will take
to execute every time.
So if you write your code well, you can respect the 20 microseconds delay every time.
On the Raspberry Pi, things are completely different.
The operating system you are running has a scheduler for all the tasks the scheduler will try its best
to make all the tasks run as smoothly as possible, but it can't guarantee that one particular program
is going to respect exactly 20 microseconds between each command sense.
If, for example, another independent program is taking too much resources, then the first program
which controls your model is going to slow down.
And that's a problem, especially when you control physical hardware components.
So in this course of activities and project, we won't have to deal with this real time constraint.
But I wanted to explain it briefly here so you can understand that it's a very important parameter which
you will need to take into account for some of your future project.
All right.
You can already see that the Ardoino is superior to the Raspberry Pi for quite a few things that are
related to hardware control.
Now, let's give a chance to the Raspberry Pi and see when it is better than the Arduino on the Raspberry
Pi.
You get a complete operating system, for example, Linux with the Raspberry Pi OS, and you can install
many more OS.
For example, you went to Android and even some editions of Windows, if you want to, with a complete
operating system will.
Instead of running just one program, you can see that we have a world of possibilities that are not
available on the Arduino, on the Raspberry Pi.
You can program with C++, but also with Python, which we are actually going to do in this course.
In fact, you could use any programming language you want and know a few more examples.
With Raspberry Pi, you can control a camera, for example, the Pi camera or any USB camera, a webcam
that you just need to plug in.
And do that, you can add computer vision, artificial intelligence with machine learning, etc. You
can also host a complete web server if you want to.
And well, on the Raspberry Pi, basically, you can just run many different applications and programs
simultaneously with scaling and multithreading.
Multi-threading is super powerful.
And it's something that doesn't exist on the original.
Well, now, you know, by writing your code, well, you can kind of fake it and create a multitask
program, but nothing to see what you can do with the Raspberry Pi.
OK, I'm going to stop here because the list could go on and on and on forever.
But what you can see here is that the Raspberry Pi is superior to the Arduino when it comes to software.
To recap, Arduino is better for hardware, low level control and Raspberry Pi is better for application
software, a high level of control.
So depending on your project, maybe you just need one bolt.
If your application is to take some photos, process them and publish them on a web page, then just
go with a Raspberry Pi.
If, however, you want to just open the door with a model when you detect a prison nearby, Arduino
will do 100 percent.
But if you need to combine both hardware control and high level software applications, then why not
use the best of both worlds?
And use the combination Raspberry Pi and Arduino with this combination?
You can do a much more complete and complex project by taking advantage of each board supermajority.
That's what we're going to do in the intercom project, where we will use the Raspberry Pi to handle
a Telegram bot and take some photos.
And the Arduino to control has several model as well as other hardware components that use, for example,
P.W. In the Raspberry Pi, you will send commands to the Arduino, and Arduino will also send some data
back to the Raspberry Pi.
And you may not be aware of it, but this combination of microprocessor plus microcontroller is actually
used everywhere.
If you have a phone, a computer, a TV, well, all of them are using a microprocessor on the main
software control.
And then this microprocessor is connected to many microcontrollers, which are handling the hardware
a small robotic example.
Maybe if you take a mobile robot with autonomous navigation, well, you would have a microprocessor
to handle localization, how you live in motion planning, image processing, etc. and you have some
microcontrollers to control the wheels with real time constraints and also get data from different sensors.
To conclude, you can see the Raspberry Pi microprocessor and the brain of your application and Arduino
or microcontroller as the muscles of your application.
All right.
Now that you have a better understanding of the big picture, you are ready to start the course.