Who Invented the Raspberry Pi? The Cambridge Origin Story
If you are searching for who invented the Raspberry Pi, the direct answer is a team of six computer scientists and engineers at the University of Cambridge: Eben Upton, Rob Mullins, Jack Lang, Alan Mycroft, David Braben, and Pete Lomas. They formed the Raspberry Pi Foundation in 2009 and launched the first commercial board in February 2012.
But understanding why they invented it is far more critical for embedded developers today. In the late 2000s, Upton noticed a sharp decline in the programming and hardware skills of applicants to Cambridge's computer science program. In the 1990s, kids were hacking on Amigas and BBC Micros with exposed, easily accessible GPIO (General Purpose Input/Output) pins. By 2010, teenagers were coding on locked-down tablets and smartphones where the hardware was completely abstracted away.
The Raspberry Pi was invented specifically to put raw, unprotected hardware registers back into the hands of students. The 40-pin header wasn't an afterthought; it was the entire point. Today, we honor that original mission by building a foundational embedded project: a hardware-debounced digital input. We will also tackle the modern debugging nightmares introduced by the Pi 5's new silicon.
Decision Tree: Which Raspberry Pi Board for Embedded GPIO?
Before wiring up a breadboard, you must select the right board. The Pi ecosystem has fragmented into distinct use cases. Use this decision path to select your hardware.
| Criteria | Raspberry Pi 5 (4GB) | Raspberry Pi 4 Model B | Raspberry Pi Zero 2 W |
|---|---|---|---|
| Processor | BCM2712 (Quad-core Cortex-A76) | BCM2711 (Quad-core Cortex-A72) | BCM2710A1 (Quad-core Cortex-A53) |
| GPIO Controller | RP1 (Southbridge chip) | Integrated into BCM2711 | Integrated into BCM2710A1 |
| Legacy RPi.GPIO Support | Broken (Requires lgpio) | Native Support | Native Support |
| PCIe Interface | Yes (Gen 2 x1) | No | No |
| Best For | Modern Linux embedded, AI edge | Legacy codebases, retro gaming | Headless IoT, battery-powered |
lgpio or gpiozero stack now will future-proof your skills.
Project Build: Honoring the Original Vision (Hardware Debounced Input)
Software debouncing (waiting 50ms in code to ignore switch bounce) is fine for toys, but it wastes CPU cycles and introduces latency. True embedded engineering uses hardware RC (resistor-capacitor) filters to clean the signal before it ever hits the GPIO pin. This project builds a robust, hardware-debounced pushbutton that triggers an LED.
Parts List
- Board: Raspberry Pi 5 (4GB variant)
- Storage: SanDisk Extreme 32GB microSD (A2 rated for random I/O)
- Breakout: Freenove GPIO Breakout Board (protects Pi pins from breadboard shorts)
- Switch: 6x6mm Tactile Pushbutton (SPST)
- Resistors: 10kΩ carbon film (pull-up), 330Ω (LED current limiting)
- Capacitor: 100nF (0.1µF) ceramic disc (for debounce filtering)
- LED: 5mm Standard Red (2.0V forward voltage)
Pin Mapping Table
| Component | Pi 5 Physical Pin | BCM GPIO Number | Function |
|---|---|---|---|
| Pushbutton (via RC filter) | 11 | GPIO 17 | Input (Pull-up) |
| LED Anode (via 330Ω) | 13 | GPIO 27 | Output (Push-pull) |
| RC Filter VCC | 1 | 3.3V | Power |
| Common Ground | 9 | GND | Reference |
Wiring Steps
- De-energize: Unplug the Pi 5 USB-C power supply before wiring the breadboard.
- Build the RC Filter: Connect the 10kΩ resistor between 3.3V and GPIO 17. Connect one leg of the tactile switch to GPIO 17 and the other to GND. Place the 100nF capacitor in parallel with the switch (between GPIO 17 and GND). This creates a low-pass filter with a time constant of $\tau = 10k\Omega \times 100nF = 1ms$, physically absorbing the microsecond-level contact bounce.
- Wire the LED: Connect GPIO 27 to the 330Ω resistor, then to the LED anode (long leg). Connect the cathode (short leg) to GND.
- Verify: Use a multimeter in continuity mode to ensure no shorts exist between 3.3V and GND before applying power.
The Code: Python GPIO with Modern Error Handling
This code targets the Raspberry Pi 5. It uses the modern gpiozero library, which automatically delegates to the lgpio backend on the Pi 5's RP1 chip. It includes robust error handling for the most common environment failures.
#!/usr/bin/env python3
"""
Hardware Debounced Input with LED Indicator
Target: Raspberry Pi 5 (4GB)
Backend: gpiozero via lgpio (RP1 Southbridge)
"""
import sys
import signal
from time import sleep
try:
from gpiozero import Button, LED
from gpiozero.exc import GPIOZeroError, PinFactoryFallback
except ImportError as e:
print(f"[FATAL] Missing library: {e}")
print("Fix: sudo apt update && sudo apt install python3-gpiozero python3-lgpio")
sys.exit(1)
# Pin Definitions (BCM Numbering)
BUTTON_PIN = 17
LED_PIN = 27
def graceful_exit(signum, frame):
"""Handle Ctrl+C cleanly to release GPIO resources."""
print("\n[INFO] Caught interrupt. Releasing GPIO pins...")
led.off()
sys.exit(0)
def main():
global led
signal.signal(signal.SIGINT, graceful_exit)
signal.signal(signal.SIGTERM, graceful_exit)
try:
# Initialize hardware
# bounce_time=None because we are using a hardware RC filter!
button = Button(BUTTON_PIN, pull_up=True, bounce_time=None, active_state=False)
led = LED(LED_PIN)
print(f"[OK] Monitoring GPIO {BUTTON_PIN} and driving GPIO {LED_PIN}.")
print("[INFO] Press Ctrl+C to exit.")
while True:
if button.is_pressed:
led.on()
else:
led.off()
# Small sleep to prevent CPU thrashing, though hardware debounce
# allows us to poll safely without software filtering overhead.
sleep(0.01)
except PinFactoryFallback as e:
print(f"[ERROR] Pin factory failed: {e}")
print("Fix: Ensure lgpio is installed and you have GPIO group permissions.")
except GPIOZeroError as e:
print(f"[ERROR] GPIO Zero hardware fault: {e}")
except Exception as e:
print(f"[FATAL] Unexpected error: {e}")
sys.exit(1)
if __name__ == '__main__':
main()
Debugging: First Three Things to Check When It Fails
The transition from the Pi 4 to the Pi 5 broke thousands of legacy tutorials. If your code fails, follow this ranked troubleshooting path.
1. The Legacy Silicon Error
Exact Error String: RuntimeError: Cannot determine SOC peripheral base address or RuntimeError: This module can only be run on a Raspberry Pi!
- Cause: You are trying to use the legacy
RPi.GPIOlibrary on a Raspberry Pi 5. The Pi 5 moved GPIO control from the main BCM2712 SoC to the RP1 southbridge chip.RPi.GPIOlooks for memory addresses that no longer exist. - Fix: Uninstall
RPi.GPIO. Refactor your code to usegpiozero(as shown above) or install the drop-in shim viasudo apt install rpi-lgpio.
2. The Missing Backend Error
Exact Error String: gpiozero.exc.PinFactoryFallback: Falling back from lgpio: No module named 'lgpio'
- Cause:
gpiozerois installed, but the underlying C-extension that actually talks to the RP1 chip (lgpio) is missing from your Python environment. - Fix: Install the system package rather than using pip, which often fails to compile the C bindings on ARM64:
sudo apt install python3-lgpio.
3. The Virtual Environment Permission Error
Exact Error String: PermissionError: [Errno 13] Permission denied: '/dev/gpiochip0'
- Cause: You are running the script inside a Python virtual environment (
venv) or as a standard user who hasn't been added to the hardware access group. Modern Pi OS usesuinputandgpiochipcharacter devices that require specific group permissions. - Fix: Add your user to the gpio group:
sudo usermod -a -G gpio $USER, then log out and log back in. Do not just run the script withsudo, as this breaks virtual environment paths and creates security risks.
Extending and Simplifying the Build
Depending on your production constraints, you may need to alter this design. Here is how to adapt it.
How to Simplify (The Software-Only Route)
If you are building a quick prototype and lack the 100nF capacitor, you can strip the hardware filter and rely on software debouncing.
Action: Remove the capacitor from the breadboard. In the Python code, change the button initialization to:
button = Button(BUTTON_PIN, pull_up=True, bounce_time=0.05).
This tells the gpiozero backend to ignore state changes that occur within 50 milliseconds of the initial edge detection. It costs a tiny amount of CPU overhead but saves a component.
How to Extend (Adding I2C Telemetry)
To turn this into a data-logging station, add an I2C OLED display to log button press durations.
Action: Wire an SSD1306 128x64 I2C OLED to Physical Pins 3 (SDA/GPIO 2) and 5 (SCL/GPIO 3). Install the Adafruit library via pip3 install adafruit-circuitpython-ssd1306. Modify the while True loop to increment a counter on every button.when_pressed event and write the total to the OLED via the I2C bus. Ensure you enable the I2C interface in sudo raspi-config first.
For more on modern GPIO architectures, consult the official gpiozero documentation and the Raspberry Pi hardware guides. Eben Upton's original vision was to make hardware accessible; mastering the RP1 southbridge and modern Linux character devices is how you keep that vision alive in 2026.






