Question
LPS25H wrong pressure value
Posted on July 27, 2015 at 18:07
Hi ST Community!
I am working with LPS25H pressure sensor and STM32F1 uC. I am able to read out temperature and pressure but the pressure value is too low (temperature is fine). It should be 15 mbar and the sensor outputs 94 mbar. I have tried adding pressure offset value after soldering, but the pressure is then 12 mbar. Does anyone have any clue what should I be carefull about? Initialization and read routines: INITIALIZATION// RES_CONF 0x05
I2C1_numData = 1;
I2C1_buffer[0] = 0x05;
I2C1_Send_Data(I2C1_buffer, PRESSURE_ADDRESS, 0x10 | 0x80, &I2C1_numData);
// CTRL_REG1 0xC0
// CTRL_REG2 0x00
// CTRL_REG3 0x00
// CTRL_REG4 0x00
I2C1_numData = 4;
I2C1_buffer[0] = 0xC0;
I2C1_buffer[1] = 0x00;
I2C1_buffer[2] = 0x00;
I2C1_buffer[3] = 0x00;
I2C1_Send_Data(I2C1_buffer, PRESSURE_ADDRESS, 0x20 | 0x80, &I2C1_numData);
// FIFO_CTRL 0x00
I2C1_numData = 1;
I2C1_buffer[0] = 0x00;
I2C1_Send_Data(I2C1_buffer, PRESSURE_ADDRESS, 0x2E | 0x80, &I2C1_numData);
READOUT
I2C1_numData = 5;
I2C1_Read_Data(I2C1_buffer, PRESSURE_ADDRESS, 0x28 | 0x80, &I2C1_numData);
pressure = (I2C1_buffer[2] << 16 ) | (I2C1_buffer[1] << 8 ) | (I2C1_buffer[0] << 0 );
temperature = (I2C1_buffer[4] << 8 ) | (I2C1_buffer[3] << 0 );
pressureFloat = pressure / 40;
temperatureFloat = temperature / 40 + 5;