Pages: [1]   Go Down
Author Topic: Mpx4115 pressure sensor solution  (Read 786 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 2
Posts: 148
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi. sensor works great just thought i'd share.

the math to convert to kPa and psi.

a=analogRead(1);

b = ((a * .0049 / 5) + .095) / .009;//conversion to kilopascal kpa  << this is all i wanted to show



regular around sealevel pressure is around 101.xx kpa and 14.xx psi.
« Last Edit: January 22, 2013, 10:03:56 am by grendle » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 289
Posts: 25697
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"a" and "b" (not good variable names, IMO) have global scope.
Why?

Please used code tags when posting code.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Full Member
***
Karma: 2
Posts: 148
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

relax, just lil snippet to test/get sensor working. just trying to help someone since there is very little information on this sensor that I can find.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 289
Posts: 25697
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It isn't clear to me why you display the kPa and PSI values twice.
Please go back to you post and put the code inside code tags.
Use the "modify" control.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Full Member
***
Karma: 2
Posts: 148
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

that was my own testing code, thats probably why it didnt make sense. the only line needed is the conversion so i left that and took everything else out to stop confusion. my fault.
Logged

Pages: [1]   Go Up
Jump to: