The Arduino Uno is the world's most popular microcontroller board for beginners. Based on the ATmega328P chip, it gives you 14 digital I/O pins, 6 analog inputs, and a simple USB programming interface.
Arduino Uno R3
AVR ยท ATmega328P ยท 16 MHz
The Uno is the ideal starting point. Its forgiving 5V logic level, abundant community resources, and affordable shields make it unbeatable for learning. The Arduino IDE abstracts away low-level C++ details so you can focus on building things.
16 MHz
Clock Speed
32 KB
Flash Memory
14 Digital
I/O Pins
6 Analog
Input Pins
Arduino IDE Setup
Getting your Arduino Uno ready to program takes about 5 minutes. Follow these steps and you'll be uploading code in no time.
INSTALLATION STEPS
1
Go to arduino.cc/en/software and download the Arduino IDE 2.x for your operating system (Windows/Mac/Linux). The installer is around 200MB.
2
Run the installer. On Windows, accept the driver installation prompts โ these USB drivers are essential for communication with the board.
3
Plug your Arduino Uno into your computer via USB. The green power LED should light up on the board.
4
Open Arduino IDE โ Tools โ Board โ Select "Arduino Uno". Then Tools โ Port โ Select the COM port (Windows) or /dev/ttyUSB0 (Linux) that appeared when you plugged in the board.
5
Go to File โ Examples โ 01.Basics โ Blink. Click the Upload button (right arrow icon). The built-in LED on pin 13 should start blinking!
๐ก Can't find the port? On Windows, open Device Manager and look for "Ports (COM & LPT)". If you see an unknown device with a yellow warning, you need to install the CH340 or CP2102 USB driver for your specific board variant.
Arduino Uno Pinout
Understanding the pins is crucial. Each pin has a specific function โ some can only do digital I/O, others can measure analog voltages, and some support special protocols.
~ means PWM: Pins marked with ~ (3, 5, 6, 9, 10, 11) support analogWrite() which outputs PWM โ perfect for dimming LEDs, controlling motor speed, and generating tones.
Your First Arduino Program
Every programmer starts with Blink. Then we'll move to controlling an external LED with a button โ your first interactive project!
PROGRAM 1: BLINK THE BUILT-IN LED
// Blink - Makes the built-in LED flash every secondvoidsetup() {
pinMode(13, OUTPUT); // Set pin 13 as output
}
voidloop() {
digitalWrite(13, HIGH); // LED ONdelay(1000); // Wait 1 seconddigitalWrite(13, LOW); // LED OFFdelay(1000); // Wait 1 second
}
PROGRAM 2: BUTTON-CONTROLLED LED
const int buttonPin = 2; // Button on pin 2const int ledPin = 9; // External LED on pin 9voidsetup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT_PULLUP); // Use internal pull-upSerial.begin(9600);
}
voidloop() {
int state = digitalRead(buttonPin);
if (state == LOW) { // Button pressed (pulled LOW)digitalWrite(ledPin, HIGH);
Serial.println("Button Pressed!");
} else {
digitalWrite(ledPin, LOW);
}
}
INPUT_PULLUP explained: This enables the microcontroller's internal 20kฮฉ pull-up resistor on the pin. The pin reads HIGH normally, and goes LOW when the button connects it to GND. No external resistor needed!
Reading Sensors
Sensors are how microcontrollers perceive the physical world. Here we'll read analog sensors and the popular DHT11 temperature sensor.
ANALOG READ โ POTENTIOMETER / LDR
voidsetup() {
Serial.begin(9600);
}
voidloop() {
int rawValue = analogRead(A0); // 0 to 1023float voltage = rawValue * (5.0 / 1023.0);
Serial.print("Raw: ");
Serial.print(rawValue);
Serial.print(" Voltage: ");
Serial.println(voltage);
delay(200);
}
The ESP32 is a powerhouse microcontroller with built-in WiFi and Bluetooth. 240MHz dual-core processor, 520KB RAM, and countless peripherals โ all for a fraction of the cost of dedicated modules.
ESP32 DevKit V1
XTENSA LX6 ยท DUAL CORE ยท WIFI + BLE
The ESP32 replaces the ESP8266 with significantly more power. It has two cores running at 240MHz, 18 analog input channels, capacitive touch sensing, hardware encryption, and enough memory to run a full web server. Programs with Arduino IDE โ just install the ESP32 board package.
240 MHz
Dual Core
520 KB
SRAM
WiFi + BT
Wireless
36 GPIO
Pins
โก Adding ESP32 to Arduino IDE: File โ Preferences โ add this URL to "Additional Board URLs": https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json Then Tools โ Board โ Boards Manager โ search ESP32 โ Install.
ESP32 WiFi Web Server
Create a web page hosted on the ESP32 that lets you control an LED from any browser on your local network โ no internet required!
#include <WiFi.h>
#include <WebServer.h>
const char* ssid = "Your_WiFi_Name";
const char* password = "Your_Password";
WebServer server(80);
bool ledState = false;
voidhandleRoot() {
String html = "<h1>ESP32 LED Control</h1>";
html += "<p>LED is: <b>" + (ledState ? "ON":"OFF") + "</b></p>";
html += "<a href='/on'><button>Turn ON</button></a> ";
html += "<a href='/off'><button>Turn OFF</button></a>";
server.send(200, "text/html", html);
}
voidsetup() {
pinMode(2, OUTPUT);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) delay(500);
Serial.println(WiFi.localIP()); // Open this IP in browser
server.on("/", handleRoot);
server.on("/on", [](){ledState=true;digitalWrite(2,HIGH);handleRoot();});
server.on("/off",[](){ledState=false;digitalWrite(2,LOW);handleRoot();});
server.begin();
}
voidloop() { server.handleClient(); }
ESP32 Bluetooth
Send commands from your phone to the ESP32 via Bluetooth โ no WiFi needed. Perfect for wireless sensor displays and robot control.
๐ฑ Phone App: Install "Serial Bluetooth Terminal" from the Play Store. Pair with "ESP32_Robot" and send '1' to turn LED on, '0' to turn off.
Raspberry Pi Pico
The RP2040-based Pico is a dual-core ARM Cortex-M0+ board from Raspberry Pi Foundation. Incredibly capable, programmable in Python, and costs just a few dollars.
Raspberry Pi Pico
RP2040 ยท DUAL ARM CORTEX-M0+ ยท 133 MHz
The Pico excels at MicroPython and CircuitPython. It has 26 GPIO pins, 3 ADC channels, I2C, SPI, UART, and even Programmable I/O (PIO) for custom hardware interfaces. The Pico W adds built-in WiFi.
133 MHz
Dual Core
264 KB
SRAM
2 MB
Flash
26 GPIO
Pins
MicroPython Setup
MicroPython is a lean Python 3 implementation for microcontrollers. On the Pico, setup takes under 2 minutes!
1
Download the MicroPython .uf2 firmware from micropython.org/download/rp2-pico
2
Hold the BOOTSEL button on the Pico and plug it into your PC via USB. It appears as a USB drive called RPI-RP2.
3
Drag and drop the .uf2 file onto the RPI-RP2 drive. The Pico will reboot and MicroPython is now installed!
4
Install Thonny IDE (thonny.org) and select MicroPython (Raspberry Pi Pico) as the interpreter.
5
Click the Shell at the bottom and type: print("Hello Pico!") โ you should see a response!
# Blink LED on Raspberry Pi Pico with MicroPythonfrom machine import Pin
import utime
led = Pin(25, Pin.OUT) # Built-in LED on GPIO 25while True:
led.value(1) # LED ON
utime.sleep(0.5)
led.value(0) # LED OFF
utime.sleep(0.5)
Pico Projects
Here are some exciting projects to build with your Raspberry Pi Pico.