Design question: hardware or software
Professor Chaos
Posts: 36
Hi all -
I am implementing a model railroad control system that requires detection of blocks of track. Occupancy is detected by the train wheels completing an 18v AC circuit. Consequently, the signal is very intermittent and noisy.
I developed the attached circuit to generate a clean occupancy signal. The AC circuit drives an optocoupler, which charges a capacitor to yield a smoothly rising or falling voltage. A Schmitt trigger then generates a stable on or off signal. Obviously there is some latency in the system but it seems to give very reliable signals.
My question is, especially for larger-scale implementation, would a software solution me more efficient? I don't know if would be a good idea to have the main processor tending to the debouncing, in part because the timescale of "bounce" here is perhaps ~ 1 sec. (I.e., if the optocoupler is off for 1 sec we might be satisfied that the train is really gone and not just making really poor contact with the rails). But maybe a dedicated subsidiary processor (SX?) could monitor all the detectors and report occupancy status when queried.
I am implementing a model railroad control system that requires detection of blocks of track. Occupancy is detected by the train wheels completing an 18v AC circuit. Consequently, the signal is very intermittent and noisy.
I developed the attached circuit to generate a clean occupancy signal. The AC circuit drives an optocoupler, which charges a capacitor to yield a smoothly rising or falling voltage. A Schmitt trigger then generates a stable on or off signal. Obviously there is some latency in the system but it seems to give very reliable signals.
My question is, especially for larger-scale implementation, would a software solution me more efficient? I don't know if would be a good idea to have the main processor tending to the debouncing, in part because the timescale of "bounce" here is perhaps ~ 1 sec. (I.e., if the optocoupler is off for 1 sec we might be satisfied that the train is really gone and not just making really poor contact with the rails). But maybe a dedicated subsidiary processor (SX?) could monitor all the detectors and report occupancy status when queried.
Comments
I say, save memory space and stick with the hardware.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.