10 bit ADC of arduino reading off 12 bit pressure sensor

I wish to record the output of an analog pressure sensor. The website says that it has a 12 bit resolution. I'm using an arduino uno. I believe it uses a 10 bit ADC. How do implement the conversion in the code? should i use

Operating voltage( max) = 5 V ( range 0-5)
Does the conversion per bit = 5 /1023 ( for 10 bits) or 5/4095 ( for 12 bits)

You get only 10 bits of resolution with the Arduino ADC.

Post a link to the sensor data sheet.

http://au.mouser.com/ProductDetail/Honeywell/SSCSNBN005PDAC5/?qs=%2Fha2pyFadujTzXc4EG5AIpywoMeCdsHuWImDF3mnLPxOkVmFo1jG4A%3D%3D

jremington:
You get only 10 bits of resolution with the Arduino ADC.

Post a link to the sensor data sheet.

Here's the link
http://au.mouser.com/ProductDetail/Honeywell/SSCSNBN005PDAC5/?qs=%2Fha2pyFadujTzXc4EG5AIpywoMeCdsHuWImDF3mnLPxOkVmFo1jG4A%3D%3D

What I get from data sheet, you have a 5 volt sensor with analog output from 5% to 85% of supply voltage, so 0 PSI would be 0.25 volts or ADC value of 51 and 5 PSI 4.25 volts ADC value 870.

I think. :slight_smile:

According to the device data sheet, the output voltage range for the analog version of the sensor is from 0.1 to 0.9 of the supply voltage, so you get only about 800 bits of resolution. The digital version would be much better.

.
0.8 x Vsupply
Output (V) = ---------------- x (Pressureapplied – Pmin.) + 0.10 x Vsupply
Pmax. – Pmin.

jremington:
According to the device data sheet, the output voltage range for the analog version of the sensor is from 0.1 to 0.9 of the supply voltage, so you get only about 800 bits of resolution. The digital version would be much better.

How do i implement that formula in the code?

My method

I used analogread() to get the output bit value added 0.5 to it for error correction. Then multiplied that by 5/1024 ( since supply = 5V and arduino has a 10 bit ADC from 0-1023). From the data sheet, the sensor values are from 5-85% of the output voltage. ( 85% of 5V = 4.25 V and 5% of 5V = 0.25V).

voltage = (analogread() +0.5)*(5/1024)
Therefore,

float pressure = voltage * (5 psi/ 4.25 V); (where 5 psi output corresponds to 4.25 V).

But I do not get the same values as the formula in the data sheet.

Thanks for any help

Calibrate the sensor by applying known pressure values and recording the ADC output.

The data sheet says that the sensors have been calibrated and compensated. Does that mean i do not have to do so myself?

float pressure = voltage * (5 psi/ 4.25 V); (where 5 psi output corresponds to 4.25 V).

This formula is not correct. Substitute 0 psi to see why.

I posted the correct formula (from the data sheet) in reply #5.

You could also try the procedure linked in reply #7.

Yeah thanks, Ive modified the formula. I wish to display these values on a graph. Is there an inbuild library for that ?