Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

My DCC-EX prototype, and HO layout

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
i am a member of the team (in the least possible sense you can think of ;) ) for DCC-EX (https://dcc-ex.com/), an Arduino based DCC train control system.
I do not currently have a layout built yet, but i am working on finding a location... that being said, i have a working prototype, though it is currently less than ideal for updates and upgrades. this is because most of the circuits are soldered together on a prototyping board. not as easy to change a bunch of wiring when i have to de-solder the joints first.
so i will be changing the prototype to be more future friendly. first things first, the CORE MEGA2560 needs to be replaced with a regular MEGA2560, and i will be adding a screw-terminal shield to make connections to the MEGA2560 tight, yet easy to change. also, the motor drivers will be made to be plug-n-play. in other words, use a standard connector, with all the pins broken out, and be able to plug most any motor-driver into the connection on either the main or prog track lines. seems easy in practice...
i also want to change it to have a large prototyping area, with connections for all available extra pins. that way it is easy to attach most any hardware, to most any pin on the Arduino. the enclosure is large, so i think i have the room for all this. the question is how to lay it out... in the end result, i want all the connections to be face-mounted. so AC power in, DCC tracks out, are both on the face. that way when it is mounted in the layout fascia, i don't have to make any connections from underneath, to speak of.

but the big question is... where to build my layout? i could use my basement space, but it would take a LOT of serious cleaning. a lot of "spare" electronic parts that need to be organized. plus a drum kit in the way... the old server rack... just a bunch of stuff. but then i could move the work bench and run the layout along the walls, or something. maybe make a very narrow layout. like 12 - 24 inches in width to make room for a bit of sceanery, and a double or single track (likely single, with sidings). it doesn't even have to take up the whole space perimeter. i could make it a 12' X 8', with a open center, and a duck-under space.

~Travis
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
for tech groupings, i plan to use DCC-EX to control train DCC, track sensors (either hall-effect, or IR), outputs (lights, signals, turnouts). for the layout features, like building lights, and other track-side lighting/animation, i plan on using OpenLCB/LCC/OpenMRN, using the nodes i got from Atani. then there is the MQTT option, but i may abandon this avenue in favor of the other two.

i will try to bring out all wiring to the fascia, for ease of access, but there will always be some that has to be done from under the layout. the layout will be built in, likely, 2' X 4' modules that lock together somehow. perhaps with simple table-leaf dowels (metal) and latches. but that is the reason #2 for bringing the wiring to the fascia. so i can have connectors there to tie everything to home, and on down the line. the signals from the DCC-EX for sensors/turnouts/signals and so on, will just have to run allong the full length. probably with ethernet cable for convenience. i could tie some sort of RJ-45 jacks at each module joint, and just use short Ethernet patch cables for the joints. just have to make sure and label everything. LCC connections are just ethernet patch cables anyway. the DCC track power should be simple enough with some sort of 2-pin polarity connector. as long as it is rated for 10A-15A or so. the layout will be dead-simple flat terrain. i may not even use track-bed, for future-proof update capacity. just tack the track to the plywood, or whatever i use. maybe even some 1/2" or so underlayment plywood, on a 1" X 4" frame (1" X 6"-8" fascia). something else to consider for connections at the module joints, are just some rigid-mounted DB25 M-F breakout boards, so each module literally just plugs into the next. just an idea... not sure of the cost viability. i may even just use screw terminal bus bars, and jumper wires. not like i will be taking it apart much...
the legs on the modules will have to be well thought out. maybe just legs run down now and then from the frame will be easiest. other wise aligning modules will be a PITA if the floor is out of flat, and it is.

as far as track-on-layout plan... i have none, really. other than keeping most of the trains near the outside for ease of access. thinking of putting a curb of lexan around the inside and outside fascias to keep runaways from escaping. those can get expensive... having a $100+ loco and train hit the floor.
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
Change of plans on my DCC-EX prototype... i bought a used industrial PC AT/ISA back-plane (14-slot), and a couple (so far) 16-bit ISA prototyping cards. and here is my plan. i will use the power buses as-is, with the exception of the unused -12v and -5v. i likely will not use all 14 slots, but it allows room for thick cards.
I will breakout as many pins from the Arduino MEGA2560 to the ISA bus as i can, and group them by best use, if possible. like all the serial ports in a group, digital pins, analog pins, I2C, and SPI. in this way, whatever the card module needs, it is already plugged into, and can be in any slot. whatever passives on the back-plane that are not needed, i can disable. not sure about the resistor networks, for pull-down/up... will likely remove them to be safe. but i will derive power from the single 16Vdc power-supply, and use switching regulators to reduce to both 12Vdc and 5Vdc for the bus. 5Vdc for digital, 12Vdc for relays, etc. the motor driver card will need to pull power from an off-bus connector, because of the current limits of the bus. the track outputs will be off-bus connectors as well, for the same reason.
hopefully the back-plane fits in my enclosure... or i will need to build a different one.
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
here is the preliminary connection diagram, and the pinout i derived it from.
 

Attachments

  • 16-bit_ISA.jpg
    16-bit_ISA.jpg
    77.4 KB · Views: 1
  • DCC-EX_Arduino-ISA_Connections.pdf
    25.6 KB · Views: 3

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
prototype card #1 plan is to mount an Arduino MEGA2560 onto the card, and provide access on-card for the LCD attachment. the Arduino will be located near the side of the card to allow access to the USB port for software updates. there will also be connectors on the card side to connect motor drivers to, with the inverter transistors on-card for easier motor driver compatibility.

prototype card #2 plan is to mainly be for breadboard prototyping, with headers for the unused analog and digital pins, plus the SPI and I2C buses. there will be a breadboard mounted directly on the card. once a design is finalized, i can solder it to a prototype card. that way, if i need to change something after soldering, i simply pull the card, and either change the design, or make a new prototype card.

prototype card #3 (when purchased) will be for Ethernet. it can be on an 8-bit ISA card, as the SPI bus is within the first slot (i just moved I2C to the 8-bit slot as well, update attached), i can mount the Ethernet module on the smaller card, making it easier to update connectivity later if needed (or even remove it for USB connection)

prototype card #n (future) will be several MCP23017 chips for configurable GPIO.
 

Attachments

  • DCC-EX_Arduino-ISA_Connections.pdf
    25.6 KB · Views: 6

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
in retrospect, i have a RWP Mini2560 board (from: http://www.crossroadsfencing.com/BobuinoRev17/) that i am not using due to the project it was bought for, has been discontinued. so, this would be the perfect project for it! :D
I can use it on the MCU card, rather than a full-sized MEGA2560, and have room to have more default hardware on the MCU card. for example, a connection for the Ethernet module, but have the connections re-configurable for the future modules. and the standard motor driver circuits like the signal inversion, can go on the MCU card as well. the motor drivers wouldn't actually mount to a card anyway.
another common item that is unlikely to change is the I2C LCD display, so i can have a header for that to connect to. that leaves my second card i bought for just prototyping on a breadboard. and a lot of slots for upgrades and other additions.
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
Just had a go with my RWP Mini2560, and not surprisingly, it still works! i had to burn a new bootloader to it, but i was able to upload DCC-EX to it, and get console feedback from it afterward. :D
the major issue i can see in mounting it onto an ISA card... no built in mounting holes... best i can figure is that i will have to use foam mounting tape, or something. maybe just solder 4 long standoffs to the 4 corner pins, that happen to all be grounds, and solder the standoffs to the ISA card... may be the best option, given the circumstances. but it will be hard to keep the wiring in order, and prevent any cross-talk. thinking of mounting the wires from the underside... but i may just continue the header pins on top, and use headered wires to keep them in order... starting to question the use of the RWP Mini2560...
it would look a little better, but be a nightmare to wire... though i only have to wire the MCU board once.
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
now that i have a working MQTT project, so i know for sure the library works (or rather, how to make it work for me). I will likely use MQTT for layout scenery automation, and far track sensors/lights/turnouts. not giving up on OpenLCB by any means. i have the hardware, and will use it. just not sure how to apply it yet, so it sits on an expensive "back-burner" while i figure out how to use it. it may prove to be better than MQTT, by far. but i have to use what i know, and build from there.

so, MQTT for arduino, using the Pub/Sub library, i figured out when i read the buffer from the payload, even though it has a set length, i can't forget the null char at the end of the char string array. leaving it out makes for some odd data being processed...

i am not sure what i will use for turnout switch-machines. i have two Tortoise switch-machines that i wanted to test, and they may work best, but i am leaning toward servo control. the Tortoise machines have a built in DPDT switch, but the servo doesn't need a full motor driver board to move (just a servo controller board...). the servo method requires a relay to switch the turnout frog. but a relay module, or even one of my 16-relay boards can handle that, and be driven by a MCP23017 fairly easy. only drawback? they are active-low. so an unconfigured arduino with a powered relay board can result in the relays being turned on.

in any regard, i will want the various Arduino boards mounted either on the outside fascia, or on the inside fascia. likely the inside, as i will be updating those infrequently. an alternative would be to have a swing-down panel to keep it out of the way, or a drawer/cabinet to hide everything in, spaced around the layout. perhaps every other layout module, or so, could have a distribution/control cabinet. the cabinet will be very shallow, so i can work inside it with ease.

and on the subject of the network for the train layout. i think it would be best if i used my WiFi router to isolate the train network from the house network. so the train network would have it's own MQTT broker, possibly even on a Rpi. but through the router, it would also have internet access, as needed. but it would not be muddied with the traffic from say, the security camera system. so the network lag would be less. i can create port-forwarding to the MQTT server and the DCC-EX server, so my laptop could still access from the regular network. but it would make everything train-related on a single network. i could even plug in a network switch to add the number of connections up.
 
Last edited:

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
Currently downloading the latest Rpi OS, that i plan on installing on a Rpi CM4 (2GB/Lite/No Wifi). then i will install a MQTT broker, Mosquitto, on to it. the CM4 dev board does have Ethernet connection, so it will work quite well.

Regarding my WiFi Router, i may have better luck turning the WiFi right off, and use just the Ethernet components, but not sure yet. i may need it in the future...

current thoughts for the MCU card: i will use the RWP Mini2560, and mount it with hard-mounted power and ground connections. all other pins will be pin-headers, and the same for the pins of the ISA bus. in this way, i can move and exchange pins around with the simple change of a jumper wire.
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
ok, now that i have a Eagle Library for the ISA card-edge, i have started making a schematic for the MCU card and first card (motor drivers and LCD display). the pin mapping has changed slightly, as i forgot a few pins the first time round. unconnected pins in the schematic are just that, unconnected, and unused for that card.
At least once i am able to get a MCU card made, the prototyping will be easier.
 

Attachments

  • DCC-EX_Arduino-ISA_Connections.pdf
    21.8 KB · Views: 1
  • DCC-EX_Arduino-ISA_Connections_crd1.pdf
    23.9 KB · Views: 1

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
so, my DCC-EX implementation will handle sensors, and MQTT will handle turnouts. turnouts will be servo controlled, using piano wire.
I have ordered a PCA9685 module, and some MCP23017 modules. the MCP modules will be for the DCC-EX system, for sensors. and the PCA module will get me started for servos.
 
Last edited:

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
received the backplane today! :D
looks like it will work perfectly for my needs. i was worried about the populated keyboard connector, but it is only connected to power, and an unpopulated separate connector.
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
here is the current plan for the control structure.
 

Attachments

  • TrainLayoutControl.pdf
    13.4 KB · Views: 1

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
Interesting development... the ISA proto cards i bought are slightly off, as far as fitting in the slots... 🤣 i mean, they are only off by a 16th or even just a 32nd of an inch, but it is the principle of it. still usable, but i have to file the boards to fit...
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
i am currently thinking that ALL sensors and such will be controlled with MQTT and OpenLCB, and DCC-EX will ONLY control just the DCC waveform. i may pull out OpenLCB, or i may pull out MQTT, depending on how it pans out.

with OpenLCB, the HUB needs to be connected via USB to the computer...
MQTT can be done over the existing WiFi...

I am leaning toward MQTT, with a separate instance of JMRI to run OpenLCB, likely from an Rpi running JMRI. that will be used for just the layout animations, IF i have any... i do like the OpenLCB hardware, as it is simpler, and i already have it...

kinda hard to decide... but i don't think the backplane will be used for DCC-EX, but instead for the main MQTT node. or it may be used for DCC-EX... just not sure how, and a large MQTT node makes more sense. just have the Arduino MEGA2560 controller as planned, and use either Ethernet or WiFi connection modules to connect it to the train network. i will still use an LCD display for stats... or maybe the Nextion display will work better... not my 7" one, but the smaller one. have it auto page, and each page displays useful data, like Network stats, and whatever other stats. like bus voltage... maybe. that would be more custom though... so maybe i can re-use the MEGA2560 Core for the MQTT node instead. seems to make more sense, i guess.

so... i have a backplane, and some cards, and no current need for them... crap! :mad:
maybe i can still use them for DCC-EX, but the need isn't there anymore. maybe a custom project is in order... i mean, no need for more than a few cards for the MQTT node, or DCC-EX, and OpenLCB doesn't need it... can't really parallel MEGA2560 MCUs, for any useful need. so just one MCU for whatever project, that i have hundreds of $ future-invested in, and no need for...

i think perhaps, a MQTT only layout control may be best, with the exception of DCC. in the future, i can upgrade to OpenLCB, when i figure out how to use it...

so, on my future shopping list, i need a few turnouts, i think i have enough servos, for now... need some track joiners, and isolation joiners. it is my intent to solder the track through joiners, and leave the benchwork module joints aligned but unconnected. that way i can make wire connections on the fascia.

I think i can make the MQTT node use the card system... i just have to... (y)
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
in regard to the power supply for the system. track power will come in from, likely, a laptop PSU. the power for my Arduino will come from a 8-40V source, and pass through a DC to DC converter that will bring it down to regulated 5V. i could even take power from the track power, and regulate that down, but that would limit the usable power from the track PSU.

I could use an enclosure to house a main power supply, and just transfer a power bus to the DCC-EX control enclosure. i could house even just several internally stored laptop supplies. it would serve to hide the mess of supplies. perhaps even mount the DCC-EX into an old wooden radio case i have, and have the power in the rack enclosure, and mount that in the wooden case as well. it would make things a bit easier to figure out... as far as mounting options go.
 

travis_farmer

Administrator
Staff member
MH Access
Family
Joined
Aug 12, 2021
Messages
46
Thinking about the GPIO... it would be easier to use internal DCC-EX GPIO, rather than MQTT. as for the OpenLCB hardware, it will make a great method for controlling layout animations.
 
Top