I2C communication of SM5852 sensor with arduino

Hi I am trying to communicate SM5852 differential pressure sensor with arduino using i2c communication.This is the following code i got ( ref below). whenever i connecting with arduino board i am getting "I2C transaction error" in serial monitor.can anybody help me what is wrong here.

#include "Wire.h"
#include <stdint.h>

#define SENSOR_I2C_ADDR 95
#define SENSOR_REG_PRESSURE_LSB 128
#define SENSOR_REG_PRESSURE_MSB 129

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

void loop()
{
Wire.beginTransmission(SENSOR_I2C_ADDR);
Wire.write(SENSOR_REG_PRESSURE_LSB);
Wire.endTransmission(false);
Wire.requestFrom(SENSOR_I2C_ADDR,byte(1));

Wire.beginTransmission(SENSOR_I2C_ADDR);
Wire.write(SENSOR_REG_PRESSURE_MSB);
Wire.endTransmission(false);
Wire.requestFrom(SENSOR_I2C_ADDR,);

uint16_t pressureRaw;

if(Wire.available() == 2)
{
uint8_t lsb = Wire.read();
uint16_t msb = Wire.read();
pressureRaw = (msb << 6 | lsb) & 0x0FFF;

Serial.print("Raw pressure value: ");
Serial.println(pressureRaw);
}
else
{
while(Wire.available())
Wire.read();
Serial.println("I2C transaction error");
}
delay(1000);
}

Ref:

Run the I2C scanner program to confirm the I2C address and communication with the I2C bus. Do you have pullup resistors on the SDA and SCL pins?

// I2C scanner by Nick Gammon.  Thanks Nick.

#include <Wire.h>

void setup() {
  Serial.begin (115200); //*****  make sure serial monitor baud matches *****

  // Leonardo: wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

can anybody help me what is wrong here.

Besides the lack of proper capitalization and spacing between sentences?

There is an I2C scanner sketch that you should run BEFORE making any attempt to actually send data to/receive data from an I2C device. That sketch tells you the address of the device(s) that are connected to the I2C bus correctly. Have you run that sketch? Is the device KNOWN to be connected correctly?

   Wire.requestFrom(SENSOR_I2C_ADDR,);

That can't be the code you are running on the Arduino, since that won't even compile.

After EVERY call to Wire.requestFrom(), you need to read the response BEFORE sending data to the device again and calling Wire.requestFrom() again.

@OP

1. The Internal Registers Table
Press5820.png

2. You have poor understanding (or not at all!) on the working principles of the I2C Bus in respect of data communication. Therefore, I have tried to correct your codes based on the suggestions of the previous posts. Give a try on it and report the result. I can't test the sketch due to lack of the sensor.

#include "Wire.h"
//#include <stdint.h>  why is this file included?

#define SENSOR_I2C_ADDR 95
#define SENSOR_REG_PRESSURE_LSB 128
#define SENSOR_REG_PRESSURE_MSB 129

uint16_t pressureRaw;

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

  //checking that the device is present
  Wire.beginTransmission(SENSOR_I2C_ADDR);
  byte busStatus = Wire.endTransmission();
  if (busStatus != 0x00)
  {
    Serial.println("I2C Bus Error/Device not Found!");
    while (1); //wait for ever
  }
}

void loop()
{
  Wire.beginTransmission(SENSOR_I2C_ADDR);
  Wire.write(SENSOR_REG_PRESSURE_LSB);  //pointing the low-byte register of pressure sensor
  Wire.endTransmission(); //transfer the above queued data and bring STOP condition on I2C Bus(false);

  Wire.requestFrom(SENSOR_I2C_ADDR, 2);//request for 2-byte data byte(1));

  //Wire.beginTransmission(SENSOR_I2C_ADDR);
  //Wire.write(SENSOR_REG_PRESSURE_MSB);
  //Wire.endTransmission(false);
  //Wire.requestFrom(SENSOR_I2C_ADDR,);

  // uint16_t pressureRaw; declare in the global area
  //  if (Wire.available() == 2)
  //  {

  uint8_t lsb = Wire.read();  //6-bit
  uint8_t msb = Wire.read();//6-bit uint16_t msb = Wire.read();

  //fit <msb, lsb> into pressureRaw variable
  for (int i = 0; i < 6; i++)
  {
    bitWrite(pressureRaw, i, bitRead(lsb, i));
  }

  for (int i = 6, j = 0; i < 12, j < 6; i++)
  {
    bitWrite(pressureRaw, i, bitRead(msb, j));
  }

  pressureRaw = pressureRaw & 0x0FFFF;//(msb << 6 | lsb) & 0x0FFF;

  Serial.print("Raw pressure value: ");
  Serial.println(pressureRaw);
  //}
  //else
  //{
  //while (Wire.available())
  //Wire.read();
  //Serial.println("I2C transaction error");
  //}
  delay(1000);
}

Press5820.png