Jump to content
 

Lower cost Block Occupancy detection with JMRI/CMRI, Arduino Nano & Megapoints BODs


 Share

Recommended Posts

  • RMweb Gold

I don't know how far to go with this, as it may be of little interest here.  I started off on this journey by being interested in computer control of my layout.  A journey which led me through using NCE Mini-panels in myown DIY switch panel to finally understanding(?) JMRI and getting a "glass panel" One Function Switch style UK set up. I am very pleased with the resuts.

 

It dawned on me that I would need Block Occupancy detection to interlock points, signals and routes.  The cost appaled me but I carried on. To get BOD for my small station cost over £350 using an NCE Auxilliary Input Unit and BOD20s, not counting the kilograms of copper wire! It was fraught with problems cutting into laid track to get the block splits I needed.  Plan first, then lay track! Easier said than done!

 

I really wanted to move on to my fiddle yard - but I kept delaying every time I costed it out. Scots blood you know! The BOD20s are £18-£20 if you can find them plus another AIU at £55.

 

Now what follows isn't original, nor is anything (except my implementation of it) my own work. By serendipity I fell accross "Little Wicket Railway" on YouTube. The bloke is a genius level teacher and demonstrator. Clearly he was wanting to do automation but was horrified at the costs. There are a series of videos of his development of his solutions, the key one for me was "Arduino, CMRI and JRMI - Part 3 - Multi Node CMRI Networks"

 

https://www.youtube.com/watch?v=WsfczIPbhsU&t=1234s

 

What this is all about is using an RS485 network from a PC using Computer Model Railway Interface (CMRI) protocol to link several "nodes" to JMRI software on a PC. My nodes are are Arduino Nanos (I use clones at £30 for 5!) with an interface board to link them to the RS485 BUS (5 for £5) and a USB to RS485 converter (£5) a few 400 pin "breadboards" and some jumper wires.  The BODs are from Megaapoints Controllers (£6 each or £42 for 8) and they are accurate and sense a single 10k ohm wheelset. The whole thing for less than a third of the station cost!

 

I have a test set up with 2 nodes working with JMRI but only one BOD, I am awaiting the full number in the next day or so.

 

IF anybody is interessted I could post more details and photographs of my testbed here, or answer PM questions. Or just forget it.

 

Let me know......
 

Pinout for Fiddle Yard BOD system.pdf

Edited by imt
Link to post
Share on other sites

  • RMweb Gold

Don't be sorry - my inclarity. But sorry I don't understand what you mean by "endpoint"?  Each node will consist of one Arduino Nano and one RS485 interface board.  That will theoretically support up to 16 BODs: if you want more have another Node or buy a bigger Arduino I guess.  So a node on my Amazon  purchases costs about £7 +  2 * 40 pin breadboards and a few jumpers (depends on how much you pay for the boards a regulation Arduino Nano is about £20) + n * £6 where n is the number of BODs.  The USB to TTL/RS485 converter is a one off and you daisy chain nodes off that.  I have only 2 at the moment.  To reduce wiring complexities, if I had done my Station this way I would have used 4 scattered nodes each with 4 to 6 Bods attached.  You only need two wires (RS485) between nodes and I gather the number of nodes and length of bus is beyond normal mortal's requirements (100 and 1>km!)

 

The "programming" (Sketches) is very small and easy to do cutting down the stff provided via Little Wicket.

 

Obviously the JMRI stuff isn't straightforward, but defining and using CMRI within JMRI is easy.  Again the Little Wicket videos are easy to watch and even make some JMRI understandable.

 

Attached is a photo of a node.  The black thing to the left is the USB to RS485 converter (on the end of a USB extension lead).

IMG_2469.jpg

Link to post
Share on other sites

I'd just put a caution on cheap RS485 devices from ebay/Amazon/ali-express, etc..  which look very much like the one photographed.     

 

On Burntisland-1883 we have an extensive RS485 network between the various Arduino Nano processors on part of the layout.  We used to suffer from network failures, stuff would just stop and not restart (which is a problem when things are interlocked between each other).   Eventually we pinned the cause on the RS485 devices, and one of our members painstakingly removed the RS485 processor from each of the boards and replaced it with a genuine TI processor bought from somewhere with traceable stock (RS/Farnell/etc.).   Since that change, no failures of the RS485 network.

 

 

- Nigel

Link to post
Share on other sites

  • RMweb Gold

Hi again Nigel.  Yes this is all cheapskate stuff.  Which is why I make up things so they can be easily extracted and replaced.  Obviously this is for a small homw layout so costs need to be kept down.  I quite understand that a large and complex layout needs more robust electronics.  I certainly would not use this solution in your instance!  Actually I cannot find anything but cheap Chinese stuff for this purpose.  Anybody got sources?

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...