You wire up the GPIO pins. The LED refuses to blink. You double-check your script. No typo. You test the resistor. Still nothing. That’s when it hits you — maybe you picked the wrong pin numbering scheme. On Raspberry Pi, something as small as choosing between physical pins and BCM pins can turn a simple project into hours of frustration. And when you're running production for clients like Davide or Lasle, one wrong pin can delay shipments or wreck a demo.
Why pin numbering matters on Raspberry Pi
A single mislabel can derail production schedules. For Davide, that means Amazon listings going dark. For Lasle, it could stall an entire IoT rollout.
Where “BCM” fits into the GPIO story
BCM numbers live inside the Broadcom chip itself. They don’t care where the header sits. That consistency is gold when you jump between different Pi revisions.
(Hang tight—let’s zoom in on BCM before we juggle the other schemes.)
What is BCM (Broadcom SoC Channel)?
BCM stands for Broadcom SoC Channel—the label Broadcom uses for internal GPIO lanes on the chip. When Linux boots, the kernel surfaces those lanes as numbers like GPIO 17 or GPIO 27, and libraries pass them straight to your code.
Broadcom origin of the naming
Broadcom’s datasheets list each general-purpose I/O as “GPIO n.” Early Pi engineers adopted that map so documentation lined up with the hardware registers.
How the Linux kernel exposes BCM numbers
The device-tree blob on boot tells Linux which GPIO controller it’s running. The OS then hands out BCM numbers through /sys/class/gpio so user-space programs speak the chip’s native language.
Evolution across Pi board revisions
Revision 1 boards shuffled a few BCM channels. That reshuffle triggered the infamous “Why does my Rev 1 script fail on Rev 2?” email spree. Since the 40-pin header arrived, the map has stayed stable, though Compute Modules still add wrinkles.
BCM sounds neat—but how does it stack up against the other maps? Let’s lay them side by side.
Pin Numbering Schemes on Raspberry Pi
Physical / BOARD numbering overview
Physical (often called BOARD) counts pins exactly as you see them on the header: 1 through 40. No surprises, perfect for beginners with a printed pinout.
BCM numbering overview
BCM ignores location and follows the chip’s internal index. GPIO 2 sits on physical pin 3, GPIO 17 on pin 11, and so on.
WiringPi & other legacy schemes
WiringPi introduced its own set for C programmers. Pi4J carries a similar abstraction to shield Java code from board changes.
Mapping tables and pinout tools
| Physical Pin | BCM Number | WiringPi | Typical Function |
|---|---|---|---|
| 3 | 2 | 8 | I²C SDA1 |
| 5 | 3 | 9 | I²C SCL1 |
| 7 | 4 | 7 | GPCLK0 |
| 11 | 17 | 0 | GPIO (UART RTS) |
| 13 | 27 | 2 | GPIO (PWM) |
| 15 | 22 | 3 | GPIO |
_(Data verified with pinout.xyz and Pi4J docs.)
If three schemes feel like a juggling act, wait until you see why most libraries pick BCM as their default.
Why the Raspberry Pi Ecosystem Prefers BCM Numbering
Consistency across different Pi models
Whether I’m testing on a Pi 4 or a headless Compute Module, BCM 17 always maps to the same silicon pad. That keeps my Git repos clean—no board-specific conditionals.
Alignment with Broadcom datasheets & registers
BCM lets developers read a datasheet and jump straight to code without cross-referencing physical layouts. One less lookup table means one less potential bug.
Library defaults (RPi.GPIO, GPIO Zero, Pi4J)
| Library | Default Mode | Quick Switch |
|---|---|---|
| RPi.GPIO | BCM | GPIO.setmode(GPIO.BOARD) |
| GPIO Zero | BCM | Pass pin_factory=PiGPIOFactory() |
| Pi4J | BCM | RaspiPin.GPIO_17 |
_(Defaults pulled from official docs.)
Community documentation & tutorials
Most Stack Exchange answers, blog guides, and pinout diagrams assume BCM. Following that herd makes copy-paste code safer for newcomers.
Enough theory—let’s flip a few LEDs and see BCM in action.
Practical Examples Using BCM
Python (RPi.GPIO) LED-blink walk-through
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM) # use BCM numbers
GPIO.setup(17, GPIO.OUT) # GPIO17 = physical pin11
try:
while True:
GPIO.output(17, 1)
time.sleep(0.5)
GPIO.output(17, 0)
time.sleep(0.5)
finally:
GPIO.cleanup()Five lines, one blinking LED, zero confusion.
from gpiozero import Button
button = Button(3) # BCM 3, physical pin5
button.when_pressed = lambda: print("Pressed!")
pause()Java (Pi4J) sample code
var led = RaspiPin.GPIO_17; // BCM 17
var gpio = GpioFactory.getInstance();
var pin = gpio.provisionDigitalOutputPin(led, "LED", PinState.LOW);Avoiding mixed-mode errors
Never call GPIO.setmode(GPIO.BOARD) in one file and import another module that defaults to BCM. Your script might silently hit the wrong pin.
Now you’ve seen BCM alive on the bench—so when should you switch back to BOARD?
Choosing Between BCM and BOARD Numbering
When physical-pin layout is clearer
If you’re wiring by sight—say, during a workshop with school kids—physical numbers feel more intuitive.
Collaboration and maintenance considerations
In a mixed team, pick one scheme and stick with it. For MaidaTech’s OEM manuals, I default to BCM and include a table like the one above so everyone stays aligned.
Labeling headers in custom hardware
| Scenario | Recommended Scheme | Why |
|---|---|---|
| Factory QA jig | BCM | Works across Pi revisions |
| Classroom demo | Physical | Easier for beginners |
| Custom HAT design | BCM | Matches register maps |
Of course, numbering mistakes still sneak in. Let’s hunt them down before they bite.
Common Pitfalls & Troubleshooting
Symptoms of mixed-numbering confusion
LED wired to pin 11 but code toggles pin 17
Sensor stuck in “no data” state despite power
Scripts run on one Pi model but fail on another
Using the pinout command & pinout.xyz
Run pinout on the Pi shell for an instant cheat-sheet. For remote debugging, pinout.xyz’s interactive map saves the day.
Detecting board revision programmatically
import gpiozero
print(gpiozero.Device.pin_factory.pi_info.board_revision)Log the revision before you export code to production. Catch mismatches early.
With pitfalls covered, let’s tighten the screws for our customers.
Best Practices for MaidaTech & Re-brand Customers
Printing pin maps inside custom enclosures
A laser-etched map near the header turns tech support emails into thank-you notes. It also slashes assembly errors for Davide’s fulfillment team.
Document templates for OEM/ODM clients (Davide & Lasle)
I bundle a one-page PDF showing BCM, physical, and function columns. Clients drop their logo, hit print, and slide it into the retail box.
Future-proofing manuals for new Pi revisions
Leave two blank rows in every pin table. If Broadcom adds fresh lanes, your docs adapt without a rewrite.
We’ve toured the chip, the headers, and the human mistakes. Let’s land the plane.
Conclusion
Key takeaways on BCM’s role
BCM pin numbers trace straight back to the silicon. That direct line means fewer surprises when you swap boards, share code, or debug at 2 a.m.
Actionable recommendations for developers & hardware designers
Pick one scheme—preferably BCM—and commit.
Label everything: silkscreen, PDFs, wiki pages.
Script defensively: log the board revision and numbering mode.
Do that, and your LEDs will blink when—and where—you want them to.
















