Forgive me for being stupid, but how do I do that ? ( value * (505 /2 )) ?
Yes, the input is a pressure sensor and the vref for it is 5v, I also use a 10bit AD, so 5v = 1024 and 0v is 0.Originally Posted by scalerobotics
My idea was to first convert this value to voltage, and put that value into the next step.
However this is a bit strange, coz if 5v == 1024, each step is 0.0048828125 . then a reading of 40 == 0.1953125, BUT, if I measure the output pin with a multimeter I get 0.205v ?
Ah, maybe its not really 5v I thought ? ..measured it, and ok, 4.97, that makes each step 0,004853515625, and then the value is 0,194140625 ? Hmm Hmm..
I also tried another multimeter, and that showed 0.20 (at the sensors output pin), so I guess thats not the problem.
But as I understand you I dont have to convert it first at all ?
Hmm, ok, sounds logical..Originally Posted by scalerobotics
To be sure that everything is clear here I'll try to describe what I'm tryiong to do in detail.
Basically I want to read a pressure sensor (Freescale MPX4250D) with my pic (PIC16F877A) using a analog pin (AN5) with a 10bit AD-converter. I want the value in kPa or Bar.
Reading the Pressure sensors datsheet I found:
Vout = Vs* (0.00369*P + 0.04) ± Error
..Wich I thought would be the same as
calcpress = ((( pressure / Vs ) - 0.04 ) / 0.00396 )
..I can be wrong here, I'm not very fond of math, and it was many years ago I used my (nearly not existing) mathskills..
Also, if I understand what you wrote before, I really dont have to convert the output to voltage first ?
..Another thing, its very hard to test this stuff.. how do I create a known pressure ? ..I know that the car repairers have a little thing that they use to create pressure or vaccuum witha meter on it, but I guess they are expensive.
Bookmarks