Skip to the content
PCBKitNew board
6 layers15.2 × 9.5 mmD21, the printed circuit board in 3D

DCC / Railcom decoder (Next18, double sided)

Size
15.2 × 9.5 mm
Copper layers
6
Thickness
0.8 mm
Parts
48
Nets
43
Pads
169
Tracks, vias
458, 69
Pours
3
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
15 Nov 2024
Updated
9 Jul 2026

Overview

D21 is an open-source printed circuit board by git4dcc, from the git4dcc/RTB_D21 repository on GitHub, published under the Apache-2.0 licence. It is a 6-layer board of 15.2 × 9.5 mm with 48 parts on 43 nets, routed with 458 tracks and 69 vias.

It is built around the PMZB200UNEYL, BC847BDW1 and BC857BDW1. Its parts include 19 resistors, 9 capacitors, 7 diodes, 6 transistors and 4 connectors.

Main components

3

README

README.md

RTB_D21

Real-time Bus (RTB) Kicad_Libs Apache License 2.0

My Homebrew D21 decoder is a double sided mobile decoder with Next18 (NEM-662) connector. The decoder is designed to integrate into the RTB digital control infrastructure.

See also
User Guides

Decoder features

  • Next18 (NEM-662) connector
  • DCC
    • DCC-A automatic logon
    • DCC-R protocol extension
    • Service Mode Programming
  • Railcom
    • Channel 1/2
    • POM, xPOM
    • DYN: Speed, QoS, Track-voltage, Motor-current, AUX-current, Temp, Distance travelled
  • Double sided
  • Dimension: 15 x 9.5 mm
  • 7-20V track voltage
  • heartbeat LED
  • adjustable max motor current (default 300mA)
  • adjustable max AUX current (default 500mA)
  • over temp protection
  • Function output: LF/LR (dimmable, 1.4kHz) open drain
  • Function output: AUX1/AUX2 (dimmable, 1.4kHz) open drain
  • Function output: AUX3/AUX4 logic level or ZBCLK/ZBDAT
  • Function output: AUX5/AUX6 logic level
  • optional external buffer capacitor (max. 1500uF)
  • <10mA idle power consumption
  • SUSI3 (logic level)
  • Firmware update over main tracks via DCC-R protocol

Hardware

The current PCB layout uses SMD footprints with 0.5mm pitch and 0402 parts. Reflow soldering is recommended.

PCB

  • 6-layer PCB, FR4, 15 x 9.5 x 0.8mm (double sided)
  • Power: 3.3V or 5V
  • CPU: AVR64DD28
  • Motor bridge: DRV8231
  • Connector: Next18 (NEM-662)

Kicad

Schematic | Layout

Dependency

:yellow_circle: Requires my Kicad project library RTB_SamacSys in the same directory tree.

Firmware

Filename structure: { pcb }{ code }{ version }.hex

Example: D21F0001.hex

