ADC lcd display help


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108

    Question ADC lcd display help

    Hello all,

    I am finally able to re-visit an old project of mine and am in need of a bit of assistance.
    I've got a 16F886 up and going with one exception... the ADC.
    I've got a DC source I'm monitoring with 10 bit res. on AN0.
    The details:
    DC can swing from 0-350 vdc.
    This runs through a 70:1 scaler and is clamped to 5.1 vdc.
    So at 350 vdc, max scaled voltage will be 5 vdc. (350/70)
    ...
    This is where I get way confused
    Can one of you fine folks explain how to determine the ADC "count" based on my 0-350 vdc?
    and
    How to convert the ADC counts back to the 0-350 vdc in order to display it on an lcd?
    ...
    Thank you all,
    Chris

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    10 bit A/D count = 1023 when Vin = Vref
    12 bit A/D count = 4096 when Vin = Vref
    Charles Linquist

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Correction:

    12 bit A/D count = 4095 when Vin = Vref
    Charles Linquist

  4. #4
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Thanks Charles,

    I think I grasp that concept.
    350/1024 = .3418 ... so for every .3418 volt change at the 350 side of things, there is a "count" change.
    Therefore, if we start with, say:
    165 vdc
    ...through the voltage scaler to the ADC in:
    165/70 = 2.3571 vdc
    VRef(5.1)/1024 = .004883
    2.3571/.004883 = 482.7115 <<<<<<<<<<<<<<<<<<< The ADC "count" would be 482?
    (ADC count * 4883 * Scaler ratio) / 10000
    (482*4883*70) / 10000 = 16475.242<<<<<<<<<<<<<<<<< 16475 is the "high voltage"?
    ...for the lcd:
    LCDOut 16475/100,".",16475//100," VDC"
    "164.75" <<<<<<<<<<<<<<<<<<<<<<<<< Where did I go wrong in not getting "165"?

    I am probably confusing myself more than I'm helping.
    Would love a quick tutorial from one of you knowledgeable folks.

    Thanks again,
    Chris

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    At the risk of confusing you more...
    http://www.picbasic.co.uk/forum/cont...Sensor-Scaling
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Thanks Mack,

    Funny you point out that thread... That's the one I've been racking my brain over.
    I'll take another look though.

    Chris

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts