Modellbahn Keks
Welcome!
Our cookies offer you a fast, relaxed and full-featured shopping experience. Some are necessary to operate the website and its functions. Others help us to improve our services. If you agree to this, simply consent to the use of cookies for preferences, statistics and marketing by clicking on "OK". Alternatively, you can deactivate individual cookies under "Customise cookies" or all cookies, except those required for the function of our website, under "Reject all".
Layout electrics

How to Wire a Model Railway: A Complete Beginner’s Guide

Which two wires get your first locomotive moving? Where do you connect the station lights and turnouts as the layout grows? Follow a small oval from its first track feed to a digitally controlled model railway.

Coloured model railway wires held in a white Viessmann cable clip
Wires in a Viessmann cable clip · MBS161312

Wire your first oval with two leads

Lay out a simple oval of track on a table. Leave the turnout motors and lighting in their boxes for now. One locomotive is enough to check that the controller, track and locomotive work together. By the end of this first test, the locomotive should be able to complete a slow lap under its own power in either direction.

  1. Identify the track system. On two-rail track, the two running rails provide the electrical contacts. On conventional Märklin H0 centre-stud track, a pickup shoe collects power from the studs. The wheels make the return connection through the outer rails. Check the locomotive manual to find out which digital protocols it supports. The pickup shoe alone tells you how it collects power.
  2. Identify the track output. Use the terminals marked as the track output on your controller or command station. Check that the feeder track suits your system. An interference-suppression capacitor in an older analogue feeder track can interfere with a digital signal. When converting to digital, use a track feed intended for digital operation.
  3. Disconnect the power before wiring. Unplug all the power supplies involved before making connections. Work only on the designated extra-low-voltage terminals. Use an undamaged model railway power supply approved for your controller. Leave mains cables and the inside of power supplies untouched.
  4. Test the first locomotive. Check both terminals for stray wire strands. Switch on with the track empty, then place a compatible locomotive on the rails. For digital operation, select its decoder address on the controller. Mark the first track feed as F01 on your track plan.

What changes when you switch from analogue to digital?

With conventional two-rail analogue DC, the track voltage controls speed and the polarity determines direction. Two independently controlled trains need separately supplied track sections. Traditional Märklin analogue systems reverse direction differently. Use the controller intended for the locomotive. For a comparison, see Analogue and digital operation.

With DCC, the rails carry a digital signal. Each locomotive decoder responds to commands sent to its address, so two locomotives can run at different speeds in the same powered section. Keep the two track output terminals connected to the same respective rails throughout each power district. Swapping them at a second feed creates a short circuit. DCC explained

Model railway wiring diagrams for three common circuits

Choose the diagram that matches your layout. The first two show the track output of a single controller. The lighting diagram shows a separate DC circuit. Follow the letters and terminal labels even if your wires are different colours.

Two-rail track wiring diagramA connects to rail A. B connects to rail B. The two rails are electrically separate. Two-rail track Two electrically separate running rails Track output A B Rail A Rail B Schematic · Identify the terminals using the equipment manual.

One output, two running rails

A and B are labels used for this example. One wire goes to rail A and the other to rail B. Keep the same pairing at every additional feed in the same power district.

Centre-stud track wiring diagramB connects to the centre studs. Terminal 0 connects to the common return of the outer rails on ordinary track. Centre-stud track Centre studs and outer running rails Track output B 0 Outer rails · 0 Centre studs · B Outer rails · 0 Schematic · Identify the terminals using the equipment manual.

B to the centre studs, 0 to the outer rails

On conventional Märklin H0 track, B (red) goes to the centre studs and 0 (brown) to the outer-rail return. The drawing shows ordinary running track. For contact-track detection, a section of one outer rail is deliberately isolated.

Märklin’s guide to terminals B and 0

Separate lighting circuit wiring diagramBoth lights are connected in parallel across the positive and negative terminals of a separate 12 V DC supply. Separate lighting circuit Two ready-to-connect lights rated for 12 V DC Power supply 12 V DC + − +12 V 0 V Light 1 Light 2 Schematic · Identify the terminals using the equipment manual.

Two lights on a separate supply

Both lights in this example are ready for connection to 12 V DC. Each is wired across the positive and negative terminals of the lighting supply. This circuit operates independently of the track.

Photograph the underside of the first feeder track. Place a note beside it showing the track direction and terminal labels. When you turn the track over later, the right-hand rail can look like the left-hand one. An arrow in the photograph and a mark on the same rail will let you identify it again.

Extend the oval with a track power bus

Add a station with a passing loop. Suppose the locomotive slows at the far end of the station but runs steadily at the feeder track. A loose rail joiner or dirty joint can cause a voltage drop under load. Run a pair of bus wires beneath the track and connect short feeders from the bus to the rails. This reduces the number of rail joints that carry current on the way to the station.

Does the track bus need to form a ring?

A bus is the pair of wires that follows the track beneath the layout. On this example layout, the pair runs from the track output to the last distribution block and ends there. Each feeder connects the same two bus wires in parallel to the corresponding rails. Keep the two wire ends separate. For digital systems, follow the manufacturer’s guidance on routing and any bus termination.

Add the next feed where the current has a long way to travel or must cross several rail joints. Station approaches, removable sections and hidden track are good places to add feeders before building scenery. Feeder spacing depends on wire length, conductor cross-section, load, track system and controller specifications. Run a train at the least favourable point to check how the supply performs under load.

A distribution block lets you disconnect individual branches. With the block isolated, check which sockets are connected internally. A single-pole block distributes one conductor to several terminals. For both wires, use two electrically separate groups or a two-pole block. The number of sockets alone does not tell you how many independent poles the block has.

Estimate conductor size and voltage drop

The bus carries current for several loads. A short branch to a lit building carries only that building’s current. Record the length and expected load for each run. The cross-section in mm² is the area of the conducting metal. The outside diameter includes insulation and cannot tell you the conductor size. Check the equipment specifications for terminal capacity, current rating and short-circuit protection.

Voltage drop in a pair of copper wires

Enter the one-way distance from the source to the load. The calculator includes both the outgoing and return conductors and assumes they have the same cross-section.

0.475 V voltage drop · 0.237 Ω total resistance of the outgoing and return wiresResistive estimate for copper at 20 °C. ΔV = 2 × one-way length × 0.0178 × current / conductor cross-section. Rail and contact resistance add further losses. Check current ratings and short-circuit protection separately.

Double the conductor cross-section in the calculator and compare the voltage drop. Adding another feeder on the layout also changes the current path. A reading on unloaded track can be misleading because a poor contact may show little voltage drop until a train draws current. Measure at the output and at the distant track under the same running conditions. For reliable absolute DCC voltage readings, use a meter designed to measure the DCC waveform.

Give lighting and turnouts their own accessory supply

Connect the station buildings to a dedicated distribution block. Wire lights rated for the same supply voltage in parallel. For DC, observe the polarity marked on each light. A bare LED needs current limiting, for example a series resistor calculated for its operating current. Before shortening the leads on a ready-made light, check whether one contains a resistor. For AC operation, the entire light, including its protection circuit, must be rated for AC.

On the example layout, a suitable accessory supply powers only the lights. The lighting circuit is electrically separate from the track output. Connect returns from different devices only if their manuals explicitly show that connection, even when the wire colours match. Never connect two transformer secondary outputs or the track outputs of two controllers in parallel to the same terminals.

Match the output to the turnout drive

A twin-coil turnout motor needs a pulse to move to each position. Identify the common wire and the two direction wires in its instructions. Use a suitable momentary push-button or a solenoid accessory decoder with the correct pulse duration. Continuous current can overheat a coil. Motor-driven mechanisms and servos need different controls. A three-pin servo connector carries power and a control signal. Its three wires serve different functions from those of a twin-coil motor.

Some accessory decoders take switching commands from the digital track signal and power the drive through a separate supply input. Check the instructions for your decoder to see whether it supports this arrangement, which jumper to fit or remove and which type of supply it accepts. A separate accessory feed leaves more track power available to moving trains when the station turnout operates. Viessmann accessory decoder wiring example

Add occupancy detection and boosters to a digital layout

Your command station now controls several trains. In the hidden staging yard, you want to know which tracks are occupied. Start by planning the detection sections in the staging yard and mark their boundaries on the track plan. A detection section reports occupancy. A power district is the area supplied by one power output. A single power district can contain several detection sections.

Detect occupancy by measuring current

Route the feed for the monitored rail through the appropriate detector channel. Isolate the rail at the section boundaries as shown in the detector’s wiring diagram. Every additional feeder to that rail within the section must come from the same detector output. A direct feed from the track bus would bypass the sensor. The locomotive could run normally while the control panel shows the track as clear.

