Arduino Microcontrollers

The complete guide to Arduino boards - from beginner projects to advanced applications

Arduino Uno

What is Arduino?

Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online.

  • Simple IDE: Easy-to-use programming environment based on Processing
  • Cross-platform: Runs on Windows, Mac OS X, and Linux
  • Open Source: Both hardware and software are open source
  • Large Community: Massive support from makers worldwide
  • Plug-and-play: No need for external programmers (in most cases)
  • Beginner Friendly: Perfect for those new to electronics and programming
  • Versatile: Can be used for simple to complex projects
  • Affordable: Much cheaper than many other microcontroller platforms
  • Expandable: Huge ecosystem of shields and add-ons
  • Educational: Used in schools and universities worldwide
  • Prototyping: Quickly test ideas before final implementation
  • Home Automation: Control lights, appliances, and security systems
  • Robotics: Power brains of robots and automated systems
  • IoT Projects: Connect devices to the internet (with WiFi/Bluetooth boards)
  • Art Installations: Create interactive art and exhibits

Arduino Board Types

Arduino offers a wide range of boards with different specifications for various applications. Here are the most popular Arduino boards:

Arduino Uno

Arduino Uno R3

The standard board for beginners with all the basic features

ATmega328P 16MHz 32KB Flash 14 Digital I/O 6 Analog
Learn More
Arduino Mega

Arduino Mega 2560

More I/O pins and memory for complex projects

ATmega2560 16MHz 256KB Flash 54 Digital I/O 16 Analog
Learn More
Arduino Nano

Arduino Nano

Compact version of the Uno for space-constrained projects

ATmega328P 16MHz 32KB Flash 22 Digital I/O 8 Analog
Learn More
Arduino Due

Arduino Due

32-bit ARM core for advanced applications

ATSAM3X8E 84MHz 512KB Flash 54 Digital I/O 12 Analog
Learn More
Arduino Leonardo

Arduino Leonardo

Built-in USB communication for HID devices

ATmega32U4 16MHz 32KB Flash 20 Digital I/O 12 Analog
Learn More
Arduino MKR

MKR Series

IoT-focused boards with various connectivity options

SAMD21 48MHz 256KB Flash 8 Digital I/O 7 Analog
Learn More

Arduino Board Comparison

Compare the specifications of different Arduino boards to choose the right one for your project:

Board Microcontroller Clock Speed Flash Memory Digital I/O Analog Inputs PWM USB
Uno R3 ATmega328P 16 MHz 32 KB 14 6 6 Standard
Mega 2560 ATmega2560 16 MHz 256 KB 54 16 15 Standard
Nano ATmega328P 16 MHz 32 KB 22 8 6 Mini
Due ATSAM3X8E 84 MHz 512 KB 54 12 12 Micro
Leonardo ATmega32U4 16 MHz 32 KB 20 12 7 Micro (HID)
MKR1000 SAMD21 48 MHz 256 KB 8 7 12 Micro (WiFi)

Arduino Uno R3

The Arduino Uno is the most popular board in the Arduino family and a great choice for beginners. Here's everything you need to know about it:

Uno R3 Pinout Diagram

Arduino Uno Pinout

Pin Functions

Pin Function Description
0 (RX), 1 (TX) Serial Communication Used for programming and serial communication
2, 3 External Interrupts Can trigger interrupts on change, rising, or falling
3, 5, 6, 9, 10, 11 PWM Output Analog output using pulse-width modulation
10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK) SPI Communication Used for SPI communication with peripherals
A4 (SDA), A5 (SCL) I2C Communication Used for I2C communication with sensors
A0-A5 Analog Input 10-bit ADC inputs (0-5V)
5V, 3.3V Power Output Provide regulated power to components
GND Ground Common ground for circuits

Programming the Arduino Uno

The Arduino Uno is programmed using the Arduino IDE, which is based on C/C++. Here's a simple example sketch:

void setup() {
    // Initialize digital pin LED_BUILTIN as an output
    pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
    // Turn the LED on (HIGH is the voltage level)
    digitalWrite(LED_BUILTIN, HIGH);
    // Wait for a second
    delay(1000);
    // Turn the LED off by making the voltage LOW
    digitalWrite(LED_BUILTIN, LOW);
    // Wait for a second
    delay(1000);
}

Power Options

The Arduino Uno can be powered in several ways:

Advanced Arduino Concepts

Once you've mastered the basics, these advanced concepts will help you take your Arduino projects to the next level:

Interrupts

Interrupts allow the Arduino to respond immediately to important events while performing other tasks:

volatile int state = LOW;

void setup() {
    pinMode(13, OUTPUT);
    attachInterrupt(0, blink, CHANGE);  // Interrupt on pin 2 (interrupt 0)
}

void loop() {
    // Main program continues to run
}

void blink() {
    state = !state;
    digitalWrite(13, state);
}

Low Power Modes

Reduce power consumption for battery-powered projects:

// Put Arduino to sleep and wake on interrupt
#include <avr/sleep.h>

void setup() {
    pinMode(2, INPUT_PULLUP);
    attachInterrupt(0, wakeUp, LOW);
}

void loop() {
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);
    sleep_enable();
    sleep_mode();  // Arduino sleeps here
    // Execution resumes here after wake-up
    sleep_disable();
    // Do something after waking
}

void wakeUp() {
    // Just a handler for the interrupt
}

Memory Management

Optimize memory usage for complex projects:

Using External Libraries

Extend Arduino functionality with libraries:

// Example using the Adafruit NeoPixel library
#include <Adafruit_NeoPixel.h>

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number
// Parameter 3 = pixel type flags
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, 6, NEO_GRB + NEO_KHZ800);

void setup() {
    strip.begin();
    strip.show();  // Initialize all pixels to 'off'
}

void loop() {
    // Some example procedures showing how to control the strip
    colorWipe(strip.Color(255, 0, 0), 50);  // Red
    colorWipe(strip.Color(0, 255, 0), 50);  // Green
    colorWipe(strip.Color(0, 0, 255), 50);  // Blue
}