I needed a very small humidity sensor, so I made a PCB for the Sensirion SHT45. I interface it with a Nucleo-32 F303K8, and have tried a Nucleo 64 as well. It seems that I'm able to send commands to it, but when I try to read it, I receive only NACKs from the sensor. This behaviour could be because of a busy sensor, but I add enough time in between measurement request and reading that it should not be a problem.
I tried a few chips. The first ones I soldered with an iron, then I tried hot air, most recently hot air from bottom of PCB, to shield the chip and especially its PTFE membrane from the heat of the air. I wonder if solder heat could have broken the sensor in a way where it will respond to I2C, but the sensing element might be broken.
I use CubeIDE, I2C standard default settings.
// Buffer to store RX data
uint8_t buffer[6] = {};
// Request High Precision reading - no error
if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)(0x44 << 1),(uint8_t *)0xFD,1, 1) != HAL_OK){
uint8_t dummy = 1;
}
HAL_Delay(200); //have tried delays of 20, 50, 100 and 200 ms
// Reading sensor - always get NACK from sensor, hi2c1 errorcode 4 (NACK error)
HAL_StatusTypeDef ret = HAL_I2C_Master_Receive(&hi2c1, (uint16_t)(0x44 << 1), buffer, 6, 1);
while(ret != HAL_OK) {
ret = HAL_I2C_Master_Receive(&hi2c1, (uint16_t)(0x44 << 1), buffer, 6, 1);
}
HAL_Delay(20);
I use 2.2K pull up resistors, and very short soldered wires in my test setup.
I tried a few chips. The first ones I soldered with an iron, then I tried hot air, most recently hot air from bottom of PCB, to shield the chip and especially its PTFE membrane from the heat of the air. I wonder if solder heat could have broken the sensor in a way where it will respond to I2C, but the sensing element might be broken.
I use CubeIDE, I2C standard default settings.
// Buffer to store RX data
uint8_t buffer[6] = {};
// Request High Precision reading - no error
if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)(0x44 << 1),(uint8_t *)0xFD,1, 1) != HAL_OK){
uint8_t dummy = 1;
}
HAL_Delay(200); //have tried delays of 20, 50, 100 and 200 ms
// Reading sensor - always get NACK from sensor, hi2c1 errorcode 4 (NACK error)
HAL_StatusTypeDef ret = HAL_I2C_Master_Receive(&hi2c1, (uint16_t)(0x44 << 1), buffer, 6, 1);
while(ret != HAL_OK) {
ret = HAL_I2C_Master_Receive(&hi2c1, (uint16_t)(0x44 << 1), buffer, 6, 1);
}
HAL_Delay(20);
I use 2.2K pull up resistors, and very short soldered wires in my test setup.