Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Boards & Microcontrollers
  4. ›Raspberry Pi GPIO Pinout
Step 4 of 14 in Raspberry Pi and PicoPart of a learning path.
Next

Pinout reference · Beginner · 3 min read

Raspberry Pi GPIO Pinout

40-Pin Header Reference

By Geekobot Learning Team · Updated 24 Oct 2026

On this page
Short answerBCM vs physical (board) numberingFull 40-pin pinoutPower and current limitsEnabling I2C, SPI, UART and 1-WireReading a button and lighting an LEDPi 5 differencesTry itCommon mistakesFAQsParts and next steps
Short answer

All Raspberry Pi models since 2014 share the same 40-pin header: 26 GPIO pins at 3.3 V logic, two 5 V pins, two 3.3 V pins and eight grounds. Code uses BCM numbers (GPIO 17), not physical pin numbers (pin 11). I2C is on GPIO 2 and 3, SPI on GPIO 7 to 11, UART on GPIO 14 and 15, and hardware PWM on GPIO 12, 13, 18 and 19.

Key specs at a glance

Header
2 x 20 pins, 2.54 mm pitch
Logic level
3.3 V, not 5 V tolerant
Per-pin current
About 16 mA max; 50 mA total across all GPIO
Power pins
5 V on pins 2 and 4; 3.3 V on pins 1 and 17
I2C
GPIO 2 (SDA), GPIO 3 (SCL), with 1.8 kΩ pull-ups on board
SPI0
GPIO 10 (MOSI), 9 (MISO), 11 (SCLK), 8 (CE0), 7 (CE1)
UART
GPIO 14 (TXD), GPIO 15 (RXD)
Hardware PWM
GPIO 12, 13, 18, 19
01

BCM vs physical (board) numbering

Physical numbering counts the header pins 1 to 40: pin 1 is the 3.3 V pin nearest the SD card, odd numbers on the inside row, even numbers on the outside. BCM numbering uses the chip's GPIO number and is what gpiozero and most libraries expect. "GPIO 17" is physical pin 11. Pinout diagrams and the pinout command on the Pi show both.

02

Full 40-pin pinout

PinFunctionPinFunction
13.3 V25 V
3GPIO 2 (SDA1)45 V
5GPIO 3 (SCL1)6GND
7GPIO 4 (GPCLK0, 1-Wire)8GPIO 14 (TXD)
9GND10GPIO 15 (RXD)
11GPIO 1712GPIO 18 (PWM0, PCM_CLK)
13GPIO 2714GND
15GPIO 2216GPIO 23
173.3 V18GPIO 24
19GPIO 10 (MOSI)20GND
21GPIO 9 (MISO)22GPIO 25
23GPIO 11 (SCLK)24GPIO 8 (CE0)
25GND26GPIO 7 (CE1)
27ID_SD (EEPROM, reserved)28ID_SC (EEPROM, reserved)
29GPIO 530GND
31GPIO 632GPIO 12 (PWM0)
33GPIO 13 (PWM1)34GND
35GPIO 19 (PWM1, PCM_FS)36GPIO 16
37GPIO 2638GPIO 20 (PCM_DIN)
39GND40GPIO 21 (PCM_DOUT)
1
Function:
3.3 V
Pin:
2
Function:
5 V
3
Function:
GPIO 2 (SDA1)
Pin:
4
Function:
5 V
5
Function:
GPIO 3 (SCL1)
Pin:
6
Function:
GND
7
Function:
GPIO 4 (GPCLK0, 1-Wire)
Pin:
8
Function:
GPIO 14 (TXD)
9
Function:
GND
Pin:
10
Function:
GPIO 15 (RXD)
11
Function:
GPIO 17
Pin:
12
Function:
GPIO 18 (PWM0, PCM_CLK)
13
Function:
GPIO 27
Pin:
14
Function:
GND
15
Function:
GPIO 22
Pin:
16
Function:
GPIO 23
17
Function:
3.3 V
Pin:
18
Function:
GPIO 24
19
Function:
GPIO 10 (MOSI)
Pin:
20
Function:
GND
21
Function:
GPIO 9 (MISO)
Pin:
22
Function:
GPIO 25
23
Function:
GPIO 11 (SCLK)
Pin:
24
Function:
GPIO 8 (CE0)
25
Function:
GND
Pin:
26
Function:
GPIO 7 (CE1)
27
Function:
ID_SD (EEPROM, reserved)
Pin:
28
Function:
ID_SC (EEPROM, reserved)
29
Function:
GPIO 5
Pin:
30
Function:
GND
31
Function:
GPIO 6
Pin:
32
Function:
GPIO 12 (PWM0)
33
Function:
GPIO 13 (PWM1)
Pin:
34
Function:
GND
35
Function:
GPIO 19 (PWM1, PCM_FS)
Pin:
36
Function:
GPIO 16
37
Function:
GPIO 26
Pin:
38
Function:
GPIO 20 (PCM_DIN)
39
Function:
GND
Pin:
40
Function:
GPIO 21 (PCM_DOUT)
03

Power and current limits

GPIO pins source about 16 mA each, with roughly 50 mA available across the whole header, so a GPIO can light an LED through a 330 Ω to 1 kΩ resistor but nothing bigger. The 5 V pins connect straight to the Pi's input supply and can power a few hundred milliamps of accessories if your PSU has headroom. The 3.3 V rail is good for about 500 mA on the Pi 4 and 5. Motors, relays and LED strips go through a transistor, MOSFET or relay module with their own supply.

04

Enabling I2C, SPI, UART and 1-Wire

