Quantasizing Formula


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2007
    Posts
    4

    Red face Quantasizing Formula

    Hello,
    I set up a variable source of 0-25V and I intend to measure the tension and to show in one
    display. I learned on the command " how much level " that is to measure of
    0-5V (to See book " Experimenting with the PicBasic Pro Compiler " - Section
    4-18). somebody already used that command, with the due adaptations,
    to measure 0-25V? I already made 1023*/1250 to generate 5V approximately and
    I multiplied for 5, to give the 25V. The results starting from the reading
    of 6 or 7v they begin to present a mistake of volt hundredths that
    increase with the increase of the tension of POWER. I using a PIC16F877A. Below it follows the part of the reading AD.

    ADCIN PORTA.0, VALOR_AD0
    AUX1 = VALOR_AD0 */ 1250
    AUX2 = AUX1 * 5
    TEN_VOLT = AUX2 / 10000
    AUX3 = TEN_VOLT * 10000
    AUX4 = AUX2 - AUX3 '
    UNIT_VOLT = AUX4 / 1000
    AUX5 = UNIDADE_VOLT * 1000
    AUX6 = AUX4 - AUX5
    DECIMAL_VOLT = AUX6 / 100

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Here's a different way to do it that should be a little more accurate.

    https://www.picbasic.co.uk/forum/showthread.php?p=2010

    Just change the Res1 and Res2 variables to match your voltage divider.
    <br>
    DT

  3. #3
    Join Date
    Jun 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Here's a different way to do it that should be a little more accurate.

    https://www.picbasic.co.uk/forum/showthread.php?p=2010

    Just change the Res1 and Res2 variables to match your voltage divider.
    <br>
    Thank you for the help,
    I tested his/her program but it presents the same problems of mine. With the increase of the tension of the source, 0-25V, the mistake is going increasing, that it begins with 1mV for 10V of the source and it arrives to 8mV with 24V of the source.

    Thank you,
    LLEEDD

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    Hmmm, I don't see how you can be more accurate since:

    1. For 8bit ADC, each step is 25/255=0.098 Volts

    2. For 10bit ADC, each step is 25/1023=0.0244 Volts.

    May be you have to use an external ADC with more resolution.

    Ioannis

Similar Threads

  1. Sine wave power inverter
    By sougata in forum mel PIC BASIC Pro
    Replies: 244
    Last Post: - 23rd February 2017, 05:16
  2. Math Formula / Variable Problem! Help!
    By bwarp in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th February 2006, 07:59

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