

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
3PMZB200UNEYL
SOT-883-3-55℃~+150℃ 1 N-channel 1.4A 2.7nC@4.5V 250mΩ@4.5V 30V 350mW 89pF 950mV 9pF SOT-883-3 MOSFETs ROHSNexperiaMOSFETsBC847BDW1
SOT-363-55℃~+150℃ 100MHz 100mA 150 2 NPN 250mV 380mW 45V 5uA 6V NPN SOT-363 Bipolar (BJT) ROHSonsemiBipolar (BJT)BC857BDW1
SOT-363-55℃~+150℃ 100MHz 100mA 2 PNP 220 250mW 45V 4uA 5V 650mV PNP SOT-363 Bipolar (BJT) ROHSonsemiBipolar (BJT)
README
README.mdRTB_D21
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
- RTB_D12 - custom (Fleischmann V100)
- RTB_D13 - custom (Minitrix coach)
- RTB_D15 - custom (Minitrix V160)
- RTB_D16 - NEM651
- RTB_D20 - NEM651
- RTB_D22 - Plux16
- RTB_D23 - NEM652
User Guides
- User Guide - DE
- User Guide - EN
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
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 | |
|---|---|
| pcb | Name of matching hardware (D21) |
| code | Type of code contained (R=rom, B=bootloader, F=flash, U=bld update, P=UPDI factory code) |
| version | Release version (####) |
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 Setting | P-code Install |
|---|---|
| <img src=supplemental/images/D21_updi_fuses.jpg width=500> | <img src=supplemental/images/D21_updi_memory.jpg width=500> |
Images
| top | bottom |
|---|---|
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| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | NSR20F40NXT5G | RTB:NSR20F40NXT5G | D2, D3, D4, D5, D6, D7 |
| 4 | 10k | Resistor_SMD:R_0402_1005Metric | R5, R6, R11, R12 |
| 4 | 10u/6.3V | Capacitor_SMD:C_0402_1005Metric | C1, C5, C8, C9 |
| 4 | 33k | Resistor_SMD:R_0402_1005Metric | R1, R2, R15, R17 |
| 4 | PMZB200UNEYL | Package_DFN_QFN:Diodes_DFN1006-3 | Q3, Q4, Q5, Q6 |
| 3 | 10u/25V | Capacitor_SMD:C_0603_1608Metric | C2, C4, C7 |
| 3 | 220k | Resistor_SMD:R_0402_1005Metric | R7, R8, R14 |
| 3 | pad | RTB:Solder 0.8 x 0.5 | J1, J2, J3 |
| 2 | 12k | Resistor_SMD:R_0402_1005Metric | R16, R18 |
| 2 | 9.1k | Resistor_SMD:R_0402_1005Metric | R9, R10 |
| 1 | 1 | Resistor_SMD:R_0402_1005Metric | R19 |
| 1 | 100n/50V | Capacitor_SMD:C_0402_1005Metric | C10 |
| 1 | 1k | Resistor_SMD:R_0402_1005Metric | R13 |
| 1 | 1u/50V | Capacitor_SMD:C_0402_1005Metric | C6 |
| 1 | 22 | Resistor_SMD:R_0402_1005Metric | R4 |
| 1 | 3.3k | Resistor_SMD:R_0402_1005Metric | R3 |
| 1 | AVR64DD28-I_STX | Package_DFN_QFN:QFN-28-1EP_4x4mm_P0.4mm_EP2.3x2.3mm | IC1 |
| 1 | BC847BDW1 | Package_TO_SOT_SMD:SOT-666 | Q1 |
| 1 | BC857BDW1 | Package_TO_SOT_SMD:SOT-666 | Q2 |
| 1 | DRV8231ADSGR | RTB:SON50P200X200X80-9N | IC3 |
| 1 | LED | LED_SMD:LED_0402_1005Metric | D1 |
| 1 | NCP730BMT330TBG | Package_SON:WSON-6-1EP_2x2mm_P0.65mm_EP1x1.6mm_ThermalVias | IC2 |
| 1 | Next18 | RTB:AXK6F16347YG | J10 |
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 mm

- 6 layers15.3 × 11.4 mm

- 4 layers50.9 × 15.5 mm

- 4 layers76 × 11 mm

- 6 layers17 × 10.9 mm

- 6 layers17 × 10.9 mm

- 4 layers160.8 × 12 mm

- 4 layers34 × 26 mm
