GithubHelp home page GithubHelp logo

qtpy-knob's Introduction

QTPy-Knob

QT Py USB Media Knob using rotary encoder & neopixel ring

The QTPy-Knob features:

  • Media knob for volume up/down/mute with "qtpy-knob.py" CircuitPython program
  • Stylish design reminiscent of Griffin Powermate
  • Recessed USB-C connector to for safety
  • No screws needed for assembly
  • Only 3 wires needed to solder (none if you want to forgo LED lighting)
  • Reprogrammable for any USB macro key action via CircuitPython

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:

  • Install CircuitPython on the QT Py
  • Install required CircuitPython libraries to QT Py
  • Copy qtpy_knob.py to QT Py

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.

  1. Print out the enclosure on your 3d printer. Standard 0.2mm at 20% infill is fine. The STL files are:
  • qtpyknob-base.stl -- Base that houses the QT Py & rotary encoder
  • qtpyknob-basecap.stl -- Cap that goes on the bottom of the base
  • qtpyknob-knob.stl -- Knob that you turn
  • qtpyknob-diffuser.stl -- Light diffuser that goes between base & knob, should be printed with translucent or clear plastic. Or you can leave it out. Or you can approxiate it with a disk cut out clear plastic like a CD case

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.

  1. 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:

qtpy-knob's People

Contributors

todbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

qtpy-knob's Issues

Renaming to avoid "-" and use "_".

Thank you for this piece of code and great idea.

Just a suggestion to avoid "-" into python file name and user "_" instead.

This permit to never rename the original file from the project and have a code.py like this:

import qtpy_knob_simple
#import qtpy_knob_scroller
#import qtpy_knob

PS: I have both QT-Py and Seeduino XIAO in the same form factor... my QT-Py is more precious because it has reset button, Stemma-QT pin, RGB. So I wanted to rename the pin for XIAO use... but there is no need, your code works out of the box on the same physical pin with the same code. Only the through hole seems smaller on the XIAO so it does not fit perfectly flush. Did I mention it does also kind of work without soldering!!!

minor issues around encoder fit

Noticed a couple of things when using the specified Bourns PEC11-4215F-S24 encoder:

  1. The diffuser ring is too thick for the lock nut to fasten. It's 2 mm thick, and there's exactly 2 mm of thread left on the encoder.
  2. The D-shaft cutout in the top is too deep to allow the encoder shaft switch to trigger.

Otherwise, it's a fantastic project and very easy to make. Yes, I used a Seeeduino XIAO, too

Workarounds

I made the central part of the diffuser thinner so the lock nut would fasten. Excuse the OpenSCAD, it's all I know:

bbox = [ 49.988811, 49.994404, 2.000000 ];
minima = [ -25.000000, -24.997202, 2.700000 ];

difference() {
    translate([-bbox.x/2, -bbox.y/2, 0])translate(-minima)import("qtpyknob-diffuser.stl");
    translate([0,0,0.8])cylinder(d=bbox.x/2, h=bbox.z);
}

For the D-shaft cutout, a blob of Blu Tack of just the right size mostly fixes the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.