Having a PIC ADC read a specific Voltage range.

Thread Starter

durie

Joined Jun 7, 2008
4
I am interfacing an ambient air pressure sensor to a PIC ADC. The sensor outputs a voltage between 0v and 5v, however I am only interested in reading output voltages between 3.5v and 4.5v and would like to get the maximum ADC resolution in that range.

The best I can figure out is that the PIC ADC will read voltages between Vss (0v) and Vdd (+5v) or Vref (0v - 5v). I am able to set the upper limit of the range with Vref, but I have no idea how to set the lower limit.

Can I somehow shift the output voltage of the sensor (subtract 3.5v) or is there a way to set the PIC to use 3.5v as the lower limit? The best I can determine from the PIC documentation, it only uses the Vss pin (0v) for the lower limit of the ADC.

Thanks for any help.
 

mik3

Joined Feb 4, 2008
4,843
Why do you need the full resolution between this range?
Is it a 10 bit ADC?
How much variation in pressure do you want to detect?
What is the relationship between pressure ans output voltage?

Can you tell us the sensor's part number or post a link for its datasheet? Maybe you dont need to worry about it?

I am asking all of these because i need to see if you really need to make modifications. You can make some modifications by using comparators and a differential amplifier but this wont be more accurate than the ADC itself due to components inaccuracies.
 

Thread Starter

durie

Joined Jun 7, 2008
4
Pressure sensor part # MPXA6115A Data Sheet:
http://www.freescale.com/files/sensors/doc/data_sheet/MPXA6115A.pdf

This is going to be used as an altimeter. The sensor detects 15kPA to 115kPA, or (if i did my math properly) roughly -10000' to 40000' in altitude. This translates into a resolution of about about 50'. I only need to be able to detect an altitude change in the neighborhood of 2000 - 4000' and was hoping to get a resolution between 5 and 10 feet.

I am using a 10 bit ADC on a PIC16F690.
 

Thread Starter

durie

Joined Jun 7, 2008
4
By the way, I am also only interested in measuring changes in pressure over a short amount of time (5 to 15 seconds.) I do not need to read the absolute pressure accurately, only the change in pressure.
 

mik3

Joined Feb 4, 2008
4,843
By the way, I am also only interested in measuring changes in pressure over a short amount of time (5 to 15 seconds.) I do not need to read the absolute pressure accurately, only the change in pressure.
You can use the analog inputs of the pic to detect when the voltage is between 3.5 and 4.5 volts. When this is true the pic will activate a differential amplifier with a gain of 5 to amplify this 1 volt difference into a 5 volt difference so you can you the full range of the pic`s ADC to read the value.
 
Top