EngineeringMaker LabKits

Build guide

Featured project

Blink an LED

Your first controlled output project teaches the complete edit-upload-test loop. You will identify LED polarity, choose a current-limiting resistor, connect a GPIO output, and change timing in MicroPython.

Last updated

Build Time
20-30 minutes
Estimated Cost
$8-$15
Skill Level
Beginner
Raspberry Pi PicoRaspberry Pi PicoLEDGPIOMicroPython
  • Middle School
  • High School
  • Adult Beginners
  • Homeschool

Skills

What You'll Learn

  • Identify LED anode and cathode polarity
  • Protect an LED with a current-limiting resistor
  • Configure and switch a GPIO output
  • Control timing with a simple program loop

Preparation

Required Parts

Gather these components before starting the build.

  • Qty: 1Raspberry Pi PicoWith header pins installed
  • Qty: 1Solderless breadboardHalf-size is sufficient
  • Qty: 1LEDAny standard 5 mm color
  • Qty: 1220 ohm resistorCurrent limiting
  • Qty: 2Jumper wiresMale-to-male
  • Qty: 1Micro-USB cableData-capable cable

Wiring

Circuit Diagram

GP15 connects through a 220 ohm resistor to the LED anode; the cathode connects to GND.

Build

Step-by-Step Instructions

Work through each stage in order and disconnect power before changing the wiring.

1. Place the LED

Insert the LED across two separate breadboard rows. The longer anode leg will connect toward GP15; the shorter cathode leg will connect to ground.

2. Add the resistor and jumpers

Connect GP15 to one end of the 220 ohm resistor and the other end to the LED anode. Connect the cathode row to a Pico GND pin.

3. Run the program

Connect the Pico, open Thonny, select the MicroPython interpreter, and run the code below. Save it as main.py on the Pico to start automatically.

4. Experiment with timing

Change sleep(0.5) to sleep(0.1) or sleep(1) and run the program again to see how software timing changes a physical output.

Programming

Project Code

Upload main.py after completing the circuit.

main.pypython
from machine import Pin
from time import sleep

led = Pin(15, Pin.OUT)

while True:
    led.toggle()
    sleep(0.5)

Problem solving

Troubleshooting

The LED never lights

Reverse the LED

Thonny cannot find the Pico

Try a known data-capable USB cable and select the MicroPython Raspberry Pi Pico interpreter.

The LED is very dim

Check for a resistor value much larger than 220 ohms and make sure every jumper is firmly seated.

Common questions

FAQ

Can I use the onboard LED instead?

Yes. On an original Pico use Pin 25; some Pico variants support Pin LED.

Can I change the blink speed?

Yes. Reduce or increase the value passed to sleep; the value is measured in seconds.

Why is the resistor required?

It limits current to protect both the LED and the Pico GPIO pin.

Go deeper

Related Tutorials and Resources

Project complete

Ready for Traffic Light?

Build a timed red, yellow, and green traffic light sequence with three GPIO outputs.

Reuse your kit

More projects you can build with this kit

Keep using the SunFounder Raspberry Pi Pico Ultimate Starter Kit instead of starting with a new parts list.