> For the complete documentation index, see [llms.txt](https://monasheng.gitbook.io/zerotohero/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://monasheng.gitbook.io/zerotohero/arduino-zero-to-hero/introduction-to-arduino.md).

# Introduction to Arduino

{% embed url="<https://youtu.be/42V_Nsb-76c>" %}

This module will introduce you to the basics of *Arduino-based* MCUs. Arduino is a powerful but beginner-friendly platform for building electronic projects. It is open-source and focussed on easy integration of hardware and software.

{% embed url="<https://www.arduino.cc/>" %}
The official Arduino website is a wealth of information, with datasheets, tutorials, code documentation and a web store.
{% endembed %}

## The Arduino Platform

At it's core, *Arduino* consists of:

1. A range of programmable MCU boards with a range of Input/Output (I/O) functionalities for interacting with the real world, and,
2. An integrated development environment (the [Arduino IDE](/zerotohero/arduino-zero-to-hero/arduino-ide.md)) that runs on your computer and provides a place for you to write and upload code to your boards.

## Why Arduino?

Arduino is a natural place to begin when learning how to use microcontrollers. While not as powerful, integrated/compact, or robust as some industrial solutions, it provides 80% of these qualities with less than 20% of the complexity!&#x20;

Additionally, Arduino has become a defacto standard amongst makers, meaning that there is a wealth of documentation, tutorials, off-the-shelf software libraries, and compatible hardware available to support you as you are getting started.

{% embed url="<https://www.youtube.com/watch?v=7spK_BkMJys&list=PL1KVSZBJtW0pBFu379TuXztnFIB2rmctK&index=1>" %}
A playlist of practical Arduino tutorials - a good supplement to explore after completing this module. From: <https://www.youtube.com/watch?v=7spK_BkMJys&list=PL1KVSZBJtW0pBFu379TuXztnFIB2rmctK&index=1>
{% endembed %}

{% hint style="info" %}
:man\_mage: **Important:** Upon completion of this module, you will have a range of skills you can apply in your Arduino projects, and, when you're ready, extend to more sophisticated MCUs, like the [STM32](https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html), commonly used in industrial prototyping.
{% endhint %}

## Applications

With Arduino, you can control lights, motors, sensors, and other hardware components to build  engineering solutions to real-world problems. The possibilities really are endless, for example:

* Arduino is the perfect tool for prototyping **robotic systems**. With an Arduino MCU, you can ingest sensor data (e.g. distances using ultrasonics, or bumpers with switches), and drive motors and servos to move a robot around or actuate it's limbs.
* You can also build your own **smart home automations**. For example, by reading data from motion sensors and microphones, you could build an automated lighting system that turns lights on when you enter a room and off when you leave, or responds to a clap! You could also build a smart watering system for your plants that responds to soil moisture!
* Because some Arduino boards a very compact, they can also be used for **wearables/biometrics**. You could, for example, build your own fitness tracker that monitors a heart rate and counts steps, or a jacket with LEDs that light up in sync with your music.

{% embed url="<https://www.youtube.com/watch?v=0vr2Qu_AF7U&list=PL2GAS4vHuGW2J5XKKLlsezt-A9Ii96tau>" %}
A playlist of >100 Arduino projects. From: <https://www.youtube.com/watch?v=0vr2Qu_AF7U&list=PL2GAS4vHuGW2J5XKKLlsezt-A9Ii96tau>
{% endembed %}

## Arduino Hardware

A wide range of Arduino boards are available, and while they all function in essentially the same way, each is tailored for strength in a particular application. Note that [Arduino Programming](/zerotohero/arduino-zero-to-hero/arduino-programming.md) is essentially the same for all Arduino boards, and that tutorials for any one board can be applied to most others with no issues.

<figure><img src="/files/l1VoacsWFlKZhvfPXnxf" alt=""><figcaption><p>Some of the various Arduino boards available. Note the various form factors and additional features on some boards (e.g. built-in ethernet, WiFi, etc.). From: <a href="https://electronics-fun.com/comparison-of-arduino-boards/">https://electronics-fun.com/comparison-of-arduino-boards/</a>.</p></figcaption></figure>

### Arduino UNO

The 'default' Arduino board - the *UNO* - strikes a balance between functionality and compactness, and is likely what you'll see used in most tutorial videos on the internet. Because it is the most common, it is also what features in Arduino simulators, like [*TinkerCAD*](https://www.tinkercad.com/)*.* We will use TinkerCAD to show various examples throughout this module, and the Arduino UNO will feature in these.

<figure><img src="/files/zaLRV5QcNhqbjkJOU0kC" alt=""><figcaption><p>The Arudino UNO microcontroller. From: <a href="https://store.arduino.cc/products/arduino-uno-rev3">https://store.arduino.cc/products/arduino-uno-rev3</a></p></figcaption></figure>

### Arduino Mega

Some classes at Monash use the Arduino *Mega* - a physically larger MCU with a more expansive range of I/O pins. It is functionally an Arduino UNO on steroids, and most tutorials/images/gifs/simulations that apply to the UNO will equivalently apply to the Mega.

<figure><img src="/files/HKZz8JDErGENkjqetnpX" alt=""><figcaption><p>The Arduino Mega is the platform that this module is focussed on. From: <a href="https://store.arduino.cc/products/arduino-mega-2560-rev3">https://store.arduino.cc/products/arduino-mega-2560-rev3</a></p></figcaption></figure>

### Aftermarket/Third Party/Generic Boards

Because the Arduino hardware and software is open-source, there are many third-party/aftermarket "Arduino" boards available. [Jaycar](https://www.jaycar.com.au/kits-science-learning/mini-computer-boards/arduino/arduino-boards/c/4AA) (a local electronics store) sells the "Duinotech" line, for example, and in many cases these aftermarket boards function exactly the same as the first-party ones, usually at a significantly reduced cost.

<figure><img src="/files/BJtqofUbIJXYY9bCcixs" alt=""><figcaption><p>The generic Arduino Mega we provide to students. You can buy your own from <a href="https://core-electronics.com.au/mega-2560-r3-arduino-compatible.html">https://core-electronics.com.au/mega-2560-r3-arduino-compatible.html</a></p></figcaption></figure>

## Anatomy of an Arduino

The core features common to most Arduino boards are:

* A USB connector for temporary power provision, loading programs and communicating with a computer over serial,
* A DC Input Jack/Pin for in-situ power provision,
* An onboard Voltage Regulator to buffer a steady input voltage to the board,
* A range of Input/Output interface pins accessable via pin headers, and,
* Onboard LEDs for:
  * Power On,
  * Serial Communications Active, and,
  * User-programmable control.

<div><figure><img src="/files/D1qo9bHMsxgHAko89MQ6" alt=""><figcaption><p>Anatomy of an Arduino Mega</p></figcaption></figure> <figure><img src="/files/zQF2EKT22AM7zMIgsPg4" alt=""><figcaption><p>Anatomy of an Arduino Uno</p></figcaption></figure></div>
