Build Your Own DIY Stream Deck with Raspberry Pi Pico W and CircuitPython

Build Your Own DIY Stream Deck with Raspberry Pi Pico W and CircuitPython

BackerLeader posted 3 min read

Ever wanted a simple version of the popular Elgato Stream Deck, but without the high cost, just like me? In this tutorial, you’ll learn how to build a minimal 3-button programmable macro pad using the Raspberry Pi Pico W, CircuitPython, and USB HID. This setup sends keyboard shortcuts to your computer with the press of a button—perfect for productivity, streaming, or just automating your workflow.


What You’ll Need

  • Raspberry Pi Pico W
  • ✅ 3x Push buttons (momentary)
  • ✅ Breadboard and jumper wires
  • ✅ Micro USB cable
  • ✅ CircuitPython installed on your Pico W
  • ✅ Adafruit HID library

Wiring Diagram

Connect the buttons to GPIO pins on the Pico W (GP2, GP3, and GP4) like this:

[Raspberry Pi Pico W Pinout]

GP2  ---- Button 1 ---- GND  
GP3  ---- Button 2 ---- GND  
GP4  ---- Button 3 ---- GND  

Each button is connected between a GPIO pin and GND. We use internal pull-down resistors in the code to detect a HIGH signal when the button is pressed.

⚠️ Note: You can use a breadboard or solder your components on a PCB for a compact build.


How It Works

The buttons are monitored in a loop. When a button press is detected, the Pico W sends a corresponding key combo to your computer over USB using USB HID (Human Interface Device). This acts like a real keyboard.

Here are the assigned functions:

Button Shortcut Action
1 Ctrl + Shift + Esc Open Task Manager
2 Windows + L Lock Your PC
3 Ctrl + Alt + Delete Security Options Menu

Installing CircuitPython & Required Libraries

  1. Install CircuitPython on your Pico W:
    Follow the official guide: https://circuitpython.org/board/raspberry_pi_pico_w/

  2. Add Required Libraries to your lib folder on the CIRCUITPY drive:


Full Code: code.py

import time
import board
import digitalio
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS

kbd = Keyboard(usb_hid.devices)
layout = KeyboardLayoutUS(kbd)

# Define buttons on GP2, GP3, GP4
button_pins = [board.GP2, board.GP3, board.GP4]
buttons = []

for pin in button_pins:
    button = digitalio.DigitalInOut(pin)
    button.direction = digitalio.Direction.INPUT
    button.pull = digitalio.Pull.DOWN
    buttons.append(button)

prev_states = [False] * len(buttons)

while True:
    for i, button in enumerate(buttons):
        current_state = button.value
        if current_state and not prev_states[i]:
            print(f"Button {i+1} pressed")

            if i == 0:
                # Ctrl + Shift + Esc (Task Manager)
                kbd.send(Keycode.CONTROL, Keycode.SHIFT, Keycode.ESCAPE)
            elif i == 1:
                # Windows + L (Lock)
                kbd.press(Keycode.WINDOWS, Keycode.L)
                kbd.release_all()
            elif i == 2:
                # Ctrl + Alt + Delete
                kbd.send(Keycode.CONTROL, Keycode.ALT, Keycode.DELETE)

        prev_states[i] = current_state
    time.sleep(0.05)

Save this as code.py on your Pico W’s CIRCUITPY drive.


Why Use This?

  • Quick PC lock when you leave your desk
  • Instant Task Manager access to close frozen apps
  • Security shortcuts like Ctrl+Alt+Del
  • Can be expanded to more buttons or layered functions
  • Customizable: you can swap key combos anytime

What’s next level for this?

  • Add custom backlit keycaps
  • Use OLED display for labels
  • Add mode switching with layers for different apps (e.g., OBS, Photoshop)
  • Integrate Wi-Fi features using Pico W’s wireless support

Final Thoughts

This DIY stream deck alternative is low-cost, beginner-friendly, and incredibly useful for daily tasks. Whether you're a content creator or just want to speed up your workflow, the Pico W and CircuitPython combo gives you endless possibilities.


Share Your Build

If you tried this out or made your own variation, tag me on Twitter (@am_de_one) or Instagram with your custom setup!

If you read this far, tweet to the author to show them you care. Tweet a Thanks

More Posts

Build a Telegram bot with Phi-3 and Qdrant and chat with your PDFs!

Astra Bertelli - May 9, 2024

Automate GitHub like a pro: Build your own bot with TypeScript and Serverless

Alwil17 - Jul 21

Learn to manage Laravel 10 queues for efficient job handling and implement real-time notifications seamlessly.

Gift Balogun - Jan 1

Writing Your First Interactive Bash Script (With User Input)

Gift Balogun - Jul 4

Testing the performance of Python with and without GIL

Andres Alvarez - Nov 24, 2024
chevron_left