Jump to content
 

Partial Point + Signal interlocking - Is this possible with Arduino?


WolfofBadenoch
 Share

Recommended Posts

I’ll start by saying up until this week I had no idea about Arduino or similar so what follows maybe rubbish and full of impossibilities. I’ve done a wee bit of research but I’m looking for advice if what I’m describing is possible.

I control my points with stud + probe and seep point motors, and plan to operate my 4 aspect signals through rotary switches. Initially I wasn’t planning any integration between any of the individual components, but I’m now thinking of changing my mind.

I still plan to use the same control methods but was wondering if I could use an Arduino (or something similar) to partially interlock eg hold a signal at red until a route was set.

I was thinking of starting with just one junction of the layout and having the signals controlled by the points in the following way:

Each of the signals (red circles) have a call on except the far right signal. For a train departing any of the platforms ( 4 lines to left) the signal could only change from red if the points are set for a route to U line. The call on could only light if a route was set from the respective platform to the D line.

I’m thinking the inputs to the Arduino would either be the pulse from the CDU as I throw the points or the point motor switch powering the frog (DCC signal). Not really sure how this exactly works at this stage.

Output would be to a switch (relay?) in the circuit of each signal – the switch would direct the current direct to Red, or via the rotary switch.

At this stage I know control of the Call On hasn’t been mentioned or control of the signal approaching the station on D line and potential conflicting routes there.

Currently I’m looking for confirmation that I’m on the right lines and my ideas are a possibility, and what sort of equipment I’d need to build this project.

 

Thanks

IG Junc -North.jpg

Link to post
Share on other sites

I believe you are on the right track.  However, if you try to use the CD pulse as an input you will ignite the built in smoke capsule - not good.  As I understand it you can use the DCC signal but  I am not familiar with DCC decoders so I will say no more.  However, it should be very easy to use an analog signal from the seep motor directly, from a micro-switch attached to the point mechanism or from a sensor such as a reed switch or hall effect and a small magnet attached to the point mechanism or optical sensor.  Just remember that an Arduino input should be 5V or 3.5.  This is easy if you use the Arduino as the power source.  For output I am not sure what you power supply to the signals is.  I suspect you will be using LEDs in the signal but are you using a 12V input reduced at or inside the signal or are you using a 5/3.5 source with a suitable resistor.  Anyway, the Arduino can be set up to drive LEDs directly or as you have suggested through a series of "Arduino" friendly relays.

  • Thanks 1
Link to post
Share on other sites

As Theakerr said, should be possible and not overly complicated.  

Just be very careful if using the CD pulse as input, connected directly it will probably smoke your electronics. There are ways, such as using opto-isolators, but getting a signal for turnout position from other places is more sensible. 

 

Relays to signals may be over the top; suitable transistors acting as switches should be able to handle 12v.  Though dropping the whole LED voltage plan to 5v (usually just a matter of selecting a smaller series resistor to the LED) makes things simpler.

 

If trying this, and no previous experience of Arduino, then suggest one of the "starter kits" from Ebay or Amazon for around £30 or so.  The Eligoo brand is usually decent, though there are many other similar types.   That kit will have a range of things in the box which will allow you to create enough of a prototype to do one or two signals, and from that learning you'll have an idea which additional bits to buy to complete a larger project. 

 

 

- Nigel

 

  • Thanks 1
Link to post
Share on other sites

Thanks for the replies.

 

I must admit i was thinking about one of the starter kits (will also be something i can do with my daughter as she has a basic electronics kits but wants to move on.... so brownie points with my wife too!:D).

 

Signals are 12v DC (Absolute Aspects + CR signals).

 

So i will go look for a starter kit and probably retunr with more queries on this subject in a couple of months!

 

Thanks

Link to post
Share on other sites

I would also say opto-isolators to pass but isolate the CD pulse, but you could fire pulse into a relay coil (latching) and use the relay contacts to pass your logic.

I use a  DCC accessory decoder output to pulse a relay coil which fires a CDU solenoid points system. Similar idea.

Link to post
Share on other sites

8 hours ago, RAF96 said:

I would also say opto-isolators to pass but isolate the CD pulse,

 

I've never tried that but I suspect there would have to be some additional circuitry to protect the opto-isolators from the considerable back-emf from the solenoids. For example the abs max reverse input voltage of a 4N25 is only five volts. There might be other isolators available with built-in reverse voltage protection diodes.

 

You don't necessarily need some sort of latching device (like a relay or a flip-flop) to remember the state of the points. The isolator pulses to the Arduino can be configured to interrupt the processor.

 

I'd recommend that all inputs to the Arduino from the layout be protected by opto-isolators and if not by some serious low-pass filters. 

Link to post
Share on other sites

This is an interesting example of the electrical complexity of introducing an Arduino to a traditional track control system. If the Arduino had been in at the planning stage the turnouts would be operated with servos and the signal LEDs would use 5v  directly from the Arduino.

 

...R

  • Agree 1
Link to post
Share on other sites

The Most Complete Starter kit UNO R3 Project arrived today so i shall have a play with that and hopefully learn about the Arduino. If that's successful i'll no doubt be back asking in more detail about opto-isolators and other things i need to learn about, in a few weeks (ok probably months).

 

Thanks for all the helpful comments.

Link to post
Share on other sites

Only just found this topic, so apologies for the later reply.

 

I use an Arduino to set ground signals and a 3 aspect signal for a small DCC yard / station layout.

 

I've got two sorts of input - turnout blade settings and occupation, then outputs drive the signal LEDs directly. Occupation is detected using the excellent MERG Pocket Money Projects DCC Detector kits, which basically turns on or off an optoisolator, meaning that it can be used directly with the Arduino. For the turnout blade positions, I wire a resistor and optoisolator across the frog to one of the DCC rails, so that when the frog is the opposite polarity the optoisolator is activated. This is then coupled with the Arduino as above.

 

My Arduino code then has logic which sets signals to red on startup, then sets a clear aspect (for the three aspect signal, it's random whether it's yellow or green) when the route is set and the route is occupied. As a train enters a section, there is a delay before the clear aspect is shown, allowing some prototypical hanging around for the signal to change. Once the train leaves the section, it's back to red again.

 

Happy to help if you've any more questions, and I've attached my code if it is of interest.

 

What I would say though is start simple, the Arduinos are great, and the starter kits (I have a very similar one) are a great introduction. I started out with simple sketches to start with to prove the point, one to say drive the signals, one to do something when an input changed etc. 

 

And lastly, if you are using the same track occupation sensor, don't do what yours truly did and then put track-powered buffer stop lights on the tracks. It took a few moments of head scratching, code doubting and confusion before the penny dropped what I'd done!!!

YardSignalling.docx

  • Thanks 1
Link to post
Share on other sites

I'm trying to be patient and work through the Arduino starter kit before proceeding on the layout. Thanks for your code, I've downloaded it  for studying later. Thanks also for the info on your inputs - sounds like a good system to indicate point direction. Just need to educate myself on what an optoisolator is!

Link to post
Share on other sites

16 hours ago, WolfofBadenoch said:

 Just need to educate myself on what an optoisolator is!

 

Sometimes called an "optocoupler".

 

The input to an optocoupler energizes a light source (like a LED) which sends light to a light sensitive device (like a photo-transistor) which drives the output. Because of that there is no "galvanic" connection (electrical current) between the input and the output. That prevents nasty unwanted voltages appearing at the inputs to delicate devices like micro-controllers. Model railways are really good at producing nasty unwanted voltages.

  • Thanks 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...