Skip to main content

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

Finally have a moment to get back here, sorry for the delay.

Using the optocoupler from track power as described above should work out just fine, but I'm a little concerned if it would work properly under varying track voltages.  Under command operation it wouldn't be a problem, but in any case I prefer a different method.  

I would use a separate DC power source with its ground connected to the outside rail bus of the layout.  When the insulated rail is bridged by passing wheels it would complete the circuit to allow that DC source to power the optocoupler.  This would insure that the LED in the opto is fully turned on and not over driven.  

Something else to note on the output stage is that you will need to use transistors or some other driver between the shift registers and relay boards or LEDs.  The 74HC595 can supply 25mA on one output, but can only supply 70mA total, so if more than a couple outputs are turned on it will over drive the chip if outputs are directly driving relays/LEDs.  

I looked over the sketch posted in the other thread, and if it does the job that's needed it's great.  It is massively less complex than the sketch I have going.  I have some concerns about what is going on there, but will need to test it out with hardware to see  exactly how it is working and if my concerns have any merit.  

The sketch I have going reads all inputs, stores their values, then decides what to do with them before sending out all data to the outputs.  All this makes for a pretty inefficient program, so I'm hoping that what you have will actually get the job done.  

It isn't really a problem yet, but also just wanted to make sure you're aware that the EEProm in the Arduino has a limited life.  Under normal conditions as used in your sketch it should last many, many, years, but under testing conditions it's life can be quickly expended, so just be aware of that and make sure your code doesn't write to the EEProm any more than it needs to.  

Anyway, that's about all for right now.  

JGL

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

×
×
×
×
×