Shop OBEX P1 Docs P2 Docs Learn Events
Design question: hardware or software — Parallax Forums

Design question: hardware or software

Professor ChaosProfessor Chaos Posts: 36
edited 2007-09-25 13:32 in BASIC Stamp
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.
860 x 522 - 39K

Comments

  • pwillardpwillard Posts: 321
    edited 2007-09-25 13:32
    Actually, your solution is rather elegant.· It's simple, scalable and not complicated.· Real world interfacing with noisy analog environments can cost·you more code space than you might want to give up on the·Stamp.

    I say, save memory space and stick with the hardware.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
Sign In or Register to comment.