Connect with us

CMOS buffer hysteresis?

Discussion in 'Misc Electronics' started by Mark Haase, Aug 20, 2004.

Scroll to continue with content
  1. Mark Haase

    Mark Haase Guest

    Hi all--

    I'm building a drivetrain for an autonomous robot, and I bought a
    photointerrupter to use as part of a homebrew shaft encoder. With
    tweaking of the circuit, the photo interrupter outputs about .5V when
    the encoder disk is black, and about 4.6V when the encoder disk is
    white. These vales are probably OK for talking to my HC11, but I figured
    that to "do it right" meant using a CMOS buffer. (The exact part I
    bought is here: Instruments/Web data/CD74HC4049

    I used the output of my circuit to send signals to an input compare pin
    on my MCU. The problem is that the CMOS buffer's output apparently
    oscillates rapidly, and so when the optical encoder moves forward one
    segment, my MCU gets dozens or hundreds of input pulses.

    Without a scope I can't tell exactly what's happening, but AFAIK buffers
    usually have about a .5V hysteresis, true? So I guess what's happening
    is that the CMOS buffer is oscillating between 0 and +5V very rapidly.
    So my question is, how on earth should I smooth out the input signal to
    my MCU? The pulses I'm interested in will be at least a few MS long (the
    optical encoding disk has 16 segments, and the motor's output is about
    120RPM). The MCU is 2Mhz, but its juggling a bunch of other tasks and
    there's no FPU, so I can't do the smoothing in software--unless there's
    a real efficient way I don't know about. (Ie. I'm familiar with FIR and
    IIR but they seem to be too expensive for my application).

    Thanks for any hints--I don't even know the terms for which I should

  2. CWatters

    CWatters Guest

    Try adding an RC filter to the output of the photo interrupter and change
    the HC4049 for something like a Schmitt Inverter (eg like an 74HC14 but
    perhaps there is one with the same pin out as the 4049?).
  3. John Fields

    John Fields Guest

    The easiest way out of the mess is to dump the 4049 and use a
    comparator with some hysteresis, like this:

    | | |
    | | [2K]
    | | |
    [100K] +--|--[100k]--+
    | | | |
    OPTO>----|---[10K]--+-|+\ |
    | | >--------+---->OUT TO HC11
    | |
    [100K] |
    | |

    You could use something like half of an LM393, and if you do, make
    sure you connect the inputs and outputs of the unused comparator to
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day