Third party cookies may be stored when visiting this site. Please see the cookie information.

PenguinTutor YouTube Channel

Designing a model railway point controller capacitor discharge unit - Railroad CDU

This video explains about an electronics capacitor discharge unit, and how I designed my only variation for controlling model railway points.

In the UK we normally call them railway points, but a common term in the US is a railroad switch. They may also be known as a railway junction, or a railroad crossing.

In the model railway world then these are normally operated by solenoids. Some use servo motors, but this video is specifically for these solenoid point motors.

The video shows a 3D model of a solenoid model railway point motor in action, and explains about the advantages of a Capacitor Discharge Unit (CDU). This is part of a larger project which will involve use of a Raspberry Pi Pico to control point motors for a model railroad.

Model railway point motors

In the UK we normally call railway junctions as railway points, but a common term in the US is a railroad switch. They may also be known as a railway junction, or a railroad crossing.

For model railways, to avoid reaching across the layout it's advantageous to have some form of "remote" control. This could be purely mechanical with levers and wires, but is usually through some kind of electronic point motor. The most common of these are solenoid based, although it is possible to use servo motors or other forms of motors. This article is just about the solenoid types.

Solenoid based model railway point motors

The image below shows a 3D model of a typical point motor. It has two coils on the underneath of a PCB. The two coils are coloured green and yellow on the model, although they are usually either black or the colour of the copper wiring in real life. The silver cylinder is known as an amature or plunger which moves from left to right towards whichever coil is energised. That is connected to the vertical pin which is what moves the level on the point.

3D model of a model railway solenoid based point motor

When the coils are de-energized the pin will remain in it's new position helped by the point which is normally sprung. Latching solenoid point motors are also available, which are particularly useful for home-made points.

Controlling the point motor with a momentary switch

Momentary action toggle switch (on)-off-(on) for model railroad switch control

Point motors can be controlled by using a momentary toggle switch such as the one shown here. This is Single-Pole-Double-Throw (SPDT) switch with centre off. Which can also be described as (on)-off-(on). When in the centre then it is off, but when moved to either side it will connect between the common terminal and the pin associated with that direction. When released the switch will return to the centre off position.

This can be used with the following circuit to move the point the appropriate direction.

switch circuit for model railway point motor

There are a few disadvantages for this circuit, the main things are that if you hold the switch closed for too long then it can result in burning out the coil and that there could be a large in-rush current when the solenoid is first energized meaning that you need to have a overspecified power supply. The in-rush can also result in large spikes which can have a negative effect other electronic circuits.

The capacitor discharge unit overcomes this by first storing a charge into a capacitor and then using that to switch the solenoid. It also improves the switching due to the amount of energy that can be provided for the short period of time needed to switch the points.

Capacitor discharge

The aim of the capacitor discharge unit is to reduce the spike from the mains power supply and also to provide a high initial current which makes a reliable switch action. To do this you need some way of charging the capacitor, but then preventing excess current from flowing from the supply when the solenoid switches on. The traditional circuit uses a bipolar transistor, but I decided to create my own variant based around an N-Channel enhancement type MOSFET.

Schematic diagram for MOSFET based model railway capacitor discharge unit circuit

Below is the circuit diagram for my MOSFET based capacitor discharge unit (click the image for a larger version).

schematic circuit diagram for MOSFET based model railway capacitor discharge unit (CDU)

A full explanation is provided in the video above, but here is a quick summary.

  • Power first applied - capacitors are discharged
    • R1 is a pull-up resistor providing a high input to the gate of the MOSFET
    • The MOSFET is switched on which charges the capacitors
    • Resistor R2 reduces the current through the MOSFET to reduce the initial in-rush current
  • When the capacitors are charge it is ready for use
    • The LED D4 will light
    • Current through LED is restricted by resistor R3
  • When the solenoid is switched on it it pulls current from the capacitors
    • Current flows through D2 to the solenoid
    • The low resistance of the solenoid pulsse the gate of the MOSFET low switching it off
    • The current can only be supplied from the capacitors
    • The LED will go off as the capacitor discharges
  • The Solenoid switches off
    • There is a back voltage induced in the solenoid coil which goes through D3 to protect other components.
    • The capacitor is now discharged so the MOSFET can switch on and charge the capacitors

Component selection / parameters

I went through various iterations of design to come up with the final design.

breadboard circuit for MOSFET based model railway capacitor discharge unit (CDU)

These are some of the components I chose.

Power supply

The diagram says 12V indicating a 12V power supply, but it can be up to 20V. Different solenoids need different voltages and I found the 12V would not be sufficient for some of my solenoids, so instead I used a 19V power supply

Capacitors

The two capacitors C1 and C2 are connected in parallel providing the sum of their capacity. I initially tried with 2 x 1000μF capacitors. I found that 2 x 2200 μF capacitors worked better, alternatively a single 4700μF capacitor could be used, or for a more powerful "kick" then 2 x 4700μF capacitors could be used.

Diode D2 - high power schottky rectifier diode

A 1N5820 was used to allow the high current from the initial surge. This is also a schottky diode having a low voltage drop. The leads for the diode were too large for the breadboard that I used to prototype the circuit so I soldered a short length of solid core wire to the legs.

A similar diode was used for D1 (not shown) which is used between the power supply and the capacitor discharge unit. This diode could be used to allow this to be used with an AC supply or to protect against reverse voltage.

Diode D3 - rectifier diode as a flyback diode

A 1N4003 diode was chosen as a flyback diode due to it's good tolerance against voltage spikes.

Future plans

Although initially created and tested as a standalone project this will be used in creating a electronic switch control system, which will most likely be controlled using a Raspberry Pi Pico W.

More details coming soon, including integration into computer control system. Please follow my YouTube channel - penguintutor for future updates.

More information

For more information see my Model Railway projects using Raspberry Pi, PicoW and alternative microcontrollers.

Previous RPi Pico Temperature Display
RPi Pico Temperature Display
Next 25 minute training
25 minute training