UIU Robotics Club Logo
Arduino Beginner Guide
December 20, 2025
A
Arpon

Arduino Beginner Guide

Arduino Beginner Guide (Complete)


1. What is Arduino?

Arduino is a small programmable electronic board.
You write code on a computer and upload it to the board.
The board then controls electronic parts like LEDs, sensors, motors, etc.


2. Arduino Uno Pins Explained

::contentReference[oaicite:0]{index=0}

Digital Pins (0–13)

  • Used for ON / OFF
  • Output values:
    • HIGH = 5V (ON)
    • LOW = 0V (OFF)
  • Used for LEDs, buzzers, relays
  • Pin 13 has a built-in LED

Analog Pins (A0–A5)

  • Used to read sensor values
  • Value range: 0 to 1023
  • Example: temperature sensor, light sensor

Power Pins

Pin Purpose
5V 5V output
3.3V 3.3V output
GND Ground
VIN External power input

3. Arduino Program Structure

Every Arduino program has two main functions:

void setup() {
  // runs once
}

void loop() {
  // runs forever
}

Explanation

  • setup() Runs one time only Used to configure pins

  • loop() Runs again and again Used for main logic


4. Built-in LED (Pin 13)

Arduino Uno has a built-in LED connected to pin 13. No wiring needed.

Code

void setup() {
  pinMode(13, OUTPUT);   // set pin 13 as output
}

void loop() {
  digitalWrite(13, HIGH); // LED ON
  delay(1000);            // wait 1 second
  digitalWrite(13, LOW);  // LED OFF
  delay(1000);            // wait 1 second
}

5. External LED Using Digital Pin

Image

Image

Components

  • LED
  • 220Ω or 330Ω resistor
  • Breadboard
  • Jumper wires

Wiring

  • LED long leg (+) → resistor → Digital pin (D7)
  • LED short leg (−) → GND
  • Resistor protects the LED

Code (External LED)

int ledPin = 7; // LED connected to pin 7

void setup() {
  pinMode(ledPin, OUTPUT);
}

void loop() {
  digitalWrite(ledPin, HIGH); // LED ON
  delay(1000);
  digitalWrite(ledPin, LOW);  // LED OFF
  delay(1000);
}

6. Important Functions

pinMode(pin, OUTPUT);    // set pin type
digitalWrite(pin, HIGH); // ON
digitalWrite(pin, LOW);  // OFF
delay(ms);               // wait

7. How Code Runs

  1. Arduino turns ON
  2. setup() runs once
  3. loop() runs forever
  4. Code repeats continuously

8. Arduino IDE Setup (External Guides)