Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Preliminary design for my Arduino-based CMRI node

16093 views
35 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    February 2018
  • From: Flyover Country
  • 5,557 posts
Posted by York1 on Monday, May 10, 2021 12:49 PM

srl
Randy, Did you ever get this working?  I was wondering if you have implemented this on a PCB yet.  Thanks,

 

Steve,

Sorry to say this thread is several years old, and that Randy passed away some months ago.  He was very helpful to many of us with his knowledge of electronics and Arduinos, and he is greatly missed.

By the way, the info says you've been a member here for a while, but that this is your first post.  If that's correct, welcome to the forums.  Hopefully someone else will read this and give you some more information that you're looking for.

York1 John       

  • Member since
    December 2016
  • 168 posts
Posted by speedybee on Tuesday, May 11, 2021 1:22 PM

I've got Arduinos controlling my layout in a vaguely similar manner to what Randy was describing, albeit much simpler because I made no attempt to integrate with JMRI.

I ended up using a network of "Arduino" Pro Minis connected on a RS485 bus. I experimented with port expanders like MCP23017, shift registers, etc. Eventually I found that using them is more effort than it's worth. It's easier, simpler, cheaper, and less wiring to just use more Pro Minis instead. I was spending way too much time messing around with port expanders.

Pro Minis are so cheap and need minimal modification. I solder a MAX487 chip directly onto pins 6 7 8 or a Pro Mini. I pull off the Pro Mini's onboard regulator and solder on a L7805 instead. And that's it... it's ready to attach to the RS485 bus and do whatever it needs to do.

Example. Say I've got a crossover to automate, I'd dedicate a Pro Mini to it, installing it right beside the crossover so wires are short. I/O needs are four pins for motors, five pins for sensors, three pins for RS485, and I leave the two pins 0 and 1 empty for easy reprogramming. That leaves six pins for LED signals (though you could get an additional two pins if you're desperate by using A6 and A7). Six pins can control a lot of LEDs if you multiplex them.

srl
  • Member since
    March 2008
  • 3 posts
Posted by srl on Tuesday, May 11, 2021 4:45 PM

York1

 York1,  thankd you for responding.  I am sorry to hear this information.  Randy clearly understood what he was trying to accomplish.  I read this entire thread closely, and was amazed at his ability to explain what he was doing.  A real loss for sure.

 
srl
Randy, Did you ever get this working?  I was wondering if you have implemented this on a PCB yet.  Thanks,

 

 

Steve,

Sorry to say this thread is several years old, and that Randy passed away some months ago.  He was very helpful to many of us with his knowledge of electronics and Arduinos, and he is greatly missed.

By the way, the info says you've been a member here for a while, but that this is your first post.  If that's correct, welcome to the forums.  Hopefully someone else will read this and give you some more information that you're looking for.

 

srl
  • Member since
    March 2008
  • 3 posts
Posted by srl on Tuesday, May 11, 2021 4:57 PM

Speedy Bee,

Thank you for your post.  I have been doing some investigation of using RS485 to communicate between several Arduino based RFID readers and a server.  The club I belong to does not use JMRI (except for Decoder Pro), so that is not an issue.  The additional I/O made available by the port expanders looked like a good idea, but is not the central requirement I am looking to find a solution for.

 

I will look at the Pro Minis before I get too far along.

 

Steve

  • Member since
    July 2009
  • From: lavale, md
  • 4,678 posts
Posted by gregc on Wednesday, May 12, 2021 6:21 AM

srl
I will look at the Pro Minis before I get too far along.

it won't matter which processor board is used running C/MRI protocol running over rs-485, you could certainly use different boards based on the needs, using the same data driven code on each with different table data depending on the need of each

one of the biggest benefits of node is reducing the amount of wire and better organization of I/O

speedybee
I experimented with port expanders like MCP23017, shift registers, etc.  Eventually I found that using them is more effort than it's worth. It's easier, simpler, cheaper, and less wiring to just use more Pro Minis instead.

i developed a board using MCP23017 I2C expanders.   the board uses 8 i/o pins to drive lm324 op-amps to drive 8 tortise swich machines  and 8 i/o pins as simple GPIOs   I2C allows up to 8 board to be daisy chained together.

somewhere Randy posted his code.    i exchanged some PMs with in in feb 2020 but am unable to find his listing

greg - Philadelphia & Reading / Reading

  • Member since
    November 2016
  • 4 posts
Posted by Erik84750 on Thursday, December 8, 2022 9:17 AM

Some interesting project for a SMINI by a French modelrailroader "nopxor")

https://www.trainboard.com/highball/index.php?threads/24-in-48-out-card-for-jmri.116454/

A 24IN 48OUT node complete with hardware schematics and software. Impressive.

I made my own pcb's, they are available in the link; software is written by nopxor.

I concur with most here that DCC++ is great for running loco's; anything else I delegate to C/MRI.

And the default 9.6kbps is good enough. And if not the baud rate can be increased.

Just make sure to properly terminate the RS485 transmisson line (preferably twisted pair, with shielding) with 120R on both ends.

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

There are no community member online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!