Pages: [1]   Go Down
Author Topic: analog Gauge Pressure sensor to arduino uno  (Read 1357 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

HI Guys i really am in need of help

I have a MPX5700GP pressure sensor, it has a 0- 700kPa gauge pressure range and a 0-5V output voltage.
The sensitivity is 6.4mV/kPa.    its my design project for college.

My problem is I dont know how to take the volages and compensate the values accordingly, the output voltage on the sensor compared to the values displayed serially are not the same.


if my sensor is reading no pressure.  the voltage output is 0.20V   but if i display the analog value it shows 40. 

im really lost. could somebody help me. i have recorded a range of values with pressure accordingly. if any data is needed. i will send.   please help
Logged

SW Scotland
Offline Offline
Edison Member
*
Karma: 13
Posts: 1315
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

More information required :

Circuit in use
Code you are using
Data you are seeing (pressure versus voltage versus counts)
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12428
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


based upon the info you gave:

Code:
// averaging for noise removal
float sum = 0;
for (int i=0; i< 16; i++) sum += analogRead(A0);
sum /= 16;

float voltage = 5000.0 * sum /1024.0;  // mV
float pressure = voltage/6.4;  // kPa
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey thanks for the info, but why is the a count of 16?


because after i get my readings i still need time to save the data to the eepropm and
timestamp it
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12428
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

16 is because that is a number that balances the extra time and the result quite well for most sensors I have used. The averaging is not strictly needed as you can handle noise also otherwise e.g. by a low pass filter.

Can you post your sketch sofar?
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino Readings and Analog Readings      
      
Apllied pressure (kPa)   Vout of sensor (mV)   A0 output
0   208   49
50.04   526   105
100   847   170
150   1168   236
200   1490   301
250   1813   367
300   2132   434
350   2459   500
400   2785   567
450   3110   633
500   3437   700

i am battling to send my datasheet and pic. but these are my readings
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16499
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino Readings and Analog Readings      
      
Apllied pressure (kPa)   Vout of sensor (mV)   A0 output
0   208   49
50.04   526   105
100   847   170
150   1168   236
200   1490   301
250   1813   367
300   2132   434
350   2459   500
400   2785   567
450   3110   633
500   3437   700

i am battling to send my datasheet and pic. but these are my readings


Well a simple map() function set up to use the 'calibration' numbers you are seeing is one way to skin the cat.

Code:
void setup()
 {
   Serial.begin(9600);
 }

void loop()
{
  int val = analogRead(A0);
  val = map(val, 49, 700, 0, 500);
  Serial.println(val);
}

Lefty
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12428
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The map solution is probably the simplest, below my code adjusted for the zero calibration
Code:
// averaging for noise removal
float sum = 0;
for (int i=0; i< 16; i++) sum += analogRead(A0);
sum /= 16;

float voltage = 5000.0 * sum /1024.0;  // mV
float pressure = (voltage-208)/6.4;  // kPa
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

okay thanks guys, but im still not getting the pressure values on the serial monitor.  im getting so stressed out here.   please any advice. am i making a mistake or is there a problem with my arduino?
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 48
Posts: 3402
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It would be easier to help if we could see your code.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16499
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

okay thanks guys, but im still not getting the pressure values on the serial monitor.  im getting so stressed out here.   please any advice. am i making a mistake or is there a problem with my arduino?


Can you be a little more specific of what exactly is stressing you out? What is your expectations Vs what you are getting? And of course your code will be to be seen to offer any corrections if indeed there are correction needed.

Lefty

Logged

Pages: [1]   Go Up
Jump to: