StemmaWeb bridges Adafruit StemmaQT sensors to the browser via WebUSB. Turn physical knobs, sliders, and touch pads into live inputs for creative code — no server, no drivers.
Five steps from hardware to browser — all over USB, no drivers or servers required.
StemmaQT Module
Rotary encoder, touch sensor, gyroscope…
Trinkey RP2040
Reads I²C, speaks USB
USB
Physical connection, no drivers
WebUSB API
Browser talks directly to the Trinkey
p5.js Sketch
Your creative code gets live sensor data
Call startRotaryEncoder() inside p5.js's preload() and the device is ready by the time setup() runs. Read values in draw() or react to events with named callbacks.
Every device follows the same pattern — just swap the start function and method names.
Explore First Steps →let encoder;
function preload() {
encoder = startRotaryEncoder();
}
function setup() {
createCanvas(400, 400);
}
function draw() {
let angle = map(encoder.getValue(), 0, 100, 0, TWO_PI);
background(20);
translate(width / 2, height / 2);
rotate(angle);
fill(99, 102, 241);
rect(-80, -8, 160, 16, 4);
}
function rotaryEncoderChanged(event) {
console.log('Position:', event.detail.value);
}Everything you need, from hardware to running sketch.
Buy the hardware
Pick up an Adafruit Trinkey RP2040 QT and any supported StemmaQT module from the Adafruit shop.
Flash the firmware
Download the prebuilt firmware and drag it onto the Trinkey — it reboots in seconds, no toolchain needed.
Load the library
Add one script tag to your p5.js sketch. The StemmaWeb library registers the start functions automatically.
Write code
Call startRotaryEncoder(), startTouchSensor(), or any other start function and your device is live.
All modules connect via the StemmaQT (JST-SH 4-pin) cable and can be daisy-chained.
CO2 Sensor
0x62Photoacoustic CO₂ sensor that also measures humidity and temperature.
Reference →
Distance Sensor
0x29Time-of-flight laser ranging sensor. Measures distances up to 2 m.
Reference →
Gyroscope
0x6A–0x6B6-DoF IMU with accelerometer and gyroscope. Reports orientation and motion data.
Reference →
Linear Encoder
0x30–0x3FSliding fader with four NeoPixels. Tracks absolute position.
Reference →
NeoDriver
0x60–0x67I²C NeoPixel driver for addressable LEDs. Full RGB color control.
Reference →
NFC Tag
0x2DI²C EEPROM that doubles as an NFC tag. Write NDEF records readable by phones.
Reference →
Pressure Sensor
0x5C–0x5DBarometric pressure and temperature sensor. Supports LPS22 and LPS25 chipsets.
Reference →
RFID Reader
0x30–0x37125 kHz RFID reader. Detects tag presence and reports tag IDs over I²C.
Reference →
Rotary Encoder
0x36–0x3DQuadrature knob with push button and one NeoPixel. Tracks absolute position.
Reference →
Touch Sensor
0x5A–0x5D12-channel capacitive touch controller. Reports touch and release events per pad.
Reference →
Trinkey RP2040
USBThe USB bridge itself. One onboard NeoPixel, controllable from your sketch.
Reference →
UV Sensor
0x53Ambient light and UV index sensor with selectable gain and resolution.
Reference →
From classroom to gallery — StemmaWeb fits wherever creative code meets the physical world.
◎
Learning
Immediate feedback makes physical computing concepts click. Students see the effect of turning a knob in their sketch before writing a single event handler.
◈
Exhibitions
Build interactive installations that run entirely in the browser. No app to install, no backend to maintain — just a USB cable and a URL.
◇
Rapid Prototyping
Test hardware interaction ideas in minutes. Swap devices, tweak mappings, and iterate without touching firmware or wiring a custom PCB.
StemmaWeb is MIT-licensed. The firmware, client library, and this site are all on GitHub. Contributions, bug reports, and feature ideas are welcome.
View on GitHub