December 4, 2020

Arduino and Raspberry Pi Friend or Foe

Authored by Udayan C. & Team

It has been years that debates are prevalent between things which are similar, but sometimes there are no clear-cut results of those debates. For instance, take the case of Windows vs. Mac - no one can clearly tell that one is greater than other, as both have advantages as well as disadvantages over another. Likewise Arduino and Raspberry Pi are two frenemies which are always compared when it comes to IOT(Internet of Things) projects.

I personally was introduced to Arduino while I was in my 7th Standard/Grade. We were given a project to make a car out of anything that we like, when searched on YouTube, I found about Arduino and that was my first project with Arduino. It was actually fun to work with and I still work with Arduino. I recently started a Robotics Workshop and Robotics club, where I display my fancy projects.

To begin with - Arduino is software and hardware that can be used to make cool stuff at home all you need to know is basic C++. Though Arduino has its own language still knowing basic C++ helps in understanding and proper implementation of the code.

Arduino Unp
Arduino Uno

Raspberry pi is something that I was introduced to just a few months back. I took part in a hackathon and I saw some very awesome projects, where I found that a group made a robotic arm using this. I am still waiting for my first raspberry pi project.

Raspberry pi 4 Model B
Raspberry pi 4 Model B

What actually they are according to me:-

The Raspberry Pi is pretty much a standalone computer in the form of a credit card you've got. A system on chip, which has your CPU. Now there's plenty of other Arduino boards out there but we chose Arduino because it's the most popular one. It's co-opted either 8 or 16 megahertz and when you compare, that megahertz took me 1.2 gigahertz. You might wonder why anyone would want to use an Arduino, but it's not as clear-cut, since the main difference is a microprocessor versus a microcontroller. Now the Raspberry Pi is a computer, so you're running an operating system on the SD card. There's so many different layers of software, that has to boot up,  to run software for pretty desktop and graphic user interfaces. That comes at a cost of power, which is why it like - modern computers have so much processing power.

Raspberry Pi Zero
Raspberry Pi Zero

Now the Arduino has a microcontroller which is what you call more of a bare metal approach. So it's not a self-contained computer, if you want audio or video you have to have extra circuitry to enable it. You've only got a USB port which is for serial communication to the computer and you need a computer to upload code onto your Arduino. You can't write your own code in it like you can with the Raspberry Pi, so things are tilting a bit towards Raspberry Pi. But to understand it better, we need to get a little bit deeper.

With the Raspberry Pi, if you want to use the GPIO pins and you want to turn an LED on or off - you can't just program the chip just to do that. You must have an operating system which boots up and loads all these different layers of software. Then I have to open another application, write the code that tells all these different software layers. I've got my code filter through, until it gets to the direct access of the pins on the processor. Then I can access those and that takes time, even though you can't really recognize the time it takes processing power.

I'm writing a set of instructions which get converted into ones and zeros onto the chip, where I'm controlling every function in every feature directly. If I tell this pin to output a high signal it's going to output a high signal exactly as I tell it in that code - it does nothing more or nothing less. So there are some of the key differences. Here is a table and a graph below, explaining about the differences between a microprocessor and a microcontroller.


Hardware Vs Software:

  1. My takeaway is if you want to get into software, you want to learn about Linux, coding and web interaction. Raspberry Pi is going to be your go to as it supports heaps of different programming languages. You can customize it as a computer to whatever needs you want.
  2. If your project is hardware and say using a lot of sensors and interacting with the real-world, a really low level with hardware  - the Arduino or a similar platform is going to be your go-to. You can control all these pins directly, through the registers on this chip as easy as a single line of code. You can upload that and away you go

Something to think about - they're definitely different platforms altogether and it's not a case of one being better. You now got a bit more of an idea about the differences, some contrasts and comparisons between Raspberry Pi and Arduino.

My Arduino Project pic

Start your project:

The best way to start a project is making a small design and also start with something basic - For instance, a car. There are millions of videos available and one can take those as references to build something. My first Arduino project was also a car that I built on a standard size CD. Here is a small picture of it.

Conclusion:-

Both Arduino vs Raspberry Pi  possess advantages and disadvantages on one another with their own great qualities.

  1. If someone is building a project which involves several functionalities at the same time, requires easy access to the Internet and also needs media accessibilities, then Raspberry Pi 3 will be a perfect choice.
  2. If someone is building a project that requires easy reads from easier to connect to analog sensors and expecting to do only a few outputs based on the sensor data, communicates easily with other machine parts, etc. then Arduino is a good choice too.

I would also like to share that other than these two, there are numerous such gadgets to work with. Some are like the Banana pi, Beaglebone Black, etc. For now it is these two that I have explored and I believe there are some potential substitutes that might replace Arduino soon.


References:

  1. Administrator, Says, J., Jony, Says, M., Mark, Says, R., . . . Schirmer, B. (2017, December 25). What are the differences between Raspberry Pi and Arduino? Retrieved September 09, 2020, from https://www.electronicshub.org/raspberry-pi-vs-arduino
  2. Arduino vs Raspberry Pi: How to Choose the Right Board. (2019, September 03). Retrieved September 09, 2020, from https://all3dp.com/1/arduino-vs-raspberry-pi/
  3. Arduino vs Raspberry Pi: Which is the best Board? [Updated]. (n.d.). Retrieved September 09, 2020, from https://hackr.io/blog/arduino-vs-raspberry-pi-beginners-guide
  4. Home. (n.d.). Retrieved September 09, 2020, from http://www.arduino.cc
  5. M. (2020, March 06). Arduino Uno or Raspberry Pi 3 - How to Decide. Retrieved September 10, 2020, from https://www.arrow.com/en/research-and-events/articles/comparing-arduino-uno-and-raspberry-pi-3
  6. Teach, Learn, and Make with Raspberry Pi – Raspberry Pi. (n.d.). Retrieved September 09, 2020, from https://www.raspberrypi.org/