Optical rotary encoders and Schmitt triggers

Discussion in 'General Electronics Chat' started by atferrari, Apr 3, 2013.

  1. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,648
    764
    Optical rotary encoders as in PC's mice to be read through two PIC's pins.

    Schmitt triggers in between, are they convenient? Or a must? Or not necessary at all?
     
  2. #12

    Expert

    Nov 30, 2010
    16,298
    6,810
    I don't know if a mouse output is so sloppy that a Schmidt trigger would clean up the signal. The mouse might even have Schmidt triggers inside it! Maybe it depends on the length of your cable. This is where a 'scope can be a hero.
     
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,605
    Which PIC? Which pin?

    Some PIC pins *have* a Schmitt trigger built in.

    However, as long as the PIC has enough time to process the fastest possible legit change of encoder state then it can work just fine. Also, the worst bobble of encoder outputs happens at the very slowest of change rates, when the mechanical obstruction is almost interrupting the signal, so it really isn't a problem anyway.

    So triggers aren't really necessary to begin with.
     
  4. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,648
    764
    THanks for replying to you both.

    Shame on me. Forgot that MOST of pins in MOST of PICs have ST for digital input. So simple...
     
  5. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,648
    764
    This is what the ST will have to deal with: output of one of the sensors obtained while turning de encoder's disk slowly back and forth.
     
    Last edited: Apr 13, 2013
  6. #12

    Expert

    Nov 30, 2010
    16,298
    6,810
    This is the kind of thing Schmitt Triggers are good at.
     
Loading...