An unlit wagon with no current-drawing equipment is invisible to a current detector. On centre-stud track, an alternative is to isolate a section of one outer rail. Conductive wheelsets then connect it to the opposite outer rail as the train passes. Use a suitable contact input and isolate the rail connections specified in the instructions. Check the device manual to see which method it supports. How the Z21 DETECTOR senses track occupancy

When to add another power district

A booster supplies the digital track signal and power to a defined part of the layout. Add one when the expected or measured simultaneous current demand exceeds the usable capacity of the existing district, or when you want to divide the layout into separate districts. Lit coaches and stationary sound locomotives can draw current even when parked. If a single bad rail joiner is the problem, add a feeder at that location.

Before making the change, mark all feeders that cross the proposed district boundary. Divide the track and its distribution wiring as specified in the command station and booster manuals. With a Z21 booster on two-rail track, isolate both rails at the boundary. A feeder connecting the two districts would defeat the isolation. Connect the booster’s data input using the specified interface. Z21 manuals for boosters, command stations and detectors

Keep a wiring schedule as the station grows

Label each branch at the distribution block and at the device it supplies. Use colour for electrical function and a code for location. Use the same labels on paper and beneath the baseboard. A short list is enough for the example layout. When you install a detector, the feed for the monitored rail moves to the detector output. Record that change in the schedule as well.

Example layout wiring schedule
Circuit IDWiring routeWhat to check
F01 · OvalTrack output → distribution block → first feeder trackTrace each wire to its labelled rail.
F02 · StationSame distribution block → second feed in the same power districtCheck which wire goes to which rail at the station entrance before connecting it.
L01 · Station buildingLighting supply → lighting distribution block → compatible building lightCheck AC or DC, the rated voltage and, where applicable, the polarity.
W01 · Entrance turnoutSuitable decoder or push-button → turnout motorCheck both end positions, using a separate command for each.
RM01 · SidingTrack supply → current detector → isolated rail in the detection sectionDrive a current-drawing locomotive into the section, stop it and drive it out.

Route wires so you can reach turnout motor screws and the openings beneath uncouplers. Leave a short service loop so a device can be removed. Route the conductors together near the terminal and provide strain relief for plugs. Use ferrules suited to both the wire and the terminal. Keep the wiring schedule where you will use it when tracing a fault. Electrical connections between modules and layout sections

Match the wiring to the gauge and the load

The same principles apply to Z, N, TT, H0 and narrow gauge. The permitted track voltage depends on the vehicles and control system. Depending on the stock and the layout, gauges 0, 1, II and G may involve higher currents and longer cable runs. Size the extra-low-voltage outputs, wires, connectors and protection as one system. On garden railways, choose wires and connectors suitable for the conditions where you install them.

Trace faults from the symptoms

The command station trips immediately

Remove all vehicles from the track. With the power off, disconnect the most recently added branches. Switch on with only the section known to work connected. Switch off again before adding each branch in turn. If one branch trips the output, check it for stray wire strands, reversed feeds and bridged insulating gaps.

Test the suspect branch

Before measuring resistance or continuity, switch off the supply and disconnect the branch from the command station, boosters and all loads. First test each wire from end to end. Then check whether the two wires that should be separate are connected to each other. A motor or decoder left in circuit can give a misleading reading.

When a fault appears only under load

If a short locomotive runs erratically at the far end of the layout, try a second locomotive there. If both are affected, inspect the rail surface, joiner and feeder. If the station lights also flicker when a turnout operates, trace their return path and check the load on the shared supply.

Confirm the repair

Repeat the original train movement with a comparable load and the same turnout position. Record the affected branch and the cause. The next time you modify the layout, you will know which connector or detector has caused trouble before.

Common questions about model railway wiring

Can I reuse my analogue wiring when converting to digital?

You can retain suitable wires and track feeds. Check insulating gaps, suppression capacitors in feeder tracks, common returns and existing switches. Disconnect every feed from the analogue controller to the future digital district before connecting the command station.

How do I wire a reversing loop on two-rail track?

Trace one rail around the loop. If it meets a rail connected to the opposite output when it returns, the loop needs a means of reversing its connections. For digital operation you can use an automatic reversing module. Position the insulating gaps and any sensor tracks as shown in its instructions. The switched section must be long enough to prevent the train from electrically bridging both boundaries at once.

How do I connect a programming track?

The black Z21 has a dedicated programming track output. For the z21 start, the manufacturer recommends disconnecting the main track and connecting the separate programming track to the track output. A short, physically separate test track prevents a vehicle from bridging the outputs. Compare the Z21 command stations

Electrical equipment for the next stage of your layout