I2C sensor help, AMS5915

Hi,
I'm trying to read sensor data with I2C, wire library. I'm having a hard time figuring out how to get out the actual counts for pressure and temperature. Probably very easy if you now a bit more than me. Could simebody please help me creating a sketch. Se enclosed image for sensor data... Thank you very much!!

What sensor? What code?

Please read and follow the directions in the "how to use this forum" message.

The photo seems to be from page 8 here:

The supply for the sensor is 3.0 to 3.6V so bidirectional level shifting needs to be considered as here:
http://playground.arduino.cc/Main/I2CBi-directionalLevelShifter

Yes, AMS5915 is correct and level shifting is taken care of, but what would the lines of code look like for initiating, reading and terminating the I2C communication and finally converting it to float type... Thank you for helping me !!!

but what would the lines of code look like for initiating, reading and terminating the I2C communication and finally converting it to float type.

The AMS5915 is discussed in this thread Barometric pressure sensor with I2C does not output expected bit pattern - Sensors - Arduino Forum

There does not appear to be an Arduino library, and when I google "arduino ams 5915" not a lot shows up.

The BMP 180 is a much better suppported device if you are not comfortable with a data sheet and the Wire.h.

Well I was hoping to learn a thing or two and really want to use the AMS sensor. I'm not interested in the barometric pressure, the sensor id measuring differential pressure...thx

AMS5915 page : AMS 5915 - Board-Mount Pressure Sensor with I2C Output

Which Arduino board do you use ?
Do you have just the sensor ? or a module with the sensor ? If you have a module, please make a photo of it and I want to see the schematic.
How did you connect it ?
Does the i2c_scanner show something ? Arduino Playground - I2cScanner
I think the address is 0x28.
Can you read the pressure and temperature ?

int n = Wire.requestFrom(0x28, 4);      // request 4 bytes.
if ( n == 4)          // check if 4 bytes are received
{
  int pressureMSB = Wire.read();
  int pressureLSB = Wire.read();
  int temperatureMSB = Wire.read();
  int temperatureLSB = Wire.read();

  unsigned int pressureBinary = word( pressureMSB, pressureLSB);
  unsigned int temperatureBinary = word( temperatureMSB, temperatureLSB);

  float pressure = (((float) pressureBinary - ? )/ ?) + ?;  // I don't understand which numbers should be used.
  float temperature = ((float) temperatureBinary * 200.0 / 2048.0 ) - 50.0;
}

An alternative could be:

int n = Wire.requestFrom(0x28, 4);      // request 4 bytes.
if ( n == 4)          // check if 4 bytes are received
{
  byte buf[4];
  Wire.readBytes( buf, 4);
  unsigned int pressureBinary = word( buf[0], buf[1]);
  unsigned int temperatureBinary = word( buf[2], buf[3]);
  ...

Thanks a lot, makes total sense... :slight_smile: