element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Model Railway Signal Controller
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: djfraz
  • Date Created: 2 Nov 2017 9:44 AM Date Created
  • Views 2293 views
  • Likes 4 likes
  • Comments 5 comments
Related
Recommended

Model Railway Signal Controller

djfraz
djfraz
2 Nov 2017

I thought I would share this project that I have been working on for about six years, on and off. It is a controller for four aspect model railway signalling.

Image result for 4 aspect signallingFunctionality of four aspect signals

 

When most people drive these signals on a layout, the will use a rotary switch to change the signal, but when you have a layout with multiple of these signals, the control board becomes very cumber sum and hard to maintain.

 

When I first designed the controller I designed it for use on a Picaxe MCU, as at the time the only MCU I had looked into. The basic Functionality of the system was to take tow inputs, a binary number and to then drive the LED's on the signal, as the majority of manufactures of the model signals use 3mm leds with a common cathode, this requires four outputs. The driver for the LED's would also include a small RC Circuit to have them fade as a incandescent bulb would.

 

Input
Signal Output
Pin Output
00Green (Go)0010
01Yellow (Next Block Red)0100
10Double Yellow (Red Two Blocks Away)0101
11Red (Stop)1000

 

The second design, again on the picaxe had more complex functionality, in an attempt to make the system more autonomous. It included functionality for a TOTI (Train on Track Indicator) which would set the signal to Red, and the ability to chain the systems together, bu adding one onto the input and passing it out.Along with the functionality to include a feather, which is used to indicate which way a point is going, and a second input which it would use when the track was switched. I use input as the system is moving in the opposite direction to the train.

Image result for 4 aspect signalling

 

The second design came rather far, but i wanted to focus on a more generic system which would be near fully automated. and so i designed it using logic gates (sorry as don't have an image of the Logic). I then started thinking about making the design more user accessible, ie making a kit, posting PCB layouts and schematics. So i am now looking at what would be the best way for me to implement this design so that I can share the whole System.

 

My main Goal for doing this would be small form factor (I working in 4mm:1ft scale and the signals are small), low cost, ease of self assembly and although not necessary low power consumption.

The other options i would like to be able to add; are a control board, basically a mimic layout device (a device with a sketch of the layout on it) to change the signal to Red, or even other states,

 

Having thought about how to implement it I have considered a couple of options;

1. Generic Logic Gates

2. Field Programmable Gate Array, or other programmable logic device

3. Arduino programmable Micro controller

4. Micro controller, such as pic or avr.

 

I would like to hear any suggestions or advice the community have on how i should implement the system, and hopefully i may be able to share files about it with you when it is finished.

  • Sign in to reply

Top Comments

  • djfraz
    djfraz over 7 years ago in reply to michaelkellett +2
    I will look into the ARM cortex chips and see, not got much experience working with them so would be nice to learn. The train can be detected by various method, from magnets and reed switches to circuit…
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to mcb1 +2
    mcb1 , for a design that I'm making here on the community with Peter and Jon, we're using an i2c IO extender. We have several reasons to use this: it allows for multiple (in this case 8) extra I/O pins…
  • michaelkellett
    michaelkellett over 7 years ago in reply to Jan Cumps +2
    I was assuming 1 micro per set of lights and some kind of multi drop serial interface so that it would be expandable but avoid having loads of star type connections on a big system. The PCA9557 chip that…
  • michaelkellett
    michaelkellett over 7 years ago in reply to Jan Cumps

    I was assuming 1 micro per set of lights and some kind of multi drop serial interface so that it would be expandable but avoid having loads of star type connections  on a big system.

     

    The PCA9557 chip that Jan suggests cost about the same as a micro (a few pence more for one, a few pence less at 10 off) but would allow you to make a system with a single central controller and a 2 wire data bus. It will only support 8 unique node addresses.

     

    I like the idea of having intelligence at every node but its really down to preference. On a physically large layout the I2C bus isn't so good because it's not designed for long distances between nodes.

     

    MK

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to mcb1

    mcb1, for a design that I'm making here on the community with Peter and Jon, we're using an i2c IO extender.

    image

     

    We have several reasons to use this: it allows for multiple (in this case 8) extra I/O pins without an additional line from the controller.

    And in our design, the whole circuit, including the I2C line, is galvanic isolated from the microcontroller. Using an IO line from the controller would break the isolation.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 7 years ago

    I suspect your limit for all of these will be the number of I/O.

    The speed and control is not the issue, but polling the inputs to see the state, and then set the state seems to be.

     

    You might wish to consider each point and signal as a node, and make it self contained.

    There are various bus systems that could be used to communicate to the node and then get the state as well as setting the signal state.

     

    This would make it expandable and then the uP just needs to be able to link the sensor to whatever point it has ahead of it.

    The data could also be passed out and then a simple webpage to display the status.

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • djfraz
    djfraz over 7 years ago in reply to michaelkellett

    I will look into the ARM cortex chips and see, not got much experience working with them so would be nice to learn.

     

     

    The train can be detected by various method, from magnets and reed switches to circuit comparing the output from the controller to a section of train. I was going to leave it up to the user and just have a pin which when high means there is a train.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • michaelkellett
    michaelkellett over 7 years ago

    If I were doing it I would use  small micro controller (possibly Arduino would do but it has a lot of stuff you don't need - but they are cheap and common). It would be nice to allow for some simple communications system where you can connect lots of controllers on  daisy chain or loop and control or monitor them from a central point.

    If you are willing to work at chip level I would suggest an ARM M0 based processor in a hand  solderable package - perhaps STM32f051k4T6, Farnell 233346 at £1.03 each. These have proper on chip debug, 16k of flash, all the usual stuff and pin compatible parts with more memory if you need them. Its in a 32 pin TQFP package.

    How do you detect the trains ?

     

    MK

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube