Model Railway Control Board

Hi, Hope there is someone out there who can help me? I want to build a control box/board for my model railway layout. I have approximately seventy sets of turnouts which i want to control with multicolour l.e.d.s showing which route is set (i.e. red or green) i want to set the points/turnouts/uncouplers using momentary acting switches, to do this with standard electrics i would need at least one hundred and forty relays, so my question is can this be done with the Arduino system? I would also when i get to understand this more like to add signals and block occupancy settings to the layout as well. I am a complete beginner at this, but was an electrician for all my working life so i understand relay logic very well.

Hi, Welcome to the forum.

Hi, Hope there is someone out there who can help me? I want to build a control box/board for my model railway layout. I have approximately seventy sets of turnouts which i want to control with multicolour l.e.d.s showing which route is set (i.e. red or green) i want to set the points/turnouts/uncouplers using momentary acting switches, to do this with standard electrics i would need at least one hundred and forty relays, so my question is can this be done with the Arduino system? I would also when i get to understand this more like to add signals and block occupancy settings to the layout as well. I am a complete beginner at this, but was an electrician for all my working life so i understand relay logic very well.

Sorry but had to get it into point form to see what you had. Arduino will help you with your system, but the outputs are only 5V or 3.3Vlow current so MOSFET type interfacing will be needed if you don't want so many relays.

Have you googled arduino model railways railroads

There are quite a few sites that show methods to accomplish the type of control system you would like.

Hope this helps.. Tom.. :)

Since this thread died abruptly, without a completion. I just wanted to advise new readers and amend this thread with some information I have gathered by being part of this.

If all you want is a display panel in one room and your turnout somewhere else. You can modify the schematic Septilion posted in post #64 This does not know if the LED's are Common Cathode or Common Anode, so it is recommended one makes a test first, before buying LED's. One can use individual LED's and tie the cathodes or anodes together to test before buying special LEDs. We can help if you let us know in a new thread.

If all one wants is a display and a manual switch, the switch can be a single unit, a momentary, single pole, double throw. As an alternate, on your display, you can have a button on the track, that would allow you to touch the picture of the track on your display, that you want to be active. One for each track, also momentary.

The Fleischman points are engineered to not need a capacitor discharge unit, and in fact, a few of the sites I found said that a CDU will actually damage the Fleischman points, leading to failure. As we know, the better engineered the coil is for the application, the less external devices are needed. I believe the Fleischman coils are well designed for this application.

Throughout this thread there has been mention of DCC. It seems there is a vast array of offerings on the market and the industry has a specification on the protocol to be used. As with any industry, many will follow the industry while others will intentionally use something different to force buyers to purchase their equipment, often at a premium. A good corporate citizen will use those profits to hire better engineers and develop a more and superior products. Apple smart phones for example. Fleischman's high quality points might be another example.

That said, the sheer numbers of hobbyists and professionals that are working with micro-controllers like the Arduino and whom are also involved with model rail roads means that the knowledge and technology on the hobbyist side peals back the layers. I found multiple offerings of DCC DECODERS that work with the industry standard, meaning more than half the commercial products, as well as more than a few that have Arduino sketches that can accept signals from the more closed systems such as the Z21 . After all, it really is only binary data streams.

That said, if some future reader happens upon this thread, I would offer that it meanders and never comes to a conclusion. Better to start a new thread and explain what you want.

?

The Arduino Mega has a maximum of 70 pins that can be used for input or output. That is not enough. Using I2C, the pin count can be greatly expanded. MCP23017-X_SO is a 16 channel Digital I/O with 8 addresses. 8 of the would give you 128 digital channels. Using a PCA9518 that is a Expandable 5-channel I2C-bus hub could give you a total of 512 digital channels.

Another choice might to be using multiple Arduinos. The part numbers above are surface mount.

If you use servos to move the turnouts each one can be controlled by a single Arduino I/O pin

If the turnouts are spread across different baseboards you could put a separate Arduino on each board and communicate between the control panel and each board with just 3 wires - Rx Tx and GND.

If this was my project I would use an Arduino for the control panel and other Arduinos for the actual movement of turnouts and setting of signals. One of my objectives would be to use the Arduinos so as to minimize complicated baseboard wiring.

If you want to communicate between Arduinos I suggest using either Megas or Micros (or Leonardos) all of which have spare hardware serial ports.

...R

I have a better understanding. you are looking to control the LED's as indicator lights.

something like this ?

|500x273

Thats exactly what i want to do! I have since we last spoke gone and wasted some money! i have purchased a Arduino Mega 2560 and a couple of red/green diodes, a double throw double pole momentary switch and a breadboard. No idea what i am going to do with it all though? I have done a drawing, of what i want to happen but i am a bit embarrassed to put it on here in case it is all wrong.

Firstly let me apologise in advance for my complete lack of knowledge in this area, but is there anyone who would be willing to help me or write a sketch/programme for me? i would like it to output to drive two solenoids (16-18 volts ac) and depending on which solenoid is powered using two multicoloured red/green led's to show which solenoid has been operated. for example green for operated and red for not operated. the solenoids would be operated from a double pole double throw momentary switch as the input? I have a Arduino Mega 2560 board which i am hoping to use to replicate the above programme for approximately 70 more pairs of solenoids. I have also purchased a 16 way relay board with 12 volt dc coils. Each relay on the board has one n/o and one n/c contact. I believe this is doable but not by me as i do not have the understanding to programme?

Please just for courtesy sake, please delete your double post on this topic.

what you ask is well within the area of a beginner.

do you have an Arduino ?
power supply ?
LED’s ?
solenoids ?

if you want to try it for yoruself, we can help get you started.
if you just want to pay someone, there is a gig’s and colaborations section.

let's start by you getting your feet wet.

if you have a mega and some LED's and some resistors, you can turn on the LED's

step two is activate the relays. please post a link to the exact ones you got. we shoudl be able to get you to turn on a relay AND an LED at the same time turn OFF the relay turn off that first LED, then turn on a second LED of a different color

you should be able to do this in very short order. longer only because you are a beginner.

if you put together a schematic, you can just put in blocks, lable it light, solenoid, relays, etc.... show your final device and how that should work

you will not embarrass you or us with a very simple drawing. but it gives us a place to start and build with you.

Nearly identical threads merged.

So to be clear, you ony want an indication of the position of each turnout?

If the solenoids of the turnouts switch themselves off when they reach the desired position (eindafschakeling in Dutch) then you don’t need an Arduino or relays. Have a look at this: http://www.people.zeelandnet.nl/zondervan/bonte%20verzameling.html#01

If you want to do more fancy stuff like showing routs on a board (so not just red green for turnout position) then a Arduino can help you indeed. But then the Arduino doesn’t need to drive the solenoids. It just has to know a solenoid is activated. You can just connect a input of the Arduino parallel to every button. If you connect the common of all switches to the GND of the Arduino (on a seperate power supply) then that’s fixed. All that’s left is connecting leds.

And because of the size I would just go for multiple smaller systems. So multiple Pro Mini’s or Nano’s for example. And to drive a lot of leds something like a MAX7219 is easy to use.

septillion: And because of the size I would just go for multiple smaller systems.

This is a VERY good way to go about this project. a Mini / NANO / UNO, all have 20 pins you can use. if you output one solenoid, on or off, that is one pin. red LED, a second green LED, a third. if you can get one switch done, as a whole and complete project, then you have the bull by the horns. getting that first one is the hard part, once you have that, the next 150 are a piece of cake.

so, your primary task is that first one.

since, getting one solenoid and some LED's working will not take all the pins that are on one NANO then you should be able to get 2, 3 or 4 switches to be controlled by one NANO I like the NANO because it has the on-board USB to allow programming and all the pins you use are in the rows. the pro-mini has very odd, almost unuseable pin placement and no USB on-board, much harder to use.

If you have any LED's and solenoids and resisors and relays, make a list, tell us what you have, model number or link to where you bought them. that way we can read the data sheets and help you put this together.

As you will find out, you can have one Arduino drive another chip and have that chip drive other lights. in our world, it is cleaner, but in your world, it is like taking a college course in programming...... using a couple dozen NANO's will be more cost effective than using other chips and it will be about 1,000 times easier on you as the programming of a couple outputs and LED's is child's play. you have a great beginner project, if we keep it in the baby pool, you will be impressing your friends with your accomplishments in days. no reason that if you have the parts, you should not be able to get one working by the weekend. if you want to really take on programming and learn about using other chips, we can help you with that, but I caution that if you are confused now...... it will not get any easier and the weeks will be stretching out.

turnouts. do they have motors now ? do they have switches ?

I was thinking about your CIC and it would seem that you could get a clear plastic over some MDF, recess your LED's into the MDF and lay your plastic over. then add decals on the plastic.

Hi all, Firstly apologies for the double posting, no excuses other than my ignorance on this website! Secondly i have got a Arduino Mega 2560, some double colour leds, various resistors and switches. I am still waiting delivery of the 16 relay board with 12 volt dc coils. I have plugged the Arduino in and tried the simple example sketch for blink and got that working alright. I can as someone said "just pay someone to do it for me" but if i am capable i would really have liked to say i had done this on my own as it was my idea, but obviously i need some help? I have done a drawing which i am struggling to upload to this site. i tried several times the other day, which was what led to the double post, i will try to upload the drawing again now. Thanks in advance to anyone who can guide me through this, as an aside i went to Maplins for some help yesterday and the guy in there sold me some 74 series nand and norgates, told me to try them, i hadn't got a clue where i was when i got home. HELP

Hi all,
Firstly apologies for the double posting, no excuses other than my ignorance on this website! Secondly i have got a Arduino Mega 2560, some double colour leds, various resistors and switches. I am still waiting delivery of the 16 relay board with 12 volt dc coils. I have plugged the Arduino in and tried the simple example sketch for blink and got that working alright. I can as someone said “just pay someone to do it for me” but if i am capable i would really have liked to say i had done this on my own as it was my idea, but obviously i need some help? I have done a drawing which i am struggling to upload to this site. i tried several times the other day, which was what led to the double post, i will try to upload the drawing again now. Thanks in advance to anyone who can guide me through this, as an aside i went to Maplins for some help yesterday and the guy in there sold me some 74 series nand and norgates, told me to try them, i hadn’t got a clue where i was when i got home. HELP

Phil, if you like hobbying, you should give this a go by yourself. The coding here isn’t too complicated, just a lot of it. If as others suggest you get 1 working right, the rest is a breeze. Just focus on working the logic/desired outcome for one- and don’t be afraid to ask for help. Best of luck