Assistance need in Honeywell pressure sensor

hi every one I need assistance for mprls0300yg0001bb pressure sensor manufactured by Honeywell .we're encountering several problems like

1.The Readings of the actual data(correct pressure) is calculated after shift from correct pressure value17-20 seconds.

2.We are using the Atmega328p[Arduino nano] series Microcontroller chip to evaluate the pressure using the Spi interface. Thus we need to upgrade our Microcontroller with better processing power. If not how we can improve the response time?

3.In our experimental setup using an [htc manometer Pm-6205] as a reference if we are getting correct pressure but after a fraction of seconds it shift to a wrong value like negative=>10 after few reading it starts displaying correct pressure this problem occurs at specific pressure points every time.

the code is #include<Arduino.h>
#include<SPI.h>

double press_counts = 0; // digital pressure reading [counts]
double temp_counts = 0; // digital temperature reading [counts]
double pressure = 0; // pressure reading [bar, psi, kPa, etc.]
double pressure1 = 0;// error value pressure reading [bar, psi, kPa, etc.]
double temperature = 0; // temperature reading in deg C
double outputmax = 3774874;//15099494; // output at maximum pressure [counts]
double outputmin = 419429;//1677722; // output at minimum pressure [counts]
double pmax = 300; // maximum value of pressure range [bar, psi, kPa, etc.]
double pmin = 0; // minimum value of pressure range [bar, psi, kPa, etc.]
double percentage = 0; // holds percentage of full scale data
char printBuffer[200], cBuff[20], percBuff[20], pBuff[20], tBuff[20];

void setup() {
 Serial.begin(9600);

 while (!Serial) {
 delay(5000);
 }
 sprintf(printBuffer, "\nStatus Register, 24-bit Sensor data, Digital Pressure Counts,\
 Percentage of full scale pressure,Pressure Output, Temperature\n");
 Serial.println(printBuffer);
 SPI.begin();
 pinMode(10, OUTPUT); // pin 10 as SS
 digitalWrite(10, HIGH); // set SS High
 
}

void loop() {
 delay(1);

 uint8_t data[7] = {0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; // holds output data
 uint8_t cmd[3] = {0xAA, 0x00, 0x00}; // command to be sent
 SPI.beginTransaction(SPISettings(200000, MSBFIRST, SPI_MODE0)); //SPI at 200kHz
 digitalWrite(10, LOW); // set SS Low
 SPI.transfer(cmd, 3); // send Read Command
 digitalWrite(10, HIGH); // set SS High
 delay(10); // wait for conversion
 digitalWrite(10, LOW);
 SPI.transfer(data, 7);
 digitalWrite(10, HIGH);
 SPI.endTransaction();
 press_counts = data[3] + data[2] * 256 + data[1] * 65536; // calculate digital pressure counts
 temp_counts = data[6] + data[5] * 256 + data[4] * 65536; // calculate digital temperature counts
 //temperature = (temp_counts * 200 / 16777215) - 50; // calculate temperature in deg c
// percentage = (press_counts / 16777215) * 100; // calculate pressure as percentage of full scale
 //calculation of pressure value according to equation 2 of datasheet
 pressure = (((press_counts - outputmin) * (pmax - pmin)) / (outputmax - outputmin) + pmin);
 pressure1 = pressure; 

 dtostrf(press_counts, 4, 1, cBuff);
 dtostrf(percentage, 4, 3, percBuff);
 dtostrf(pressure, 4, 3, pBuff);
 dtostrf(temperature, 4, 3, tBuff);
 /*
 The below code prints the raw data as well as the processed data
 Data format : Status Register, 24-bit Sensor Data, Digital Counts, percentage of full scale
pressure, pressure output,
 temperature
 */
 sprintf(printBuffer, "%x\t%2x %2x %2x\t%s\t%s\t%s\t%s \n", data[0], data[1], data[2], data[3],
 cBuff, percBuff, pBuff, tBuff);
 Serial.print(printBuffer);
 delay(10);
}
}

datasheet

I see, that the temperatur is currently taken out, but it would be interesting to understand, if we are getting there plausible data.

  1. Is the temperatur reading constantly correct, when the pressure is coming out of expected values?
  2. From where comes the values for
    outputmax
    outputmin
  3. Is it needed to be read with such a high rate? At least for a start, I could imagine to rise the time till the next reading, e.g. delay(100);
  4. You have mainly overtaken the reference code, but changed a few things without really changing the intended behaviour, or? Why? Does the pure reference code deliver the same behaviour?

Do I understand you right, that you get negative values, when the pressure is changed, but then stabilizing to something expected?

What is the system, which is measured? How big it is?

What is creating the pressure changes? How fast the pressure is changed?

Please give more information about the application!
For what you need "processing power"? Just for the reading the Atmega328p seems perfectly fitting.

@singh7188
Are you using level translators for the SPI signals?
Do you have the recommended bypass capacitors?
Have you calibrated the sensor?

An I2C sensor with SPI code.
Am I missing something?
Leo..

Doesn't the datasheet indicate that the sensor supports both SPI and I2C, or did I look at the wrong device ...

Table 8 says that xxxAB is SPI and xxxBB is I2C.
You state in post#1 that you have the BB model.

Start by using the right data types. A double on that processor is a float. Not needed and potentially much slower than an int or long.
Leo..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.