Si7021 temperature accuracy?

I have a couple of Si7021 sensors which I am sampling every ten minutes using the C3V0+ sample code from GitHub, and I am getting temperatures from both of them that are consistently about 3 degrees centigrade below the real temperature (as measured with several other sensors and thermometers.

  • This is at 20.6 degC, so no extremes of temperature, and I am reading 17.5 degC.
  • The specified maximum error is ±0.4 degC so these readings are wildly out of spec.
  • The conversion algorithm is straight from the C4V0+ sample, which is as specified in the data sheet.
  • The supply is 3.0 volts which is well above the minimum rating of 1.9 volts.
  • The imps are deep sleeping between readings so there is no chance of self-heating.

Has anybody else tried this sensor? And what sort of accuracy have you found?

If you cool/heat them do the temperatures move appropriately?

Post links to the code?

Yes if I cool or heat then the temperature tracks, always 3 degC low.

The code is MakeDeck’s reference at I have checked the conversion constants which are as documented in the datasheet.

The code does look about right, though I don’t really see why there’s a 100ms delay in there; really you should be able to read temperature with:

local reading =, READ_TEMP, 2);

…as this is command 0xe3 which is hold master, ie the imp’s i2c master will be blocked for the ~7ms of temperature conversion.

Why is the example temperature reading subtracted by 3?

temperature <- sensor.readTemp()-3;

By Jove, you’ve got it!! Thank for proofreading the code so carefully.

@makedeck, any idea how that got in there? That explains my 3 degree discrepancy very nicely :slight_smile:

$%&*#@! That is totally embarrassing. @bobbyziom Thanks for the catch…I don’t even remember ever putting that in there. I must have done it when I was experimenting with temp/humidity sensor from another manufacturer and forgot to take it out.

Wow, I think I need to go and get my eyes checked. I didn’t see that at all :slight_smile:

(well, I was looking at the lower level call only, I didn’t look at what the caller was doing with the result!)