Connect with us

Simple analog to digital conversion??

Discussion in 'Electronic Basics' started by [email protected], May 19, 2007.

Scroll to continue with content
  1. Guest

    Hi all,

    I'm looking for the *simplest* way to convert a 3-state analog input
    (-5V, 0V, or +5V) into a 2-channel TTL output, as shown in the
    following truth table:

    Input Out 1 Out 2
    ------- -------- --------
    -5V L H
    0V L L
    +5V H L

    I'm a noob and have come up with a pretty convoluted way to do this,
    but I'm not sure how to do it with a single chip-- it seems simple
    enough. Any suggestions?
    Thanks in advance!
  2. Puckdropper

    Puckdropper Guest

    wrote in
    Have you considered looking for a chip to do this for you? You may want
    to check out something like the semiconductor reference guide that Radio
    Shack had available at one time.

    I'd probably start with a couple diodes and a NOT gate. (For 5V
    magnitude voltages, output1 & output2 are NOTted.)

  3. Chris

    Chris Guest

    Hi, Vogelito. The classic solution is to use a dual comparator IC to
    compare the input voltage with a reference, and output a digital logic
    signal. This circuit will fulfill your 1 IC requirement, but will
    also require some resistors (view in fixed font or M$ Notepad):

    | VCC
    | + VCC
    | VCC | +
    | + .-. |
    | | | |10K .-.
    | .-. | | VCC | |10K
    | 10K| | '-' + | |
    | | | | |\| '-' VCC
    | '-' o-----|-\ | +
    |Vin ___ | | | >--o |
    | o-|___|-o----)--o--|+/ 1 .-.
    | 10K | | |/ | |10K
    | .-. | LM393 | |
    | 20K| | | |\ '-'
    | | | '--|-\ |
    | '-' | >------o
    | | .--|+/ 2
    | o-- |/|
    | | ===
    | .-. GND
    | | |10K
    | | |
    | '-'
    | |
    | ===
    | GND
    (created by AACircuit v1.28.6 beta 04/19/05

    The two input resistors change the -5V/0V/5V input into a 0V/2.5V/5V
    input, which allows you to use a single power supply for the LM393
    dual comparator. The two 10K and 20K resistors set the logic level
    changes at 1.25V and 3.75V, halfway between the input levels. The two
    10K resistors at the outputs of the comparators are necessary to
    ensure logic level outputs for TTL, CMOS and all other +5V logic

    Here's the datasheet on the IC:

    Good luck with your homework
  4. JeffM

    JeffM Guest

  5. Jamie

    Jamie Guest

    you need a window type comparator.
    this is basically 2 voltage comparators using the same
    input signal.
    one is driven via the - input and the other is driven
    via the + input.
    a common reference voltage is used to bias the remaining
    inputs of each comparator.
    LM311 is a comparator that may help you there.
    Just put a couple of them together.
    You can also use an old standby LM339 which has
    open collector outputs..
  6. default

    default Guest

    Window comparator is the obvious choice with a single quad comparator
    chip or op amp to do that.

    But what happens if your output is +/- 2.5 volts or exceeds 5 volts?
    Do you care about that? If so, it gets more complicated.
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