Arduino Nano architecture and Arduino GUI

Overview

Teaching: 0 min
Exercises: 0 min
Questions
  • What is a microcontroller?

  • What is an Arduino Nano?

  • Why using Arduino GUI?

  • How to install Arduino GUI?

  • How to program an Arduino Nano with Arduino GUI?

Objectives
  • Learn about Arduino Nano

  • Install Arduino GUI

  • Test Arduino Nano

What is a microcontroller?

The easiest way to understand what is a microcontroller is to think about a tiny computer: it includes a processor, memory and input/output (I/O) peripherials to connect small display, buttons, motors, sensors, etc. To “control” a microcontroller, you can put programs onto it and run them. As we will see later in this lesson, we usually write programs using a laptop and then transfer the programs into the microcontroller to execute it.

A microcontroller can look like this:

Example of microcontroller (Arduino Nano)

i.e. very much like what we call an “integrated circuit”.

Look for instance at what we see when we zoom in the previous picture:

part of an Arduino Nano

A typical microcontroller includes a processor, memory and input/output (I/O) peripherals.

What is an Arduino Nano?

Arduino Nano architecture

An Arduino Nano is a very tiny and simple microcontroller:

Arduino Nano microcontroller with Arduino CC box

Source: https://store.arduino.cc/arduino-nano

Arduino Nano

On the picture above, the Arduino Nano block is where the processor and memory are located. The rest ensures communication with external sensors, USB port, voltage regulator, etc.

For those interested in computer architecture, have a look at the functional diagram of an Arduino Nano:

Arduino Nano architecture

Source: https://www.arduino.cc/en/uploads/Main/ArduinoNano30Schematic.pdf

As any other microcontroller, Arduino Nano has a set of GPIO pins (General Purpose Input(Output pins) that we can use to “control” external sensors.

Our Arduino Nano has 14 digital pins that can be used as an input or output. They operate at 5 volts. However, some pins have specialized functions:

The Arduino Nano also has 8 analog inputs (to convert a voltage level into a digital value that can be stored and processed in the Arduino Nano).

Why using Arduino GUI?

Unlike other microcontroller, Arduino Nano is such a tiny microcontroller that using the Arduino IDE is currently the only viable way to program it.

The Arduino IDE has a simple interface with many built-in examples.

Arduino desktop IDE

How to install Arduino Desktop IDE?

You can use the online Arduino IDE (https://create.arduino.cc/) and for this you would need to register first. However, using the online version requires an internet connection and also may not work when using other microcontrollers (such as ESP8266, ESP32, etc.). For these reasons, we think it is important to learn to install Arduino Desktop IDE on your laptop.

  1. Download Arduino Desktop IDE at Arduino Software
  2. Choose and click on the corresponding distribution depending on your Operating System (Windows 7, Windows10, Linux 64 bits, etc.)
  3. Click on “JUST DOWNLOAD” and follow instructions given
  4. If you do not have administrator rights, download the “Windows ZIP file for non admin install” and unzip it to the desired location.
  5. Start Arduino Desktop IDE (if it does not start automatically or you don’t find the Arduino IDE shortcut, click on arduino.exe)

How to program an Arduino Nano with Arduino GUI?

Verify that the Arduino Nano board is functionning

connect Arduino nano to your mini USB cable

Select Arduino Nano board

Select Port

Finally you need to select the port (physical USB connector on your computer) to tell the path where the board is physically plugged in your computer.

Arduino Nano select port

Arduinon Nano selected port

Name of the port

On a windows computer, ports are name such as “COM3”, “COM5”, “COM6”, etc. but the naming convention is different on Linux or Mac OSX

Run our very first program

As our very first program, we will blink the built-in led.

Arduino Nano blink example

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/Blink
*/


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_PIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(2000);                       // wait for a second
}

Arduino Nano blink execution

Tips on Arduino Desktop IDE

Arduino IDE information

Tips on Arduino IDE language and code structure

  • Comments // (like in C++)
  • setup (void setup()) is executed once only
  • loop (void loop()) is a function that runs forever (quit arduino IDE to stop it).

Key Points

  • Arduino Nano Architecture

  • Arduino IDE