AnsweredAssumed Answered

AD7291 Temperature reading not stable

Question asked by GuiX on Jan 21, 2015
Latest reply on Feb 9, 2015 by mayp

Hi everyone,

 

I am reading two AD7291 built-in temperature sensor but I obtain very high values that oscillates 4 Celsius.

I am reading the two AD7291 using python from a Raspberry. This is the code:

    

     bus.write_word_data(addr_v, 0x00, 0x8000)

     bus.write_word_data(addr_c, 0x00, 0x8000)

     while (1==1):

          av = bus.read_word_data(addr_v, 0x03)   # Leemos el average

         ac = bus.read_word_data(addr_v, 0x03)   # Leemos el average

         Tav = 256.0*((av & 0x00FF) - 144.0) + ((av & 0xFF00) >> 8)/4.0   # Para el no average es 128 en lugar de 144

         Tac = 256.0*((ac & 0x00FF) - 144.0) + ((ac & 0xFF00) >> 8)/4.0   # Para el no average es 128 en lugar de 144

         bv = bus.read_word_data(addr_v, 0x02)   # Leemos el average

         bc = bus.read_word_data(addr_v, 0x02)   # Leemos el average

         Tv = 256.0*((bv & 0x00FF) - 128.0) + ((bv & 0xFF00) >> 8)/4.0   # Para el no average es 128 en lugar de 144

         Tc = 256.0*((bc & 0x00FF) - 128.0) + ((bc & 0xFF00) >> 8)/4.0   # Para el no average es 128 en lugar de 144

         time.sleep(1)

         print 'Tav = ' + str(Tav)+' (0x'+ format(av,'02x')+')'

         print 'Tac = ' + str(Tac)+' (0x'+ format(ac,'02x')+')'

         print 'Tv  = ' + str(Tav)+' (0x'+ format(av,'02x')+')'

         print 'Tc  = ' + str(Tac)+' (0x'+ format(ac,'02x')+')'

         print

 

and this is the result:

 

     Tav = 54.75 (0xdb90)

      Tac = 54.0 (0xd890)

      Tv  = 54.75 (0xdb90)

      Tc  = 54.0 (0xd890)

     

      Tav = 56.75 (0xe390)

      Tac = 56.0 (0xe090)

      Tv  = 56.75 (0xe390)

      Tc  = 56.0 (0xe090)

     

      Tav = 52.25 (0xd190)

      Tac = 52.25 (0xd190)

      Tv  = 52.25 (0xd190)

      Tc  = 52.25 (0xd190)

     

      Tav = 56.0 (0xe090)

      Tac = 56.0 (0xe090)

      Tv  = 56.0 (0xe090)

      Tc  = 56.0 (0xe090)

     

      Tav = 55.75 (0xdf90)

      Tac = 57.25 (0xe590)

      Tv  = 55.75 (0xdf90)

      Tc  = 57.25 (0xe590)

     

      Tav = 56.75 (0xe390)

      Tac = 56.75 (0xe390)

      Tv  = 56.75 (0xe390)

      Tc  = 56.75 (0xe390)

     

      Tav = 53.5 (0xd690)

      Tac = 53.5 (0xd690)

      Tv  = 53.5 (0xd690)

      Tc  = 53.5 (0xd690)

     

      Tav = 55.25 (0xdd90)

      Tac = 55.25 (0xdd90)

      Tv  = 55.25 (0xdd90)

      Tc  = 55.25 (0xdd90)

 

I verified that I2C signals reach the AD7291 and the Raspberry correctly.

 

Questions:

 

* Am I doing the calculation correctly? --> 0xE290 means 56.5 Celsius (0xE290 --> T = 0x0E2 / 4 = 56.5 Celsius)?

* Why I have such a unstable temperature reading?

 

Thank you very much in advance

 

Regards

 

 

GuiX

Outcomes