I’m a Software Engineer, why should I care about Arduino?
Getting Started with Hardware Programming is actually Easier Than You Thought! Raspberry Pi, Arduino, What’s between them and Why it Matters
It turns out that the fusion between software and hardware is what they sought after. More specifically, they wanted to make a case for why it is beneficial (and fun) for programmers (like me) to get their hands “dirty” with hardware. It was my friend Demi Ben-Ari who made the connection (thanks Demi! 🙏), and as they really loved the Real-Life version of Chrome T-Rex game, they decided to invite me to record this episode with them.
Show me your Arduino
Arduino has become a buzzword. Many people use it as a generic term for a “programmable hardware board”, or more technically, any electronic board that contains a MicroController, a small processor that can be easily interfaced with other electronics and hardware.
Let’s get this straight first — Arduino is actually a brand of boards, with the most popular one being Arduino Uno (to make things more confusing, there’s Genuino Uno, which is the same thing, but with a different name), and also a development environment that lets you program the Arduino boards, as well as hundreds of other boards. So Arduino is both the name of a specific brand of boards, and a software that programs these boards, as well as a set of standard library functions and convention that are built into these environment.
The Raspberry Pi 🥧
Another very popular device you have probably heard of is the Raspberry Pi. The Pi is actually a full computer — It has an HDMI output that you can connect to a monitor, USB ports (so you can easily connect a keyboard, mouse), Ethernet, WiFi, Bluetooth and it runs an fully fledged operating system — Linux being the most popular, but it can also run Android and Windows 10 IoT.
This is a good place for a good comparison between the Pi and the Arduino Uno. The Uno has the computing power of 80ties computer, yet it is cheaper, much more power efficient, and can easily interface with more types of electronic sensors and hardware. It doesn’t run any operating system, just your code on the “bare-metal”, meaning that you have pretty much complete control over the environment and can use it for things that require very accurate timings.
The Raspberry Pi, on the other end, is much more capable, it can do much more heavy duty stuff such as image and video capture and processing, deal with tasks like speech recognition or machine learning, and can take advantage of existing software libraries such as OpenCV or TensorFlow. Yet it is much more power hungry, and you have the operating system that can interfere with your code and even pose a security risk (if you set up the OpenSSH server and forget to change the default password, for instance).
I like to place these devices on the two ends of a scale — the small, simple, cheap, and power efficient Arduino Uno on one end, and the fully-fledged, power-hungry Raspberry Pi computer on the other end. I tried to give you the gist of the differences, but you can easily find more information online, for instance in this comparison table I once made.
You don’t tawk C++? Assembly?
When developers hear about hardware programming (or, as it is sometimes called, Embedded Programming), they usually immediately think of writing low-level code in C or even assembly. This used to be true for a long time, but today this is no longer the case.
Hello World, Who’s afraid of soldering?
If you never held a soldering iron, no worries — you can get a pretty good mileage with electronics without even touching a soldering iron. The “Hello World” program of Arduino is simply blinking an LED, and since the Arduino Uno has one built-into the board, you can get this “Hello World” up and running in less than 5 minutes. Programming the Arduino is as simple as connecting it to the computer with a USB cable and pressing a single button in the software to upload your code.
But what if you want to build something more complex? connect some sensors, LEDs, speakers, whatever?
There is a simple piece of hardware called “Breadboard” that got you covered. It allows you to prototype and make electrical connections by simply plugging in components and jumper wires — no soldering required, and it is super-easy to change the connections whenever you like.
When you deal with electronics, you usually deal with low voltages, typically 5 volts or below (at times 12V, but usually not much higher). These voltages are considered safe (unless you do stupid things like try to pass them directly through your heart for several minutes — don’t do that! 💔). When you deal with smartphone chargers or plug something into your car’s cigarette lighter socket, you deal with similar voltages, yet most of us do it regularly. So touching electronics with your hands is safe.
Dealing with mains, or any device that connects to mains and operates on 110VAC or 220VAC is extremely dangerous, can kill you, and can also cause fire hazards. So do stay away from these devices, and don’t try to fix broken power supplies / transformers, unless you have appropriate training.
So why should you care about Arduino?
I meet many makers. Some of them have no background in software, and after they learned to design and 3D Print parts and models, and wire some basic electronic circuits, they eventually want to make something more sophisticated. Like a T-Shirt that can be controlled from a Slack chat. Then they suddenly have to learn programming — it usually starts with some basic Arduino code, but quickly gets complex when you add control-flow, functions, string manipulation and 3rd-party libraries into the mix.
For you, learning Arduino (or Raspberry Pi) is so much simpler — you already have the core skill of programming. It allows you to reuse your existing knowledge and experience and extend it to a new platform, giving you new capabilities. Working with electronics and programming it teaches you how things work behind the scenes — without many of the abstraction layers imposed by operating systems and platforms such as Android, iOS or the web. It gives you new tools and perspectives, like debugging with LEDs (to indicate the presence or absence of signals), in place of the debug prints (or
console.log) you are used it.
Working with Electronics also improves your ability to plan ahead and conduct a comprehensive research. While programming, you can usually import new 3rd party libraries and components just by running a simple command and waiting for them to download. When dealing with hardware, adding a new chip, board or an extension module requires paying for them and waiting days or weeks until they ship to you. So you have to learn to plan ahead, and do your homework before you start writing code.
Go ahead, give it a try — I’m sure you will surprise yourself!