ADC conversion trouble


Closed Thread
Results 1 to 25 of 25

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Use a voltage divider to set the VREF. Darrel has info here.
    http://www.pbpgroup.com/modules/wfse...p?articleid=25

    Try reading your LM35 with a volt meter. Possible it is doing the skipping.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    BTW, do you have any clue about why it skips 28? Could it be something wrong with my math?
    No, not really, except from the fact that you only get two counts per degree from the ADC. You might wan't to try taking 10 or more samples and average them to filter the signal. Also it's possible that you're running into some kind of rounding error in the math due the low resolution but I haven't looked into it that much.

    Regarding the external Vref I'd suggest you look at the datasheet for the particular PIC you're using regarding the ADC and its various Vref options.

    Another option might be to just put an OPAMP after the sensor, boosting the signal by a factor of xx to better utilize the full range of the ADC.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    A good current/temperature compensate Vref is always more than welcome... boosting the sensor output... mmmmpppppfffffff maybe not a good idea.

    There's a load of great few bucks constant voltage source ICs here and there.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    Hi Steve,
    I agree that a temp compensated Vref source is a better solution here but would you care to explain why you think it's not a good idea to boost the signal from the sensor?

    Yes, the sensor noice will be amplified too but it shouldn't be that bad. Actually, amplifying the signal or lowering Vref shouldn't make any difference, except from non linearity of the amp and possible noice added BY the amp but I don't think that would be a problem in this case.

    /Henrik.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I guess it depend of the accuracy you need. If you use the internal Vref, when the PSU voltage swing, your accuracy will swing with accordingly right?

    Assuming the supply never ever swing... yeah you may boost the sensor output... carefully designed it has to work. Not something i would test on a breadboard... i'm kinda noise freak
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    I guess it depend of the accuracy you need. If you use the internal Vref, when the PSU voltage swing, your accuracy will swing with accordingly right?
    Yes absolutely, but if you have 20mV noice or swing on the supply rail with a sensor output of 10mV/° you have 2° worth of noice. If you boost the signal to 100mV/° the same noice on the supply rail is now "worth" 0.2° instead.

    PICante,
    In a previous reply I sugested a Vref of 1.024V but after reading the 16F88 datasheet that may not have been a very good advice. Vref needs to be 2V minimum according to the datasheet so keep that in mind if you go for an external reference.

    /Henrik.

  7. #7
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Smile

    Thanks guys!

    Yes I like to try the external reference and I need one decimal accuracy with +- 0.5C overall. Maybe it will take a high stability voltage source to reach this.

    Now I will try to figure out how to connect the Vref + & Vref- also how to set the bits in ANSEL and ADCON1 perhaps even the CVRCON? Not easy being a newbie! :-)

Similar Threads

  1. Can't get ADC to loop
    By TravisM in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th October 2009, 15:33
  2. A/D conversion with PIC18F67J50
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 01:48
  3. Help with ADC conversion
    By dbachman in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st February 2009, 20:02
  4. ADC trouble with PIC16F88
    By inventosrl in forum mel PIC BASIC
    Replies: 9
    Last Post: - 3rd December 2008, 12:56
  5. ADC problem
    By NacNud in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th December 2004, 02:27

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