todbot / qtpy-knob

QT Py Media Knob using rotary encoder & neopixel ring
74 stars 11 forks source link
circuitpython knob mousewheel usb usb-hid

QTPy-Knob

QT Py USB Media Knob using rotary encoder & neopixel ring

The QTPy-Knob features:

A small video about it: https://www.youtube.com/watch?v=pt7JgoSlgOg

This is an attempt to make a minimal and easy-to-build version of similar, previous projects like:

Components

Parts needed:

Software

For some of the scripts and for some QT Py variants, there are prebuilt UF2 firmware images in Releases.

Otherwise, software installation consists of:

The CircuitPython installation step is described here: https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython

The last two steps can be accomplished with the below

git clone https://github.com/todbot/qtpy-knob
cd qtpy-knob
pip3 install circup
circup install -r requirements.txt
cp qtpy_knob.py /Volumes/CIRCUITPY/code.py

RP2040 NOTE: And if you have a QTPy RP2040, be sure to copy the "fakerotaryio.py" file to CIRCUITPY as well.

Variations

There are a few variations of the code provided:

Assembly

Steps:

  1. Plug rotary encoder to bottom of QT Py. If your encoder has metal on the bottom, add a bit of tape (Kapton, Scotch, electrical) in between the QT Py and the encoder. If your encoder has mounting tabs, cut them off. Solder the five pins.

  2. Print out the enclosure on your 3d printer. Standard 0.2mm at 20% infill is fine. The STL files are:

Use the rotary encoder's washer & screw to hold QTPy+encoder assembly

  1. Solder three wires to the Neopixel ring, insert the ring into the enclosure and solder the wires to the 3V, Gnd, and MI pins of the QT Py. Use a bit of hot glue to secure the Neopixel ring if it doesn't snap in.

  2. Snap the bottom cap on and the knob top on and you're done with physical assembly!

Wiring diagram

Assembly animation

Useful links

Resources that helped me out on this: