DCC Train AutomationAn independent UK guide to automating a DCC model railway — home

Detection & feedback

How to add signals that follow train detection with JMRI

Draw your layout in JMRI's Layout Editor, link blocks to occupancy sensors and let Signal Mast Logic set signal aspects automatically.

Time
2–3 hours
Difficulty
Medium
Cost
No extra cost
Steps
8
Checked
Report a problem
Three-aspect colour-light signalsThe line is split into blocks, each protected by a signal at its entrance. The signal behind an occupied block shows red (danger). The signal before that shows a single yellow (caution: the next signal is at danger). Signals further back show green (clear). Block detection tells the signalling logic which blocks are occupied.Green: clearSingle yellow: cautionRed: dangerBlock 1Block 2Block 3Block 4 (occupied)Trains run left to right; signals stand at the start of each block
Three-aspect colour-light signals The line is split into blocks, each protected by a signal at its entrance. The signal behind an occupied block shows red (danger). The signal before that shows a single yellow (caution: the next signal is at danger). Signals further back show green (clear). Block detection tells the signalling logic which blocks are occupied.

What you’ll need

  • JMRI connected to your layout (or a simulator connection)
  • Occupancy detection on the layout
  • Signals driven by a JMRI-supported decoder or board – or virtual masts to start

Step by step

  1. Step 1: Create a Layout Editor panel

    In PanelPro choose Panels ⇒ New Panel ⇒ Layout Editor. Draw track segments and turnouts that match your layout.

    Next: step 2
  2. Step 2: Add sensors and turnouts to the tables

    Use Tools ⇒ Tables ⇒ Sensors and Tools ⇒ Tables ⇒ Turnouts to add your detectors' sensors and your points with clear user names.

    Next: step 3
  3. Step 3: Create blocks and assign sensors

    Give each track segment a Block: Name, then assign the block's occupancy sensor (via the block's Create/Edit dialog or Tools ⇒ Tables ⇒ Blocks). A sensor can belong to only one block.

    Next: step 4
  4. Step 4: Add signal masts

    Open Tools ⇒ Tables ⇒ Signals ⇒ Signal Masts and add masts, choosing a signal system, mast type and driver. Use a Virtual Mast if you have no hardware yet.

    Next: step 5
  5. Step 5: Place masts at block boundaries

    Right-click a turnout, bumper or anchor point and choose Set Signal Masts. JMRI explains that a mast protects the track beyond it up to the next mast.

    Next: step 6
  6. Step 6: Generate the signal logic

    Run Tools ⇒ Auto Generate Signaling Pairs to create Signal Mast Logic. Masts show a red X until logic exists.

    Next: step 7
  7. Step 7: Test it

    Toggle sensors and turnouts on the panel and watch the aspects change. Then run a train.

    Next: step 8
  8. Step 8: Save

    Use File ⇒ Store ALL table content and panels....

Tips

  • Work through JMRI's own Getting Started tutorial with the simulator before wiring real signals.
  • Use consistent names (block, sensor, mast) so the tables stay readable.

Questions people ask

Can JMRI drive UK-style signals?

When you add a mast you choose a signal system (JMRI's tutorial uses 'Basic Model Signals'); look through the list for one that suits your railway.

Can signals work without a computer?

Yes – some accessory decoders and detectors can drive signals directly, and DCC-EX EXRAIL can define signals with SIGNAL(red, amber, green).

Sources

Checked 18 October 2026. We wrote this guide in our own words, using:

  1. JMRI PanelPro: Getting Started (jmri.org)
  2. JMRI Layout Editor help (jmri.org)
  3. DCC-EX: EXRAIL command reference (dcc-ex.com)
  4. Digitrax BDL168 occupancy detector manual (digitrax.com)

Tags: blocks JMRI Layout Editor PanelPro signal mast logic signals

Was this guide helpful?

Report a problem with this guide
What’s the problem?

Please don’t include personal details we don’t need. See our privacy notice.