Everything you need to know — from basics to advanced projects
Raspberry Pi is a small, affordable single-board computer developed by the Raspberry Pi Foundation. Learn about all models, GPIO, ports, projects, and more.
Raspberry Pi is a small, affordable single-board computer developed by the Raspberry Pi Foundation. Despite its tiny size, it functions as a fully capable computer that can run Linux-based operating systems.
What is it used for?
Programming
Electronics Projects
Robotics
IoT
Servers
AI & Edge Computing
Cybersecurity Labs
Raspberry Pi Versions (All Major Models)
Raspberry Pi 5
Latest & Most Powerful
Quad-core ARM Cortex-A76 (2.4 GHz)
RAM: 4GB / 8GB
Dual 4K HDMI
PCIe support
USB 3.0 ports
Best for AI, servers, heavy tasks
Raspberry Pi 4 Model B
Most Popular
Quad-core Cortex-A72
RAM: 2GB / 4GB / 8GB
Dual HDMI
USB 3.0
Gigabit Ethernet
Most popular for students
Raspberry Pi 3 Model B+
Reliable
1GB RAM
WiFi + Bluetooth
Good for IoT projects
Raspberry Pi Zero 2 W
Ultra Compact
Very small size
Built-in WiFi
Used in embedded systems
How to Install Raspberry Pi OS
Step 1: Download Raspberry Pi Imager
Download from the official website of Raspberry Pi Foundation. Install on:
Windows
Mac
Linux
Step 2: Insert MicroSD Card
Minimum requirements:
Spec
Requirement
Capacity
16GB minimum (32GB recommended)
Class
Class 10
Step 3: Use Raspberry Pi Imager
Open Imager application
Choose OS → Raspberry Pi OS (64-bit recommended)
Choose Storage → Select SD card
Click Write
Optional settings in Imager: Enable SSH, Set WiFi credentials, Set username/password — these save time on first boot!
Step 4: Insert SD into Pi and Power On
Connect the following:
Connection
Details
HDMI
Connect to monitor
Keyboard
USB keyboard
Mouse
USB mouse
Power Supply
5V USB-C
System boots automatically. You'll see the Raspberry Pi desktop on first successful boot.
Raspberry Pi GPIO Pinout Diagram (40 Pins)
GPIO = General Purpose Input Output. The Raspberry Pi has 40 physical pins that allow you to interface with sensors, LEDs, motors, and more.
Types of Pins
5V
Power output
3.3V
Power output
GND
Ground
GPIO
Input/Output pins
I2C
Sensor communication
SPI
High-speed communication
UART
Serial communication
PWM
Motor control
Important: BCM vs BOARD Numbering
Mode
Description
Example
BCM
Internal GPIO number (Broadcom SoC)
GPIO17 = BCM pin 17
BOARD
Physical pin number on the header
Physical pin 11 = GPIO17
Python
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM) # Use BCM numbering
BCM mode is recommended for most projects as it's consistent across Pi models and widely used in library documentation.
How to Use GPIO – LED Blink Example
Components Required
Component
Quantity
LED
1
220Ω Resistor
1
Breadboard
1
Jumper Wires
2
Connection
Raspberry Pi LED Circuit
┌──────────────────┐
│ │
│ GPIO17 ─────────┼───── 220Ω Resistor ───── LED (+) ───── LED (-) ──┐
│ │ │
│ GND ────────────┼────────────────────────────────────────────────────┘
│ │
└──────────────────┘
Connection: GPIO17 → Resistor → LED (Anode) → LED (Cathode) → GND
Python Code
Python — led_blink.py
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
whileTrue:
GPIO.output(17, GPIO.HIGH) # LED ON
time.sleep(1) # Wait 1 second
GPIO.output(17, GPIO.LOW) # LED OFF
time.sleep(1) # Wait 1 second
Code Explanation
Line / Block
What It Does
import RPi.GPIO as GPIO
Import GPIO library
GPIO.setmode(GPIO.BCM)
Use BCM pin numbering
GPIO.setup(17, GPIO.OUT)
Set GPIO17 as output
GPIO.output(17, GPIO.HIGH)
Turn LED ON (3.3V)
GPIO.output(17, GPIO.LOW)
Turn LED OFF (0V)
time.sleep(1)
Wait 1 second
Ports Explained (What Each Port Does)
Power Port
USB-C (Pi 4 & 5)
Needs 5V 3A power supply
HDMI Port
Connect to monitor
Supports dual display (Pi 4 & 5)
USB Ports
USB 2.0 → Keyboard / Mouse
USB 3.0 → Fast storage
Ethernet Port
Wired internet connection
Gigabit in Pi 4 & 5
WiFi + Bluetooth
Built-in wireless module
No external adapter needed
CSI Camera Port
Raspberry Pi Camera Module
Used for AI Vision Projects
DSI Display Port
Official Raspberry Pi Touch Display
7-inch touchscreen support
Operating Systems for Raspberry Pi
Besides Raspberry Pi OS (default), you can install many other operating systems:
Raspberry Pi OS Default OS, Debian-based
Ubuntu Server Server workloads
Kali Linux Cybersecurity & Pentesting
RetroPie Retro Gaming
Home Assistant OS Smart Home Automation
Windows IoT Core Microsoft IoT platform
Headless Setup (Without Monitor)
You can use Raspberry Pi without a monitor, keyboard, or mouse using SSH over WiFi.
Flash OS to SD card using Raspberry Pi Imager
Enable SSH in Imager settings (Advanced options)
Configure WiFi in Imager settings
Insert SD into Pi and power on
Connect via SSH from your computer:
Terminal
ssh pi@raspberrypi.local
Tip: Both your computer and Raspberry Pi must be connected to the same WiFi network for SSH to work.
Common Projects You Can Build
Smart Home System
CCTV Camera
Web Server
AI Object Detection
IoT Sensor Dashboard
Robot
Cluster Computing
Raspberry Pi vs Arduino
Feature
Raspberry Pi
Arduino
Type
Mini Computer
Microcontroller
OS
Runs full OS (Linux)
No OS
Multi-tasking
Yes — multi-tasking
Single task at a time
Languages
Python / Linux / Any
C / C++
GPIO
40 pins, 3.3V logic
14-54 pins, 5V logic
Connectivity
WiFi, Bluetooth, Ethernet built-in
Requires external modules
Price
$35 – $80
$3 – $25
Best For
Complex projects, AI, servers
Simple sensor projects, motor control
Key takeaway: Use Raspberry Pi when you need an OS, networking, or complex processing. Use Arduino for simple, real-time hardware control.
Important Safety Rules
Never connect 5V to GPIO pins — GPIO works at 3.3V only. Applying 5V will permanently damage the chip.
GPIO works at 3.3V — Always use level shifters when interfacing with 5V components.
Use resistor with LEDs — Without a current-limiting resistor (220Ω), the LED and GPIO pin can be damaged.
Avoid short circuits — Double-check wiring before powering on. A short circuit can fry your Pi.
Use proper power supply — Always use a 5V 3A USB-C adapter. Underpowering causes instability and SD card corruption.
Warning: GPIO damage is irreversible. Always verify connections before powering on. When in doubt, use a multimeter to check voltages.
Advanced Usage
Since you're into Medical Electronics, IoT, and AI, here's what you can build with Raspberry Pi:
Real-time Health Monitoring
ECG, SpO2, Heart Rate sensors connected to Pi for live monitoring
Thermal Camera Integration
MLX90640 thermal sensor for contactless temperature scanning
Edge AI with TensorFlow Lite
Run ML models locally on Pi for object detection & classification
Radar Signal Processing
Interface with radar modules for distance & motion analysis
Portable Medical Diagnostic
Build a portable device with multiple sensors & a touchscreen
Pro tip: Combine Raspberry Pi with an ESP32 for distributed IoT — Pi as the gateway/hub and ESP32 as remote sensor nodes.