Complete Guide to Arduino

Types, Differences, Uses, Examples & When to Use What

Arduino is an open-source microcontroller platform that made electronics accessible to everyone. Explore every board, pin, code example, and real-world application in this comprehensive vertical guide.

1. What is Arduino?

Arduino is an open-source microcontroller platform used to build electronics and embedded systems.

It was created by the Arduino team to make electronics easy for students, hobbyists, and engineers.

Unlike a computer, Arduino does not run an OS.
It runs one program at a time (firmware).

2. Arduino vs Raspberry Pi

Feature Arduino Raspberry Pi
TypeMicrocontrollerSingle-board computer
OS No Operating System Runs Linux
ControlReal-time controlMulti-tasking
PowerLow powerHigher power
Best ForSensors / MotorsAI / Web / Server

Use Arduino for:

  • Sensors
  • Motors
  • Robotics
  • Real-time control

Use Raspberry Pi for:

  • AI
  • Camera
  • Web server
  • GUI apps

3. Major Arduino Board Types

Arduino UNO (Most Popular)

Specs

  • ATmega328P
  • 14 Digital Pins
  • 6 Analog Pins
  • 16 MHz
  • 5V logic
Best for beginners
Best for learning basics

Arduino Nano (Small Size)

  • Same chip as UNO
  • Smaller size
  • Breadboard friendly
Best for compact projects

Arduino Mega 2560 (More Pins)

  • 54 Digital Pins
  • 16 Analog Pins
  • More memory
Best for big robotics projects
Multiple sensors & motors

Arduino Leonardo

  • Built-in USB communication
  • Can act as keyboard/mouse

Arduino Due

  • 32-bit ARM processor
  • Faster
  • 3.3V logic

Arduino ESP8266 / ESP32

  • Built-in WiFi
  • Built-in Bluetooth (ESP32)
  • More powerful
  • 3.3V logic
Best for IoT projects
Smart home
Cloud-connected devices

4. Understanding Arduino Pins

Arduino has different types of pins for different purposes:

Digital Pins

HIGH (5V) or LOW (0V)
Used for LED, relay, buttons

Analog Pins

Read voltage (0–1023 value)
Used for sensors

PWM Pins

Control motor speed
Dim LED brightness

Communication Pins

UART (Serial)
I2C
SPI

5. How Arduino Works

1
Write code in Arduino IDE
2
Compile the code
3
Upload via USB
4
Microcontroller runs program continuously

6. Example: LED Blink

Circuit

Pin 13 → LED → Resistor → GND

Code

Arduino C++
void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
}

7. Example: Temperature Sensor (LM35)

1
Sensor → Analog Pin A0
2
Read voltage
3
Convert to temperature
4
Print in Serial Monitor

8. Where to Use Arduino?

Robotics

  • Line follower robot
  • Obstacle avoidance robot

IoT Devices (ESP32)

  • Smart home automation
  • Cloud monitoring
  • Temperature logging

Industrial Control

  • Motor control
  • Automation panel
  • Relay switching

Medical Prototypes

  • Pulse sensor
  • SpO2 sensor
  • ECG sensor
  • IV fluid monitoring alert
Since you're into medical devices — Arduino is excellent for:
  • Rapid prototyping
  • Sensor testing
  • Data acquisition

9. Arduino Programming Structure

Arduino C++
void setup() {
  // Runs once
}

void loop() {
  // Runs forever
}
Simple and powerful. setup() initializes, loop() repeats endlessly.

10. Voltage Levels (Very Important)

Board Logic Voltage
UNO5V
Nano5V
Mega5V
ESP323.3V
Due3.3V
Never connect a 5V signal to a 3.3V board — it will damage the board!

11. Arduino vs ESP32 vs STM32

FeatureArduino UNOESP32STM32
SpeedLowMediumHigh
WiFi No YesSome
CostLowLowMedium
Industrial UseMediumIoTAdvanced systems

12. Arduino Shields (Add-on Boards)

Plug-and-play expansion boards.

Motor Shield
WiFi Shield
GSM Shield
LCD Shield
Ethernet Shield

13. Powering Arduino

14. Common Mistakes Beginners Make

No resistor with LED
Wrong voltage
Short circuit
Not common ground

15. Real World Example Systems

Application Board Used
Smart irrigationArduino UNO
Drone flight controllerSTM32
SmartwatchESP32
Industrial PLC alternativeArduino Mega
IoT medical monitoringESP32

16. When to Choose What?

Choose Arduino UNO if:

  • Learning basics
  • Simple sensors
  • College project

Choose ESP32 if:

  • Internet required
  • Cloud dashboard
  • Mobile app connection

Choose Mega if:

  • Many sensors
  • Large robotics