MPX5700GP pressure sensor
hello,
i have problem gauge pressure sensor
i found 2 different topics mpx5700gp
https://forum.arduino.cc/index.php?topic=425830.0
https://forum.arduino.cc/index.php?topic=99381.0
an still didnt solve problems
maybe sth sensor maybe code or arduino idk :/
im using arduino nano lcd , lcm1602
there code
in attachments there data sheet sensor
thank in advance help
i have problem gauge pressure sensor
i found 2 different topics mpx5700gp
https://forum.arduino.cc/index.php?topic=425830.0
https://forum.arduino.cc/index.php?topic=99381.0
an still didnt solve problems
maybe sth sensor maybe code or arduino idk :/
im using arduino nano lcd , lcm1602
there code
#include <wire.h> #include <liquidcrystal_i2c.h> #define backlight_pin 3 liquidcrystal_i2c lcd(0x27, 2, 1, 0, 4, 5, 6, 7); void setup() { lcd.begin(16, 2); lcd.setbacklightpin(backlight_pin, positive); lcd.setbacklight(high); lcd.home(); lcd.print("voltage"); lcd.setcursor (0, 1); lcd.print("pressure"); } void loop() { // averaging noise removal float sensorvalue = analogread(a0); float voltage = 5000.0 * sensorvalue * (1.0/1024.0); // mv float pressure = ((((voltage / 5) - 0.04) / 0.0012858)/1000.0) ; // kpa lcd.setcursor (10,0); lcd.print(voltage); delay(500); lcd.setcursor (10,1); lcd.print(pressure); delay(500); } |
in attachments there data sheet sensor
after vcc connection on display i can see voltage 258.79 (in mv) and pressure 40.22 (and in kpa) this valuse softly lower or higher slight changes so me big offset of valid value |
thank in advance help
not idea see pressure sensor voltmeter.
your code assumes 5.000volt supply, nano on usb power more 4.6volt.
sensors ratiometric, , should convert directly a/d value pressure.
try example.
i calculated offset , span mpx5700, might need finetuning.
don't expect pressure sensor , 10-bit a/d (1024 values) can display 700 2 decimal places precision.
leo..
or, bit of averaging more stable readout , better offset adjustment.
your code assumes 5.000volt supply, nano on usb power more 4.6volt.
sensors ratiometric, , should convert directly a/d value pressure.
try example.
i calculated offset , span mpx5700, might need finetuning.
don't expect pressure sensor , 10-bit a/d (1024 values) can display 700 2 decimal places precision.
leo..
code: [select]
// mpx5700 pressure sensor (700kpa)
int rawvalue; // a/d readings
int offset = 41; // 0 pressure adjust
int fullscale = 963; // max pressure (span) adjust
float pressure; // final pressure
void setup() {
serial.begin(9600);
}
void loop() {
rawvalue = analogread(a0);
pressure = (rawvalue - offset) * 700.0 / (fullscale - offset); // pressure conversion
serial.print("raw a/d is ");
serial.print(rawvalue);
serial.print(" pressure is ");
serial.print(pressure, 1); // 1 decimal places
serial.println(" kpa");
delay(500);
}
or, bit of averaging more stable readout , better offset adjustment.
code: [select]
// mpx5700 pressure sensor (700kpa)
int rawvalue; // a/d readings
int offset = 410; // 0 pressure adjust
int fullscale = 9630; // max pressure (span) adjust
float pressure; // final pressure
void setup() {
serial.begin(9600);
}
void loop() {
rawvalue = 0;
(int x = 0; x < 10; x++) rawvalue = rawvalue + analogread(a0);
pressure = (rawvalue - offset) * 700.0 / (fullscale - offset); // pressure conversion
serial.print("raw a/d is ");
serial.print(rawvalue);
serial.print(" pressure is ");
serial.print(pressure, 1); // 1 decimal places
serial.println(" kpa");
delay(500);
}
Arduino Forum > Using Arduino > Sensors > MPX5700GP pressure sensor
arduino
Comments
Post a Comment