I have some air pressure sensors that use 12 volts to run. I ran a couple of tests with a 5v regulator. The information I came up with is at 0 psi it read .011 volts, then at 40 psi 1.41 volts and at 80 psi it read 2.55 volts. I am having a problem coming up with an equation. I am wanting psi to be displayed on my screen. Any help would be great, I am stuck at the moment.
Thank you very much for your help.
The values are not quite linear. If you collect a few more readings, you'll be able to improve the accuracy.
A manufacturer and model number might be helpful, or far better would be a datasheet.
The values you gave don't fit a nice linear equation (y=mx + b). So if you can't find a datasheet, you may need several more values to determine either a higher-order polynomial equation or a piece-wise lookup table where each segment of the table is approximately linear and you can interpolate in between.
Ok did some more tests and this is what i came up with.
Using a car battery at 12.7 volts...
0 psi - .02V
10 psi - .50V
20 psi - 1.20V
30 psi - 1.70V
40 psi - 1.90V
50 psi - 2.35V
60 psi - 2.75V
70 psi - 2.95V
80 psi - 3.09V
90 psi - 3.20V
100 psi - 3.30V
Any help would be awesome. I am just stuck and trying to get this part figured out.
Thank you again.
A manufacturer and model number might be helpful, or far better would be a datasheet.
Since you have different readings when you changed the supply voltage, it would appear that the output depends on the supply voltage as well as the pressure. It also seems to not be quite linear.
Unless you can find a datasheet that gives you the output function, then you'll probably have to use a lookup table and interpolate. First, pick a supply voltage (might want a good regulator going to the sensor) then make a table like you just did.
You'd then want to create a table look up function where you look up the voltage value that you're reading and interpolate the pressure value. For example, if you read 1.40 V (from your table below), then the pressure is between 20 and 30 psi. You can get the psi by:
psi = (Vin - Vlo)/(Vhi - Vlo) * (Phi - Plo) + Plo
psi = (1.40 - 1.20)/(1.70 - 1.20) * (30 - 20) + 20 = 24 psi
Vin - analog input voltage
Vlo - first table voltage <=Vin
Vhi - first table voltage >Vin
Plo - pressure @ Vlo
Phi - pressure @ Vhi
Of course there is a slight error since the device's output isn't truely linear, but the more points in the lookup table, the smaller the gap that you have to interpolate across, and the closer each segment gets to being linear. Of course, larger lookup tables start eating up memory.
Again, some information about the device (model #) would be very helpful.
Ok here is a table i got from Dakota digital. But all the numbers they gave me was in OHMs. How do i translate that to a 5V input to my micro controller.
Thank you again.
sender pressure
ohms PSI
14.2 0
15.6 2
17 4
18.5 6
20 8
21.5 9
23.1 10
24.7 11
26.3 12
27.9 13
29.6 14
31.3 16
33 17
34.8 18
36.6 19
38.4 20
40.3 22
42.2 23
44.2 24
46.2 26
48.2 27
50.3 28
52.4 30
54.5 32
56.8 33
59 35
61.3 37
63.7 39
66.1 41
68.6 43
71.1 45
73.7 47
76.3 49
79 52
81.8 54
84.7 56
87.6 58
90.6 61
93.6 63
96.8 66
100 69
103.3 72
106.7 74
110.2 77
113.8 80
117.5 83
121.3 86
125.2 89
129.2 93
133.3 97
137.6 100
142 104
146.5 109
151.2 113
156 117
161 122
166.1 127
171.4 132
176.9 138
182.6 144
188.5 149
194.6 150
200.9 150
207.5 150
214.3 150
There just isn't enough information to answer your question. If you provide more details someone may be able to help.