ADC question


Closed Thread
Results 1 to 12 of 12

Thread: ADC question

Hybrid View

  1. #1
    Join Date
    Jul 2004
    Location
    CA
    Posts
    78

    Default ADC question

    Hi, I have a simple question regarding the On Board ADC for the PIC18F6520. This device has 10 bit, 16 channel ADC. I want to control several sensors such as a temperature sensor, light sensor using one microcontroller. For the temperature sensor, I want to use the LM34 because of electrical characteristics 10mV per degree F.

    Lets assume that in my application I only want to measure from 0 degree F to 255 degree F. This means that my Vref must be (10mV * 255 points) = 2.55 V. Once I fix the Vref for the temperature sensor to 2.55V, does this mean that I have restricted my light sensor to 2.55 voltage as well, or can I select another Vref for the light sensor. If I cannot select different Vref for different sensor then how can I fix this problem? I am a bit confused with the ADC. Can someone please help me with this, thanks


    -Srig

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Srigopal007 View Post
    Hi, I have a simple question regarding the On Board ADC for the PIC18F6520. This device has 10 bit, 16 channel ADC. I want to control several sensors such as a temperature sensor, light sensor using one microcontroller. For the temperature sensor, I want to use the LM34 because of electrical characteristics 10mV per degree F.
    Lets assume that in my application I only want to measure from 0 degree F to 255 degree F. This means that my Vref must be (10mV * 255 points) = 2.55 V. Once I fix the Vref for the temperature sensor to 2.55V, does this mean that I have restricted my light sensor to 2.55 voltage as well, or can I select another Vref for the light sensor. If I cannot select different Vref for different sensor then how can I fix this problem? I am a bit confused with the ADC. Can someone please help me with this, thanks
    -Srig
    Only one Vref input pin on PIC chips.
    You could probably set up some sort of digital pot to control the Vref using a voltage divider network so you could change the Vref 'on the fly'.

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


    Did you find this post helpful? Yes | No

    Default

    Another idea if you do not want the extra hardware and will give up a little bit of resolution.

    I had the same problem in the past, using a LM34 and a pressure sensor with an output of 1 to 5 volt = 0 psi to MAX. Left the VREF at VDD. OK for the pressure sensor, took the ADC value from the LM34 *2. This gave a 2 degree resolution for the temperature though, and I can not remember but I think the ice water test was off a degree or two also.

    Not perfect but the pressure was the critical thing on that application.
    Dave
    Always wear safety glasses while programming.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Another idea if you do not want the extra hardware and will give up a little bit of resolution.

    I had the same problem in the past, using a LM34 and a pressure sensor with an output of 1 to 5 volt = 0 psi to MAX. Left the VREF at VDD. OK for the pressure sensor, took the ADC value from the LM34 *2. This gave a 2 degree resolution for the temperature though, and I can not remember but I think the ice water test was off a degree or two also.

    Not perfect but the pressure was the critical thing on that application.
    Or instead of scaling up the lower voltage sensor, you could keep the lower voltage Vref, and run the higher voltage sensor output thru a resistor voltage divider network to scale it's voltage down to the lower one.

  5. #5
    Join Date
    Jul 2004
    Location
    CA
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply everyone.

    I am not very concerned about using extra hardware as much as I am about the accurate readings from the sensor. If I use separate external A/D chip for each sensor would this allow me the freedom to select the suitable Vref for the various sensors or will I still be restricted to choosing one Vref?

    Lets say I use an external A/D Chip this means that I can use different Vref for each sensor. Now what Vref do I choose for the PIC18F6520. Do I simply use Vref = 5V? This is where I am getting confused. Can you please help me. any suggestion is greatly appreciated. Thanks

    -Srig

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Srigopal007 View Post
    Lets say I use an external A/D Chip this means that I can use different Vref for each sensor. Now what Vref do I choose for the PIC18F6520. Do I simply use Vref = 5V? This is where I am getting confused. Can you please help me. any suggestion is greatly appreciated. Thanks
    -Srig
    If you're using an external A/D chip, what difference does Vref make if you're not using it?

Similar Threads

  1. PIC16F690 ADC question
    By matador29b in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd October 2009, 23:03
  2. Newbie HPWM / ADC question
    By Johan in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th June 2007, 12:52
  3. A question about ADC (using Pic16f876)
    By mimmmis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd April 2007, 16:26
  4. strange adc question
    By maus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th November 2006, 10:57
  5. ADC question
    By schu4647 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th May 2006, 14:15

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