Run sudo raspi-config > Interface Options to enable I2C and SPI, and the serial port (disable the login shell over serial if you want to use the UART for a device). 1-Wire for DS18B20 sensors is enabled by adding dtoverlay=w1-gpio to /boot/firmware/config.txt, using GPIO 4 by default. Check for I2C devices with i2cdetect -y 1.

05

Reading a button and lighting an LED

Button on GPIO 2, LED on GPIO 17 (gpiozero) · MicroPython
from gpiozero import LED, Button
from signal import pause

led = LED(17)            # physical pin 11, through a 330 ohm resistor
button = Button(2)       # physical pin 3, uses the internal pull-up

button.when_pressed = led.on
button.when_released = led.off
pause()
06

Pi 5 differences

On the Raspberry Pi 5 the header is driven by the RP1 I/O chip. The pins and numbers are unchanged, but libraries that poke the old registers directly (RPi.GPIO, pigpio, WiringPi) stop working. Use gpiozero (with the lgpio backend), the gpiod tools, or libraries updated for the Pi 5.

07

Try it: LED resistor calculator

Change the values and the diagram and results update as you type.

08

Common mistakes to avoid

  • !Mixing BCM and physical numbers, so the wrong pin toggles.
  • !Connecting 5 V sensor outputs to GPIO pins.
  • !Drawing more than a few milliamps from a pin.
  • !Using pins 27 and 28 (ID EEPROM), which are reserved for HATs.
  • !Shorting 5 V to 3.3 V or GPIO while probing a live header.
09

Frequently asked questions

Which Raspberry Pi pins are 5 V?

Physical pins 2 and 4 supply 5 V. Pins 1 and 17 supply 3.3 V. All GPIO pins are 3.3 V logic.

How much current can a Raspberry Pi GPIO pin supply?

About 16 mA per pin and around 50 mA in total across all GPIO. Use a transistor or driver for anything more.

Is the Raspberry Pi 5 pinout the same as the Pi 4?

Yes. Every 40-pin Raspberry Pi shares the same header layout and GPIO numbers. Only the software library support changed on the Pi 5.

Which pins are I2C on the Raspberry Pi?

GPIO 2 (SDA) on physical pin 3 and GPIO 3 (SCL) on physical pin 5, with onboard 1.8 kΩ pull-ups to 3.3 V.

Does the Raspberry Pi have analog pins?

No. Use an external ADC such as the MCP3008 (SPI) or ADS1115 (I2C) to read analog sensors.

Parts for this guide

  • Dupont Jumper Wires (40 pcs)
    ₹49View
  • 4-Channel Logic Level Converter (BSS138)
    ₹20View
Shop Raspberry PiShop Interface Modules

Calculators

LED resistor calculatorI2C pull-up calculator

Terms in this guide

GPIOGeneral-purpose input/output: a microcontroller pin that your code can read or drive.BCM numberingThe Raspberry Pi pin naming that uses the Broadcom chip's GPIO numbers (GPIO 17, GPIO 27) instead of the physical header positions.I2CInter-Integrated Circuit: a two-wire bus (SDA and SCL) that connects many devices by address.SPISerial Peripheral Interface: a fast bus with clock, data in, data out and a chip-select line per device.UARTUniversal asynchronous receiver-transmitter: two-wire serial (TX and RX) used by GPS, Bluetooth modules and debug output.PWMPulse-width modulation: switching a signal on and off quickly so its average sets brightness, speed or position.Logic levelThe voltage that represents a digital high: 5 V on classic Arduinos, 3.3 V on ESP32, Pico and Raspberry Pi.

Projects that use it

Put this into practice: 9 step-by-step builds in our project library use parts from this guide.

Beginner · 1–2 hoursPi Zero 2 W motion loggerView projectBeginner · 1–2 hoursPi Zero temperature logger with a DS18B20View projectBeginner · 1–2 hoursPi Zero light logger with a BH1750View project
Browse all 9 projects

Keep learning

Component guideBeginnerRaspberry Pi 5 GuideThe Raspberry Pi 5 is a credit-card-size Linux computer with a 2.4 GHz quad-core Arm CPU, 2 to 16 GB of RAM, dual 4K HDMI, PCIe for NVMe storage and 40 GPIO pins.4 min read · Boards & MicrocontrollersConcept explainerIntermediateI2C ExplainedI2C is a two-wire bus that lets one microcontroller talk to many sensors and displays using a data line (SDA) and a clock line (SCL).4 min read · Electronics FundamentalsHow-toIntermediate3.3 V vs 5 V LogicYou need level shifting when a 5 V device sends signals to a 3.3 V board such as an ESP32 or Raspberry Pi Pico, because 5 V on their pins can damage them.4 min read · Prototyping & WiringComponent guideBeginnerLEDs ExplainedAn LED (light-emitting diode) lights when current flows from its longer leg (anode, +) to its shorter leg (cathode, -).3 min read · Displays & LEDsHow-toIntermediateTransistors and MOSFETs as SwitchesA transistor lets a small microcontroller signal switch a much larger current.4 min read · Semiconductors & ICs

Sources

  • Raspberry Pi hardware documentation: GPIO and the 40-pin header (Raspberry Pi Ltd)
  • BCM2711 and RP1 peripheral documentation (Raspberry Pi Ltd)
  • gpiozero documentation

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerBCM vs physical (board) numberingFull 40-pin pinoutPower and current limitsEnabling I2C, SPI, UART and 1-WireReading a button and lighting an LEDPi 5 differencesTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide1 item · ₹93

Raspberry Pi GPIO BCM Pinout Reference Board

Run itChange the inputs and watch the output
LED on GPIO 17 OFF
HIGHGPIO 2

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question