Files

README.md

rp24-dcc-decoder

DIY DCC decoder for model railroad locomotives in an E24 form factor suitable for N scale/gauge locomotives

decoder top decoder bottom

Features

  • 8x MOSFET-switched functions
  • 5x GPIO pins (3.3V input/output)
  • Up to 0.75A motor current
  • E24 form factor (approx 20mm x 9mm)
  • i2s audio speaker output
  • 12V nominal rail voltage (16V max)

USB Programmer/E24 Tester

programmer top - USB-C port for easy programming and loading sound files - Onboard LEDs for all aux outputs for simple decoder testing - Breakout header for most E24 pins, including speaker, motor, rectified rail power, Vcc, plus all five E24 GPIO pins (Aux 3, 4, 10, 11, 12) - Programming track input header allows for stationary decoder testing and CV programming

RP24 Decoder Pinout

E24 Pin Function GPIO Pin
1 Speaker+ USB D+
2 Speaker- USB D-
3 GND GND
4-5 Motor- N/A
6-7 Motor+ N/A
8 Cap+ GPIO20
9 Lamp Front GPIO6 (MOSFET)
10 Lamp Rear GPIO7 (MOSFET)
11 AUX1 GPIO8 (MOSFET)
12 AUX2 GPIO5 (MOSFET)
13 AUX8 GPIO4 (MOSFET)
14 AUX7 GPIO3 (MOSFET)
15 AUX6 GPIO9 (MOSFET)
16 AUX5 GPIO2 (MOSFET)
17 U+ DC Rail Voltage
18 Vcc 3.3V
19 AUX10 GPIO10
20 AUX4 GPIO13
21 AUX3 GPIO14
22 GND GND
23 AUX11 GPIO0
24 AUX12 GPIO1
N/A Motor Driver A GPIO25
N/A Motor Driver B GPIO26
N/A Back EMF A GPIO28
N/A Back EMF B GPIO29
N/A ADC Reference (ADC pin connected to GND) GPIO27
N/A DCC signal TTL GPIO21
N/A RailCom Out GPIO11
N/A Status LED GPIO19
N/A i2s DIN GPIO22
N/A i2s BCLK GPIO23
N/A i2s LRCLK GPIO24
N/A Charge external keepalive capacitor (PWM at very low duty cycle only) GPIO20

E24 Receiver/Wire Breakout Board

receiver top receiver bottom

Receiver Board Solder Pads

E24 Pin Function Label
1 Speaker+ SPK
2 Speaker- SPK
3 GND G
4-5 Motor- - MOTOR +
6-7 Motor+ - MOTOR +
8 External Capacitor+ C
9 Lamp Front F LAMP R
10 Lamp Rear F LAMP R
11 AUX1 1
12 AUX2 2
17 DC Rail Voltage RV
18 Microcontroller Voltage Output Vcc
19 AUX10 10
20 AUX4 4
21 AUX3 3
22 GND G
23 AUX11 11
24 AUX12 12

Inspired by the rp2040-decoder project by gab-k: <![CDATA[]]>https://github.com/gab-k/RP2040-Decoder<![CDATA[]]>

Reference:

E24

RailCom

View this project on CADLAB.io.

Report a bug