Skip to the content
PCBKitNew board
2 layers27.5 × 47.6 mmOptical encoder pcb, the printed circuit board in 3D

A standalone pcb for ploopy's optical encoder design.

Size
27.5 × 47.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
9
Nets
16
Pads
32
Tracks, vias
36, 9
Pours
2
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
30 Jun 2025
Updated
1 Jul 2025

Overview

Optical encoder pcb is an open-source printed circuit board by christrotter, from the christrotter/optical-encoder-pcb repository on GitHub, published under the MIT licence. It is a 2-layer board of 27.5 × 47.6 mm with 9 parts on 16 nets, routed with 36 tracks and 9 vias.

It is built around the XZTHI56W-1 and PT26-51B/TR8. Its parts include 4 resistors, 2 ICs, 2 diodes and 1 connector.

Main components

2

README

README.md

optical-encoder-pcb

A standalone pcb for Ploopy's optical encoder design.

Status

I decided not to go ahead with this mainly because QMK doesn't really support quadrature and custom encoder drivers simultaneously (and why would they? - so bougie). Also, the infrared leds are not in stock.

The theory was that I'd use the optical encoder for the mk20's 'ring' encoder, as it'd have less operating friction.

Anyways, I think the basics here would work - obviously I spent very little time on the pcb design.

How it works

Pretty simple - until you get to the maths and code.

  • a pair of infrared led/sensor combos aiming 'through' the scroll wheel
  • matching resistors
  • scroll wheel with a specific amount of holes to let light pass through
  • lit up = analogue pin high; darkened = low

Basically you have power, ground, analog1, analog2. When the LED light is interrupted by the wheel, the analog input goes low and thus the computer can do something about it. Your polling code looks at the analog inputs and determines what to do based on the combinations of on/off received over a time period.

I also used a VIK connector cuz why not: https://github.com/sadekbaroudi/vik/

Fun sidenote - the silicone surface on their scroll wheel is actually a silicone ring (on Aliexpress, search 'silicone ring fish scale').

Further reading

https://www.eeworldonline.com/rotary-encoders-part-1-optical-encoders/ https://github.com/ploopyco/qmk_firmware/blob/master/keyboards/ploopyco/common/opt_encoder_simple.c https://github.com/ploopyco/qmk_firmware/blob/master/keyboards/ploopyco/ploopyco.c#L101 https://github.com/ploopyco/classic-trackball/tree/master/hardware/Electronics/Schematics

My take on the design

Schematic PCB

Parts

9
QtyValueFootprintReferences
2100Resistor_SMD:R_0805_2012MetricR1, R3
21kResistor_SMD:R_0805_2012MetricR2, R4
2PT26-51B/TR8MyKicadFootprints:OPTO-SMD_PT26-51B-TR8LED1, LED2
2XZTHI56W-1MyKicadFootprints:LED-SMD_3P-L3.0-W2.5U1, U2
1vik-module-connectorMyKicadFootprints:FPC-SMD_12P-P0.50_HCTL_XW05202-120R-00J1

Questions

How big is the Optical encoder pcb PCB?

It measures 27.5 × 47.6 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Optical encoder pcb use?

9 parts, built around the XZTHI56W-1 and PT26-51B/TR8. 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 Optical encoder pcb KiCad files?

From the christrotter/optical-encoder-pcb repository on GitHub, at the commit this page was made from: the board is optical-encoder-pcb.kicad_pcb and its schematic optical-encoder-pcb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Optical encoder pcb design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers103 × 30.5 mmTS Back Endcap, the printed circuit board in 3D

    TS Back Endcap

    EEVengers/ThunderScope

    ThunderScope GitHub Repo

    9 parts1.3kMIT
  • 2 layers31.8 × 47.6 mmNGC 38 connector, the printed circuit board in 3D

    NGC 38 connector

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    9 parts1.2k
  • 2 layers24 × 27.3 mmExpansion Card Retrofit, the printed circuit board in 3D

    Expansion Card Retrofit

    FrameworkComputer/ExpansionCards

    Reference designs and documentation to create Expansion Cards for the Framework Laptop

    9 parts1.1kCC-BY-4.0
  • 2 layers15.6 × 17.3 mmSKR Mini TFT Thermistor Board, the printed circuit board in 3D

    SKR Mini TFT Thermistor Board

    VoronDesign/Voron-Hardware

    Cool Hardware designed by the Voron Design group

    9 parts1.1kGPL-3.0
  • 2 layers39.1 × 49.5 mmLearnoliver, the printed circuit board in 3D

    Learnoliver

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    9 parts915
  • 2 layers17.4 × 16.9 mmToolhead, the printed circuit board in 3D

    Toolhead

    tanaes/whopping_Voron_mods

    9 parts787GPL-3.0
  • 2 layers9.8 × 108 mmExpander, the printed circuit board in 3D

    Expander

    wntrblm/Castor_and_Pollux

    A Juno-inspired dual oscillator

    9 parts587
  • 2 layersKeyboard after, the printed circuit board in 3D

    Keyboard after

    adamws/kicad-kbplacer

    KiCad plugin for automatic keyboard's key placement and routing

    9 parts547GPL-3.0