The big picture: what is Arduino?
Arduino is an open-source electronics platform based on easy-to-use hardware and software. It is made for anyone making interactive projects — from blinking an LED to building a weather station or a robot.
At its heart, an Arduino board is a microcontroller: a small computer on a single chip that can read inputs (light on a sensor, a finger on a button) and turn them into outputs (activating a motor, turning on an LED, publishing data online).
You tell the board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring) and the Arduino Software (IDE), based on Processing.
The Arduino Uno R3
The most popular Arduino board is the Arduino Uno R3. Here is what the main parts do:
| Part | What it does |
|---|---|
| ATmega328P | The microcontroller chip — the "brain" of the board |
| Digital pins 0–13 | Can be inputs or outputs; read HIGH/LOW or write HIGH/LOW |
| Analog pins A0–A5 | Read analog voltages (0–5V) with 10-bit resolution |
| PWM pins (~, 3, 5, 6, 9, 10, 11) | Output pulse-width modulation to dim LEDs or drive servos |
| USB port | Connects to your computer for programming and serial communication |
| Power jack | External power input (7–12V recommended) |
| Reset button | Restarts your sketch from the beginning |
The Arduino IDE
The Arduino IDE (Integrated Development Environment) is where you write, compile, and upload code to your board.
Installing the IDE
- Download the Arduino IDE from arduino.cc.
- Install it like any other application.
- Connect your Arduino Uno to your computer via USB.
- Open the IDE and select:
- Tools → Board → Arduino Uno
- Tools → Port → COMx (Windows) or
/dev/cu.usbmodem...(Mac/Linux)
Your first sketch: Blink
Every Arduino program is called a sketch and has two required functions:
void setup() {
// Runs once when the board starts or resets
}
void loop() {
// Runs over and over again forever
}Here is the classic "Hello World" of hardware — blinking the built-in LED:
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN 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(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}What each line does
| Line | Meaning |
|---|---|
pinMode(LED_BUILTIN, OUTPUT) | Sets pin 13 as an output (sends voltage out) |
digitalWrite(LED_BUILTIN, HIGH) | Sends 5V to the pin — LED turns on |
delay(1000) | Pauses for 1000 milliseconds (1 second) |
digitalWrite(LED_BUILTIN, LOW) | Sends 0V to the pin — LED turns off |
delay(1000) | Pauses for 1 second |
Uploading your sketch
- Connect your Arduino Uno via USB.
- Select Tools → Board → Arduino Uno.
- Select Tools → Port and choose your Arduino's port.
- Copy the Blink code above into the editor.
- Click the Upload button (right arrow icon).
- The built-in LED on pin 13 should start blinking once per second.
How compilation works
When you click Upload, the Arduino IDE does three things:
- Compiles your C++ code into machine instructions for the ATmega328P microcontroller
- Links those instructions with the Arduino core libraries
- Uploads the binary to the board using a bootloader already installed on the chip
The bootloader is a small program that waits for new code when the board resets, then writes it to flash memory. This is why you do not need a separate hardware programmer.
The serial monitor
The Arduino IDE includes a Serial Monitor (magnifying glass icon) that lets you send and receive text between your computer and the Arduino over USB.
void setup() {
Serial.begin(9600); // Start serial communication at 9600 baud
Serial.println("Hello from Arduino!");
}
void loop() {
// nothing here
}Open the Serial Monitor, set the baud rate to 9600, and you will see "Hello from Arduino!" printed once.
Check your understanding
What are the two required functions in every Arduino sketch?
Which pin is the built-in LED connected to on an Arduino Uno?
Exercise: Blink at different speeds
Modify the Blink sketch so the LED blinks faster — once every 200 milliseconds instead of every 1000.
- Open the Blink example (File → Examples → 01.Basics → Blink).
- Change both
delay(1000)todelay(200). - Upload and observe the faster blinking.
- Try making an SOS pattern: three short flashes, three long flashes, three short flashes.
Summary
- Arduino is an open-source microcontroller platform for interactive electronics projects.
- The Arduino Uno R3 uses the ATmega328P microcontroller.
- Every sketch has
setup()(runs once) andloop()(runs repeatedly). - The Arduino IDE compiles your code and uploads it to the board via USB.
- The built-in LED is on pin 13 (
LED_BUILTIN). - The Serial Monitor lets you send text between your computer and the Arduino.
Next, you will learn to control multiple LEDs and read buttons with Digital I/O.