Well, that is the easy part:
result = (value * 505)/2
or
result = value * 505
result = result / 2
That does not quite work. Here is the way to test it: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 )
Look at the data sheet where it says 2.5 volts, and check out how much pressure it takes to get it there. Looking down, it shows 130 kPa. Using Vs as 5 for 5v we can multiply it out.
top equation result is 2.5985v
your equation result is 7,035.23v (wear some good personal protective equipment for that)
Also, if I understand what you wrote before, I really dont have to convert the output to voltage first ?
Voltage is voltage. If we change both side of the equation to mv, v, or a/d steps, we are good.
I will have to think a while how to convert the equation to something easier. But, if I use the handy dandy program that Alain linked above, we can find that 1/271 = .00369
So if I do some math (must be done to the .04 as well as the .00369*P) I eventually (after a few mistakes of course.....)
Result = vs * (((25*Pressure) + 271)/6775)
This comes about by solving for 1/271*P + 1/25
First I multiply by 271 .... so....
(271/271*p + 271/25)/271
Then I multiply all by 25 to get rid of the fraction
since 271/271 = 1
(25*P + 271)/(25 * 271)
or
(25 *P +271)/6775
We can test this using the same method as I tested yours. I caught about 5 of my errors this way, before I go the right answer....
Bookmarks