Skip to the content
2 layers19.4 × 60.2 mmRedUSB, the printed circuit board in 3D

RedUSB is a DIY USB macro device: a custom PCB built around an Adafruit KB2040 (RP2040) that acts as a programmable USB HID keyboard.

Size
19.4 × 60.2 mm
Copper layers
2
Thickness
1.6 mm
Parts
14
Nets
32
Pads
65
Tracks, vias
80, 10
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
5 Sep 2026
Updated
5 Nov 2026

Overview

RedUSB is an open-source printed circuit board by dd060606, from the dd060606/RedUSB repository on GitHub. It is a 2-layer board of 19.4 × 60.2 mm with 14 parts on 32 nets, routed with 80 tracks and 10 vias.

It is built around the USBLC6-2SC6 and JS102011SAQN. Its parts include 5 resistors, 2 ICs, 2 switches, 1 capacitor and 1 diode.

Main components

2

README

README.md

RedUSB

RedUSB is a DIY USB macro device: a custom PCB built around an Adafruit KB2040 (RP2040) that acts as a programmable USB HID keyboard. You write simple scripts in a Ducky-Script–style language, drop them onto the device like a USB stick, and play them back as real keystrokes.

A single physical switch flips the device between two personalities:

  • Config mode : the device appears as a USB flash drive. Copy your .txt scripts onto it.
  • Attack mode : the device appears as a USB keyboard. The selected script runs automatically on connect (or on a button press).

The firmware is written in Rust (no_std) and runs bare-metal on the RP2040.


Features

  • Ducky-Script–style language : STRING, DELAY, REPEAT, key combos (GUI r, CTRL ALT t, ...), and more.
  • Up to 16 scripts on the device, selectable with the button; an RGB LED shows which one is active.
  • Auto-run on connect : in attack mode the selected script fires once the host is ready.
  • US / French (AZERTY) keyboard layouts, switchable per script with LAYOUT.
  • Conditional execution per host OS with IF_OS / ELSE / END_IF (best-effort detection).
  • Firmware updates over USB (UF2), no external programmer required.

How it works

The mode switch (GPIO8) selects the personality at power-up:

SwitchModeUSB deviceButton does
To GND (low)ConfigMass storage (REDUSB drive)Cycle the selected script
Open (high)AttackHID keyboardRun the selected script

Flipping the switch while plugged in reboots the device into the other mode.

Config mode

The device mounts as a FAT drive named REDUSB. Copy script files (.txt) onto it. Each button press selects the next script, and the LED shows its slot color so you know which one is armed. The selection is saved to flash and survives power cycles.

Attack mode

The device enumerates as a USB keyboard. About a second after the host finishes setting it up, the selected script runs automatically. You can also press the button at any time to re-run it.

Safety: because the script auto-runs on connect, make sure the right script is selected and the intended window is focused before you plug into attack mode. Only use this on machines you are authorized to test.


Hardware

  • MCU board: Adafruit KB2040 (RP2040, 8 MB QSPI flash)
  • Push button on GPIO5 (active-low, to GND)
  • Mode switch on GPIO8 (active-low, to GND)
  • RGB LED (common anode, active-low): blue = GPIO2, red = GPIO3, green = GPIO4
  • USB-A connector and a 500 mA resettable fuse on the PCB

KiCad sources, the 3D model, and production/assembly files live in PCB/ and 3D/.


Repository layout

text
RedUSB/
├── 3D/            Mechanical / enclosure model
├── PCB/           KiCad project and fabrication files
├── Firmware/      Rust firmware (Cargo workspace)
│   ├── core/      Hardware-independent logic: FAT, Ducky engine, layouts (host-tested)
│   └── firmware/  RP2040 binary: USB, flash storage, LED, button, modes
├── scripts/       Ready-to-run test / example scripts
└── README.md

Building and flashing

Prerequisites

Install the Rust toolchain (the correct target is pinned by rust-toolchain.toml), then the two build/flash helpers:

bash
cargo install flip-link      # linker used by the firmware
cargo install elf2uf2-rs     # builds the UF2 and copies it to the board

All firmware commands below are run from the Firmware/firmware/ directory.

Flashing

cargo run --release builds and flashes in a single step : the project's Cargo runner converts the firmware to a .uf2 and copies it to the board, so there's no separate build command to remember.

  1. Put the board into bootloader mode. It should appear as the RPI-RP2 drive:
    • First flash (blank board): hold the BOOT button on the KB2040 itself while plugging in the USB cable.
    • Updating an already-flashed board: set the mode switch to Config, hold the PCB button (GPIO5), then plug in : the firmware reboots straight into the bootloader.
  2. Flash it:
    bash
    cargo run --release
    The board reboots into the new firmware when it finishes.

To just compile without flashing (for example to check it builds), use cargo build --release.


Writing and running scripts

Scripts are plain .txt files placed in the root of the REDUSB drive (config mode). Filenames follow the FAT 8.3 convention (up to 8 characters before the extension), and scripts are sorted by name, so prefixes like 1_, 2_ give a predictable order. Up to 16 scripts are tracked.

See the scripts/ folder for ready-to-run examples that exercise every feature.

Workflow

  1. Set the switch to Config and plug in. The REDUSB drive appears.
  2. Copy your .txt script(s) onto it.
  3. Press the button to select a script (the LED color tells you which : see below).
  4. Focus the target window, then set the switch to Attack and plug in. The selected script runs automatically (or press the button).

