🛠 Suder le header 40 broches et faire clignoter une LED
Objectives
Solder the 40-pin header (supplied unmounted on the Zero W), then light up an LED via GPIO17 using gpiozero.
Hardware
- 1 Raspberry Pi Zero W + 2.54 mm 40-pin header (the Zero WH version comes pre-soldered)
- 1 soldering iron, solder wire, breadboard
- 1 LED + 330 Ω resistor, jumper wires
Steps
- Place the header on the component side, aligning pin 1 with the two square pads near the USB/HDMI connectors; solder diagonally to avoid solder bridges.
- Wiring: pin 11 = GPIO17 → 330 Ω resistor → LED anode; cathode → pin 14 = GND. The logic level is 3.3 V, with a maximum of 16 mA per pin and 50 mA total for the entire header — the Zero W has no ADC/DAC.
- Install the library:
sudo apt install python3-gpiozero, then:
from gpiozero import LED
from time import sleep
led = LED(17) # broche physique 11
while True:
led.toggle
sleep(0.5)
Verification
gpioinfo (gpiod package) lists gpiochip0; the LED blinks once per second. Stop with Ctrl-C.
Common errors
- Confusing physical numbering (11) with GPIO numbering (17) — gpiozero uses GPIO numbers.
- Wiring to pins 2/4 which supply 5 V instead of 3.3 V.
- Overloading the header: beyond 50 mA cumulative, the board crashes before any protection kicks in.
- Solder bridge: check with a magnifying glass and multimeter before powering up.
Other tutorials for this board
- Premier démarrage headless de la Zero W (Wi-Fi + SSH)
- Se connecter au Wi-Fi en ligne de commande (nmcli)
- Pi-hole : bloqueur de pub DNS sur Zero W
- Gadget USB : Ethernet sur le port OTG + relais Wi-Fi
- Balise BLE : diffuser un beacon avec le CYW43438
- Nœud capteur autonome sur batterie : énergie et fiabilité
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash