This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HDC1080 Temperature Accuracy

Other Parts Discussed in Thread: HDC1080

We are using HDC1080 as a temperature sensor in our design.

We've recently sent the device to an external validation testing and the results showed error of 0.54C (at 25C).

This appears to contradict the accuracy ratings specified in the manual (typical +-0.2C, maximal +-0.4C).

My questions are as follows:

1. Are there any known issues with the accuracy of this temperature sensor?

2. Is each sensor factory calibrated or do we need to perform some calibration ourselves? If it's the latter, is there any standard way to do so?

3. The following is the conversion routine we use. Is it correct?

double ConvertHdcTemperatureToCelsius (_I_ char * raw_data)
{
short sVar ;
double dVar ;

//revert byte order, since HDC works in big endian.
*(((char *)&sVar) + 0) = raw_data[1] ;
*(((char *)&sVar) + 1) = raw_data[0] ;

dVar = (double)sVar ;

if (dVar < 0 )
{
dVar = (1 << 16) + dVar ;//register should be *positive* 16 bits number.
}

return ((dVar / (1 << 16)) * 165 - 40) ;
}

  • Hi Tal,
    Please find some comments below:

    1. There is no know issue on the temp sensor. It should be +/-0.4C in the 5C to 60C degrees range as noted in the data sheet.
    2. the IC shouldn't be required to go through calibration by itself since the spec is clear, but there are some system implementations that may require it depending on the following cases:
    (a) Heat source near the HDC1080 device due to non-optimal placement or isolation techniques.
    (b) Self heating due to sampling rates.

    Please find the app note below that ellaborates on this topic.
    www.ti.com/.../snaa297a.pdf

    3. Your routine seems correct but let me reply to you in the next 24-48 hrs to confirm it.

    Regards,
    Jose
  • Hi Tal,

    I verified your code on my system and I made some comments:

    #include <stdio.h>
    #include <stdlib.h>
    
    /* raw_data and sVar should be unsigned. -REN */
    double ConvertHdcTemperatureToCelsius (unsigned char * raw_data)
    {
    unsigned short sVar ;
    double dVar ;
    
    //revert byte order, since HDC works in big endian.
    /* i understand what is intended here, but i'm confused as to why i needed to reverse the order on my system.
     this manipulation of pointers may not be safe to assume across architectures.
     i would recommend using 
     sVar = (unsigned short) raw_data[1] << 8 | raw_data[0];
     instead. -REN */
    *(((char *)&sVar) + 0) = raw_data[0] ;
    *(((char *)&sVar) + 1) = raw_data[1] ;
    
    dVar = (double)sVar ;
    
    /* this function is not needed if you correctly type your variables -REN 
    if (dVar < 0 )
    {
    dVar = (1 << 16) + dVar ;//register should be *positive* 16 bits number.
    }
    */
    return ((dVar / (1 << 16)) * 165 - 40) ; 
    }
    
    void main()
    {
    	double dt;
    	unsigned char ct[] = {0xBF,0x63};
    	dt = ConvertHdcTemperatureToCelsius(ct);
    	printf("dt: %f",dt);
    }

    Ren

  • Hey Jose,

    Thank you very much for the speedy reply!

    Based on your answer and some more testing we now believe the problem lies it thermal isolation caused by our case plastic.

    We will investigate further and query you again if we have anymore questions.
  • Hey Ren,

    Thanks for the detailed response.

    I understand your comments and agree your suggestions would probably make a "cleaner" and more portable routine.

    However, the main point for me was to insure that our conversion yields the correct results, which if I understand you correctly, it does.
  • Tal,

    The only issue I had was the byte-swap. On my system, it resulted in the bytes not being swapped. If your temperature result makes sense, then your system must handle this differently.

    Ren