HOBen

I promised in my previous post (here) that I would give more information about the signaling system that I am building. I will do my best to explain the systems without sounding too technical.

I have my railroad layout separated into relatively small blocks that allow me to locate the engine (and cars with resistor wheel sets) by the current that they draw. One of the wires that apply power to the block of track is passed through one of the current sense transformers on the detector board. I purchased the printed circuit boards from (here). I ordered most of the parts from Digikey but the current sense transformers came from Surplus of Nubraska, as recommended by Rob (the circuit designer).

The large motherboard expands the number of inputs and outputs that are available for the microcontroller to use. The inputs are plugged into “parallel to serial” shift registers. Not all of the Shift registers are wired into the circuit yet. By connecting the shift registers together I am able to get 80 inputs using only 3 pins on the microcontroller board. Doing this increases the amount of time that it takes to gather the data from all of the inputs but the timing is well within reason for my purposes. Once all of the data is stored in the microcontroller’s memory the changes are detected and the signals are changed appropriately.

To interface the LED’s with the microcontroller, I am using specialized LED driver boards. Although these are expensive, $5.00 each, it simplifies the process greatly. Using the LED driver boards allows me to send brightness information to each signal colour individually.

If you have any questions about my design please let me know.

Reply 0
proto87stores

CMRI and JMRI

Good work!

 

Were the existing CMRI and JMRI systems too costly for you to use?

Andy

Reply 0
vasouthern

Good work

Congrats on the neat layout and designs.

I also considered a home brew signal system based on micro controllers ( PICS ) and a RS485 data buss. I pondered long and hard, even worked out the address scheme and tested some PIC programming. Then I took a honest accounting of the time that would be required to design and build the package. Then I thought about the cost of the off the shelf products to do the same thing or even better and chose to buy the products.

I work in electronics for a career and the challenge was not the system but a honest answer to myself about how much time I would spend on home brew versus time spent building my layout. Add in the abilities that JMRI offers for FREE and factory support it became more clear to me.

I applaud your work, I know it took alot of time!

Randy McKenzie
Virginia Southern - Ho triple decker 32x38

Digitrax Zephyr, DCC++EX, JMRI, Arduino CMRI
On Facebook:   http://www.facebook.com/groups/485922974770191/

Proto freelance merger of the CRR and Interstate

Based on the north end of the Clinchfield.

 

 

Reply 0
HOBen

Why I did this

I did look at the CMRI and JMRI for controlling the signals on my layout but there were three reasons for not going in that direction.

  1. Computer interface not required. Using the microcontroller allowed me to employ my simplified signal rules without having a permanent connection to my computer. However, I have purchased the NCE AIU that I will be connecting to the system to allow my NCE Pro connect to the computer with the possibility of having the computer run the railroad.
  2. I really wanted to build this myself. The electronic aspect of model railroading is probably my strongest skill. Plus, being a Mechanical Engineer with an interest in electronics and especially microcontrollers, I feel like I can build / fix anything.
  3. Cost.  For my model railroad, I do not track the amount of time that it takes me to do a project.

Thanks for your questions.

- Ben

Reply 0
John C H

Post your Arduino Sketch

I would be very interested to see you post your Arduino sketch. I am considering the Arduino with IR sensors based on R Paisleys information and have considered shift registers on the input. I would be interested in you solutions in your sketch if you care to share the info here. 

One method I would like to investigate is the use of interrupts so the Arduino does not have to pole through each input in a cycle but only react to a change on an input line. That would be much faster for reaction times as things get more complicated.

I hope to interface with JMRI through LoconetI/O protocol or maybe a pseudo-C/MRI interface.

At the cost of $200.00 for an assembled SMINI for C/MRI interfacing, an Arduino and home brewed shields is a competitive alternate for JMRI connectivity. 

John

 Canada 

Reply 0
arthurhouston

The answer to why is because.

Thanks for putting my mind to rest, when you said you had NCE system and had obtained AIU. With JMRI and the equipment available from the two major DCC systems time is to valuable to get involved in this type of activity.
Reply 0
HOBen

Arduino Sketch and Layout Drawing

I have attached my Arduino Sketch and the working diagram for my railroad to the original post. Presently the code only runs a single head but I will be adding to it as I build more.

Also, there is only one of the shift registers working on my motherboard, I need to get more resistors before I can continue wiring.

I'm not a programmer but I don't think you can use the interrupt function through shift registers because the shift register has to be actively polled. The way that I increased the response time of my program was having an overall "if" statement that compared the previous shift register data to the new shift register data. If there were no changes, then poll the registers again.

I hope this helps answer your questions.

Reply 0
slyone

A late response, hopefully

A late response, hopefully will be seen, but I wonder if you would identify what you used for your LED driver chips? 

Lyle

 

Edited to add ; Never mind   I found my answer by examining your Arduino code.

Reply 0
william.turczyn

10Dec2016 - Arduino HO Signaling

Since some time has passed since you started this project, what is status of the signaling today - still using the arduino system as you initially started out with??

Reply 0
Reply