Skip to main content

Reply to "Using an optocoupler to connect insulated rail to input pin of shift register"

JGL,

Thanks for all the diagrams. I like the way you added the connector to make it easy to chain several modules. 

I have a few questions for you:

1) I see that you eliminated the RC debounce portion of the input circuit between the optocoupler and the Schmitt trigger. I guess that makes sense to me because it really just duplicates what can be done by the code in my Arduino sketch. It also makes wiring easier and reduces the number of components that could fail. Would it make sense for me to modify the code to require a more definite input signal? Right now the sketch smooths the output signal (by holding it on for 1 second) but it will act on an input signal as soon as it is received. I could require that the signal be present for 4 or 5 consecutive loops of the code to make sure that an errant signal does not cause a switch to be thrown. Let me know what you think.

2) I noticed that you are using 10k pull up resistors for the Schmitt trigger inputs. Earlier in the thread, Stan suggested that I use 100k instead of 10k to reduce the current used.  Does that make sense to you?

3) Should I add a decoupling capacitor to the 74hc595 shift registers that I'm using for the outputs?

Here are my thoughts about your design questions:

I think it would be okay to have all the modules in one place except for the relay boards. I would like to place the relays close to groups of switches to minimize wire runs and then just have a 16 conductor cable run from the main modules to each relay board. Do you think that would work?

I was also thinking about the question of what to do when conflicting signals are sent such as when a train is on the non-derail track and the button is pushed for the other switch direction. It seems like that could be handled by the Arduino. I could add some code that would prevent an output signal from being sent if there was already a signal being detected from the opposite direction. It would also be possible to have both indicator lights illuminate to show the operator that there was a problem.

John

 

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×