Description
pcbName of matching hardware (D21)
codeType of code contained (R=rom, B=bootloader, F=flash, U=bld update, P=UPDI factory code)
versionRelease version (####)

Firmware files

UPDI

The fuse settings as well as the P-code (D21Pxxxx.hex) has to be installed by using UPDI.
Connecting the decoder via its track pins to a 5V(DC) power supply will boot its CPU. This way, its easy to program the fuses and flash.

<img src=supplemental/images/D21_updi.jpg width=800>

Details
Fuse SettingP-code Install
<img src=supplemental/images/D21_updi_fuses.jpg width=500><img src=supplemental/images/D21_updi_memory.jpg width=500>

Images

topbottom

YouTube

Some YouTubes to see the D21 motor driver in action.

This project is intended for hobby use only and is distributed in accordance with the Apache License 2.0 agreement.

Parts

48
QtyValueFootprintReferences
6NSR20F40NXT5GRTB:NSR20F40NXT5GD2, D3, D4, D5, D6, D7
410kResistor_SMD:R_0402_1005MetricR5, R6, R11, R12
410u/6.3VCapacitor_SMD:C_0402_1005MetricC1, C5, C8, C9
433kResistor_SMD:R_0402_1005MetricR1, R2, R15, R17
4PMZB200UNEYLPackage_DFN_QFN:Diodes_DFN1006-3Q3, Q4, Q5, Q6
310u/25VCapacitor_SMD:C_0603_1608MetricC2, C4, C7
3220kResistor_SMD:R_0402_1005MetricR7, R8, R14
3padRTB:Solder 0.8 x 0.5J1, J2, J3
212kResistor_SMD:R_0402_1005MetricR16, R18
29.1kResistor_SMD:R_0402_1005MetricR9, R10
11Resistor_SMD:R_0402_1005MetricR19
1100n/50VCapacitor_SMD:C_0402_1005MetricC10
11kResistor_SMD:R_0402_1005MetricR13
11u/50VCapacitor_SMD:C_0402_1005MetricC6
122Resistor_SMD:R_0402_1005MetricR4
13.3kResistor_SMD:R_0402_1005MetricR3
1AVR64DD28-I_STXPackage_DFN_QFN:QFN-28-1EP_4x4mm_P0.4mm_EP2.3x2.3mmIC1
1BC847BDW1Package_TO_SOT_SMD:SOT-666Q1
1BC857BDW1Package_TO_SOT_SMD:SOT-666Q2
1DRV8231ADSGRRTB:SON50P200X200X80-9NIC3
1LEDLED_SMD:LED_0402_1005MetricD1
1NCP730BMT330TBGPackage_SON:WSON-6-1EP_2x2mm_P0.65mm_EP1x1.6mm_ThermalViasIC2
1Next18RTB:AXK6F16347YGJ10

Questions

How big is the D21 PCB?

It measures 15.2 × 9.5 mm and has 6 copper layers, 0.8 mm thick.

What parts does the D21 use?

48 parts, built around the PMZB200UNEYL, BC847BDW1 and BC857BDW1. 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 D21 KiCad files?

From the git4dcc/RTB_D21 repository on GitHub, at the commit this page was made from: the board is D21.kicad_pcb and its schematic D21.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the D21 design in my own project?

Its repository publishes it under the Apache-2.0 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

  • 6 layers14 × 8 mmD20, the printed circuit board in 3D

    D20

    git4dcc/RTB_D20

    DCC / Railcom decoder (NEM651, double sided)

    51 parts1Apache-2.0
  • 6 layers15.3 × 11.4 mmD22, the printed circuit board in 3D

    D22

    git4dcc/RTB_D22

    DCC / Railcom decoder (Plux16, double sided)

    48 parts1Apache-2.0
  • 4 layers50.9 × 15.5 mmD12, the printed circuit board in 3D

    D12

    git4dcc/RTB_D12

    DCC Railcom Decoder FLM V100

    72 partsApache-2.0
  • 4 layers76 × 11 mmD15, the printed circuit board in 3D

    D15

    git4dcc/RTB_D15

    Minitrix V160 N-Scale Locomotive Decoder (DCC/RailCom)

    83 partsApache-2.0
  • 6 layers17 × 10.9 mmD24, the printed circuit board in 3D

    D24

    git4dcc/RTB_D24

    DCC / Railcom decoder (NEM651, single sided), WS28xx

    53 partsApache-2.0
  • 6 layers17 × 10.9 mmD16, the printed circuit board in 3D

    D16

    git4dcc/RTB_D16

    DCC / Railcom decoder (NEM651, single sided)

    43 parts2Apache-2.0
  • 4 layers160.8 × 12 mmD13, the printed circuit board in 3D

    D13

    git4dcc/RTB_D13

    DCC/RailCom Function Decoder for Minitrix Passenger Cars

    153 partsApache-2.0
  • 4 layers34 × 26 mmCamera, the printed circuit board in 3D

    Camera

    freemocap/skellycad

    for cad stuff

    119 partsAGPL-3.0