AD7682

I'm using an AD7682 and want to monitor the device temperature. This is available via the inbuilt temperature sensor, but whilst I can read the raw binary value ok, the datasheet does not explain the transfer function. How do I convert the binary to Degrees C ?



Adding internal tracking tags
[edited by: @skowalik at 1:34 PM (GMT 0) on 26 Sep 2019]
Parents
  • +1
    •  Analog Employees 
    on Sep 10, 2019 2:24 AM over 1 year ago

    AndyH,

    First of all my apologies for the delay in getting back to you.

    On page 23 of the datasheet there is a brief description that indicates that the output code of the temperature sensor is output in straight binary format.   The voltage generated is approximately 1mV for every degree K and the nominal output voltage at room temperature should be about 283mV (300K).    So at room temperature and for a reference of 2.5V we should expect an output code of 283e-3/2.5 * 65535 = 7418 decimal.

    Conversely if I were to say read an output code of 8500 decimal would be approximately 324mV (again with 2.5V reference) which would be equivalent to (324-283 = 41mV) 341 degrees K or 68 deg C.

    Hope that helps.

    Sean

  • Conversely if I were to say read an output code of 8500 decimal would be approximately 324mV (again with 2.5V reference) which would be equivalent to (324-283 = 41mV) 341 degrees K or 68 deg C.

    datasheet say @25 °C  283mV   

    so  (324-283 = 41mV)  should be 41+25=66 deg C? 

  • 0
    •  Analog Employees 
    on Sep 15, 2020 11:14 AM 1 month ago in reply to blaider

    Blaider,

    You are correct my message should have said 66 deg C not 68

    Sean

  • HI skowalik,

    on my device,there is some wrong on read temerature sensor,could you help me please?

    I wirte and read data on Linux ,through spi bus.

    First:

    set ref interval V4.096

    write to device like this,5 times

    b2 23 00 00

    read back data back the 5 times:
    00 3b f6 23
    00 24 f6 23
    10 6a b2 23
    10 8f b2 23
    10 64 b2 23

    tem,raw=0x1064,centigrade=6.250000 °C

    second:

    set ref interval V2.5

    write to device like this,5 times

    b2 03 00 00

    read back data back the 5 times:
    00 24 f6 23
    00 26 f6 23
    0e 4e b2 03
    0e e2 b2 03
    0f 94 b2 03

    tem,raw=0x0f94,centigrade=-76.191528 °C

    after convert raw data to deg C, is not be the acutal temeperature.

    is there something wrong on read temperature sensor?

Reply
  • HI skowalik,

    on my device,there is some wrong on read temerature sensor,could you help me please?

    I wirte and read data on Linux ,through spi bus.

    First:

    set ref interval V4.096

    write to device like this,5 times

    b2 23 00 00

    read back data back the 5 times:
    00 3b f6 23
    00 24 f6 23
    10 6a b2 23
    10 8f b2 23
    10 64 b2 23

    tem,raw=0x1064,centigrade=6.250000 °C

    second:

    set ref interval V2.5

    write to device like this,5 times

    b2 03 00 00

    read back data back the 5 times:
    00 24 f6 23
    00 26 f6 23
    0e 4e b2 03
    0e e2 b2 03
    0f 94 b2 03

    tem,raw=0x0f94,centigrade=-76.191528 °C

    after convert raw data to deg C, is not be the acutal temeperature.

    is there something wrong on read temperature sensor?

Children
  • 0
    •  Analog Employees 
    on Sep 17, 2020 12:43 AM 1 month ago in reply to blaider

    Blaider,

    There are a couple of things I would point out to you.

    1) Note that because you only execute a single conversion to load the configuration data into the part the actual configuration does not change until the third sample you take in each 5 sample burst.  I would recommend executing a burst of 3 conversions with the following device packets and then add at a minimum 150ms of settling time between the application of the configuration and the read back before collecting data.

    // Configuration Packet Transmission

    0xb200 0000

    0x0000 0000

    0x0000 0000  <- This conversion should load the 0xb200 code into memory.  

    // Wait for reference to settle.

    wait( 150 ms )

    // Read Back Transmission

    0x0000 0000

    0x0000 0000

    ....

    0x0000 0000

    2) You have configured the device for 1/4 BW mode.  Be sure that your effective conversion period, that is the time between the rising edges of CSB are such that you do not exceed 250KSPS/4 = 62.5 KSPS.  Otherwise the measurement will be in error due to incomplete settling of the acquired signal. 

    3) Note that the configuration word is only 14-bits deep so I'm not sure why you've set the LSBS of your first transfer to 0.

    In the future if you can send scope captures of the digital timing this will help with diagnosis of the issue but for now if you try the simple code suggestions I've