PIC Based Auto-Reversing System

KE4NYV Nov 29, 2016

  1. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    I have been working on a auto-reversing system based around a PIC18F1220. All code was written in C and so far it seems to be working well. I'm planning to use this on my layout in addition to the DCC mainline to run a tram/metro train back and fourth on a single line.

    Here are a couple of quick demo videos:



     
  2. warnerj01

    warnerj01 TrainBoard Supporter

    130
    40
    16
    intersting
     
    KE4NYV likes this.
  3. CSX Robert

    CSX Robert TrainBoard Member

    1,503
    640
    41
    So, it looks like the PIC is just triggering a relay. I don't understand the reason for using the PIC, if that's all I was doing I would just use a latching relay and have the switch at each end of the run trigger the relay.

    A better solution would be to drive an H-Bridge with a PWM signal, that way you could ramp the speed down and up when reversing, and even put a delay in at each end. That would look much better and be easier on the drivetrain than the sudden reversal of flipping a relay.
     
    Xmtrman likes this.
  4. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    Since posting this I have added a 2x4 jumper block to implement delay. The PIC gives me complete flexibility in the design.
     

Share This Page