🛠 Allumer une LED depuis la GPIO 17 avec libgpiod

Raspberry Pi Model B+ (2014) — Board Sheet · debutant · Schéma : IMG-model-b-plus-debutant-1-modelbp-led-gpio.svg — Raspberry Pi Model B+ et son en-tête 40 broches : GPIO17 (broche 11) vers résistance 330 Ω puis LED, cathode reliée au GND (broche 14).

Objectives

Discover the 40-pin header (J8) of the Raspberry Pi Model B+ — the ribbon that defined the format for all subsequent "Model B" boards — and light up an LED without writing a program, using the libgpiod tools (gpiodetect, gpioinfo, gpioset) available on legacy 32-bit images.

Hardware

Complete Code

# Installation des outils libgpiod
sudo apt update && sudo apt install -y gpiod
# Inventaire des puces GPIO puis état des lignes
gpiodetect
gpioinfo gpiochip0
# Broche physique 11 = GPIO17 (BCM) : mise à 1, la LED s'allume
sudo gpioset gpiochip0 17=1
sleep 5
# Extinction
sudo gpioset gpiochip0 17=0

Wiring: pin 11 (GPIO17) → 330 Ω resistor → LED anode; cathode → pin 14 (GND). The B+ logic operates at 3.3 V: never supply a GPIO pin with 5 V.

Expected Verification

gpiodetect displays "gpiochip0 [bcm2835-gpio] (54 lines)". After running gpioset gpiochip0 17=1, the LED stays lit and gpioinfo shows line 17 as "output active"; with 17=0 it turns off.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials