Background:
I am helping some older gentlemen in the neighborhood on their model train setup. They want to develop a control circuit so the train can travel the whole track without them having to do anything. This involves automatically switching the track in several places to keep the train going in the right direction.
I have a circuit on the breadboard which works for the most part. I am using QRD1114 optosensors to sense the train. This signal is fed through a schmitt trigger, then onto a 74ls221 one-shot. The signal then goes to a ULN2003 which is driving relays to switch the ~15 VAC to switch the track turnout back and forth. The sensor sees the train, the schmitt trigger cleans up the signal. The one-shot terminates the pulse to switch the track so the coils in the turnout don't burn up if a train stops on the sensor.
Problem:
The circuit is working fine with the track power turned off. When the track and turnouts are turned on, I get noise in my circuit. If I use the manual button to trigger the track turnout, when I release the button (turn off the coil) my one-shot outputs a pulse. The signal is absent from the input to the one-shot but it is there in the output.
I thought it might be due to noise in the power so I added a 47uF and .1uF cap to the power near the one-shot, which did not solve my problem. I am not sure how the noise is getting into the circuit as the 5V and 12V are isolated from the AC powering the turnout. The only way I see is if the leads to power the optosensor are acting as an antenna and picking up EMI from the spike in the coil voltage when its turned off. I have poked around with a scope but have not seen any significant noise. It is either of a small magnitude or such a quick impulse that I am not seeing it.
Should I add snubbers to the coils on the turnouts? Any way to increase the noise filtering on the circuit?
Sorry for the long post, needs a bit of explanation.
Thanks for any advice
Matt