Script language

CommandExampleMeaning
REMREM a commentComment, ignored
STRINGSTRING helloType text (no newline)
STRINGLNSTRINGLN helloType text, then Enter
DELAYDELAY 500Wait 500 ms
DEFAULT_DELAYDEFAULT_DELAY 50Pause after every command
REPEATREPEAT 3Repeat the previous command 3 more times
LAYOUTLAYOUT FRKeyboard layout for STRING (US or FR)
Key / comboGUI r, CTRL ALT t, ENTER, F5Press a key, optionally with modifiers
IF_OS … ELSE … END_IFIF_OS WINDOWSRun a block only on a given OS
OS_REPORTOS_REPORTType the detected OS and USB enumeration counters (diagnostic)

Modifiers: CTRL, SHIFT, ALT, GUI/WINDOWS, ALTGR. The default layout is French (AZERTY).


LED reference

Config mode : selected script slot:

Slot01234567
ColorRedGreenBlueYellowCyanMagentaWhiteOrange

(Slots 8–15 use the same colors, blinking. A slow white "breathing" glow means no scripts are present.)

Attack mode:

LEDMeaning
Dim selected-slot colorIdle, ready
Solid whiteScript running
Red flash (1.5 s)No script to run
Magenta flashKeystroke timed out (host not accepting input)
Orange flashScript line could not be parsed
Yellow flashScript file could not be read from flash
Cyan flashMalformed IF_OS / ELSE / END_IF

Debugging

For everyday use the LED is enough. For detailed logs, the firmware emits defmt over RTT, which needs an SWD debug probe (for example a second Raspberry Pi Pico flashed as a debug probe) wired to the KB2040's SWD pads:

bash
cargo install probe-rs-tools
probe-rs attach --chip RP2040 target/thumbv6m-none-eabi/release/firmware

Host-side logic in core/ is unit-tested:

bash
cd Firmware/core && cargo test

License

MIT © dd060606

Parts

14
QtyValueFootprintReferences
2150RResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR4, R5
227RResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR1, R2
1100nFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC1
1220RResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR3
1500mAFuse:Fuse_0805_2012Metric_Pad1.15x1.40mm_HandSolderF1
1629004113921629004113921:629004113921J1
1EVQ-P7A01PEVQ_P7A01P:SW_EVQ-P7A01PS1
1JS102011SAQNJS102011SAQN:SW_JS102011SAQNS2
1LOGOLOGOG***
1USBLC6-2SC6Package_TO_SOT_SMD:SOT-23-6_HandsolderingU2
1WL-SFTW_3528_PLCC4LED_SMD:LED_RGB_Wuerth-PLCC4_3.2x2.8mm_150141M173100D1
1kb2040kb2040:kb2040U1

Similar boards

  • 4 layers160 × 145 mmCarrier, the printed circuit board in 3D

    Carrier

    OrbitalCommons/gumstick

    Gumstick: ESP32 + iCE40UP5K FPGA module (v1 DF40 board-to-board, v2 M.2 gold-finger draft) and its programming carrier. KiCad 10.

    222 parts1MIT
  • 4 layers85 × 120 mmGameboy, the printed circuit board in 3D

    Gameboy

    MeesCode/gameboy-pcb

    custom gameboy-esque pcb running an stm32 and my own tiny game engine

    134 parts
  • 4 layers125 × 100 mmMacropad, the printed circuit board in 3D

    Macropad

    Michael-Lloyd/macropad

    A simple macropad powered by an 18650, with bluetooth capabilities.

    66 parts
  • 2 layers64.3 × 24.5 mmIntercom, the printed circuit board in 3D

    Intercom

    tylerreckart/arthur

    A silicon assistant.

    62 parts
  • 4 layers55 × 55 mmLovelace as-001, the printed circuit board in 3D

    Lovelace as-001

    chanulee/audiostream-esp32

    Airplay 2 + Spotify Connect + Bluetooth

    63 parts
  • 4 layers66 × 100 mmBase, the printed circuit board in 3D

    Base

    Galm007/KiCad-Pixy-M2

    Schematic For Our Micromouse Robot "Pixy M2"

    78 partsMIT
  • 4 layers36 × 50.2 mmRacer, the printed circuit board in 3D

    Racer

    StuckAtPrototype/Racer

    These are structured into their own files. I could have used submodules, but decided against it.

    83 parts3.8kApache-2.0
  • 4 layers38 × 49 mmNDS TV OUT V1I2, the printed circuit board in 3D

    NDS TV OUT V1I2

    LNH-team/Lost-NDS-TV

    The Lost Nintendo DS Television Output, brought back to life

    48 parts488GPL-3.0

Questions

How big is the RedUSB PCB?

It measures 19.4 × 60.2 mm and has 2 copper layers, 1.6 mm thick.

What parts does the RedUSB use?

14 parts, built around the USBLC6-2SC6 and JS102011SAQN. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the RedUSB KiCad files?

From the dd060606/RedUSB repository on GitHub, at the commit this page was made from: the board is PCB/RedUSB.kicad_pcb and its schematic PCB/RedUSB.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the RedUSB design in my own project?

Its repository states no licence, so its author keeps all rights: ask dd060606 before reusing the design.