Skip to content

DS21 4-Knob (b70_ds21_encoder) ​

17-key + 4-knob numpad PCB · USB wired · QMK firmware · VIA

b70_ds21_encoder is the four-knob version of the CZMao DS21 numpad: STM32F103CBT6 (Blue Pill), 4-column × 8-row matrix, four EC11 encoders mapped to virtual key positions, so every knob's CW / CCW turn can be remapped independently in VIA. Per-key WS2812 RGB (south-facing). QMK firmware, open source, VIA-compatible.

1. Specifications ​

ItemValue
PCB modelb70_ds21_encoder (DS21 encoder edition)
Keys17 keys + 4 knobs
Matrix4 columns × 8 rows (COL2ROW)
ConnectionUSB wired (single mode)
PortUSB Type-C (C-to-C supported)
MCUSTM32F103CBT6 (Blue Pill)
Knobs4 × EC11 incremental encoder
USB VID / PID0x4A07 / 0x4A07
VIA device namemao_ds21_R1
LightingWS2812 per-key RGB @ B13 (south-facing), 22 LED positions
Default effectcycle_left_right
Layers4 (0–3, editable in VIA)
N-key rolloverYes (NKRO, toggleable)
Polling rate1000 Hz
FirmwareQMK (open source)
Keymap toolVIA (web)
Source codegithub.com/micahyy/czm_qmk

2. Hardware / pinout (PCB design) ​

FunctionPin / value
Matrix rowsB11, B10, B12, B1, C15, A0, B9, B8
Matrix colsB7, B6, B5, B4
Diode directionCOL2ROW
WS2812 data pinB13
Bootloaderstm32duino

2.1 Knob pins and virtual key positions ​

Knobpin_apin_bCWCCW
Knob 1A1A2row 6 / col 0row 6 / col 1
Knob 2A3A4row 6 / col 2row 6 / col 3
Knob 3A5A6row 7 / col 0row 7 / col 1
Knob 4A7B0row 7 / col 2row 7 / col 3

Rows 6 and 7 are virtual positions with no physical switch — they exist for the 4 knobs (the firmware LAYOUT has 30 positions: 22 key positions + 8 knob positions). In VIA these 8 positions are the knob actions and can be set per layer, e.g. volume on layer 0, page up/down on layer 1.

Knob direction is flipped globally (ENCODER_DIRECTION_FLIP), 4 steps per detent (ENCODER_RESOLUTION).

3. Lighting ​

  • WS2812 per-key RGB, 22 LED positions, default effect "cycle left/right", max brightness 180.
  • NumLock indicator: LED 5 lights white while NumLock is on.
  • Layer indicator: LEDs 16 / 17 / 18 light white on layers 1 / 2 / 3.
  • Effect, brightness, speed and color can be changed from the VIA Lighting tab or with the shortcuts below.

4. Layers and shortcuts ​

4 layers (0–3). Extra layers are reached by holding the operator keys in the top-left of the numpad (tap = the operator itself, hold = layer).

ActionResult
Hold NumLayer 1 (tap = NumLock)
Hold / (PSLS)Layer 2 (lighting / maintenance)
Hold * (PAST)Layer 3
Hold - (PMNS)Layer 4

4.1 Layer 0 (default) ​

AreaKeys
Top rowESC, Calc, Play/Pause, Backspace, Mute
Operator rowNum, /, *, -
Numpad7 8 9 / 4 5 6 + / 1 2 3 Enter / 0 (2u) .
Knobs (default)Knob 1: Del / Backspace; Knob 2: PgUp / PgDn; Knob 3: prev / next track; Knob 4: volume - / +

4.2 Layer 1 (hold Num) ​

PositionKey
/Num
*Layer 2 (MO(2))
-Calc
8Volume +
4 / 5 / 6Prev / Play-Pause / Next
2Volume -
0Mute

4.3 Layer 2 (hold / — lighting & maintenance) ​

PositionKey
-Brightness + (RM_VALU)
7RGB toggle (RM_TOGG)
8Saturation + (RM_SATU)
4Hue - (RM_HUED)
5Factory reset (EE_CLR)
6Hue + (RM_HUEU)
9Brightness - (RM_VALD)
2Saturation - (RM_SATD)
0Next effect (RM_NEXT)

4.4 Layer 3 (hold *) ​

PositionKey
0NKRO toggle (NK_TOGG)

5. VIA ​

  1. Connect the board over USB and open VIA: CN server | GitHub Pages
  2. On first use, load the keyboard definition in the Design tab: czmao_ds21R1.json (in keyboards/czmao/b70_ds21_encoder/keymaps/via/ of the firmware repo)
  3. Switch back to Configure and remap — changes apply instantly and are stored on the keyboard
  4. All 30 positions are editable; rows 6 and 7 are the 4 knobs

See also: Using VIA

6. Flashing ​

The PCB uses the stm32duino bootloader:

  1. Enter bootloader: unplug USB, hold the top-left key (ESC) and plug back in (QMK Bootmagic Lite). The board enters DFU and stops sending keys.
  2. Flash:
    • QMK Toolbox: pick the compiled .bin and press Flash; or
    • CLI: dfu-util -a 2 -d 1EAF:0003 -D <firmware>.bin
  3. Re-plug the USB cable when done.

7. Building the firmware ​

Source: github.com/micahyy/czm_qmk

make czmao/b70_ds21_encoder:via

GitHub Actions builds it automatically; download from the firmware-b70_ds21_encoder artifact.

8. FAQ ​

Q: VIA does not detect the board? A: Use a WebHID-capable browser (Chrome / Edge) and load czmao_ds21R1.json in the Design tab. Also try another port or cable.

Q: The knob turns the wrong way? A: Swap the two knob positions in VIA, or change ENCODER_DIRECTION_FLIP in config.h and rebuild.

Q: I cannot find the knob positions in VIA? A: They are rows 6 and 7 — the bottom two rows of the VIA keymap view.

Q: My keymap is a mess, how do I reset? A: Hold / (layer 2) and press the 5 position (EE_CLR) to clear the EEPROM.

Q: No light? A: Press the RGB toggle (hold /, then 7); if it is already on, raise brightness (- position on the same layer).


QQ group: 677654482


📥 Firmware & source ​

  • Firmware source (QMK): github.com/micahyy/czm_qmk (PCB path keyboards/czmao/b70_ds21_encoder)
  • VIA definition: czmao_ds21R1.json
  • Prebuilt firmware: GitHub Actions artifact firmware-b70_ds21_encoder

See section 6 "Flashing" for flashing instructions.

评论 / 提问 (填个昵称就能留言,无需注册;邮箱选填,填了能收到回复通知)

Released under the MIT License.