Skip to main content
Visitor II
March 7, 2024
Solved

about temperature sensor and i2c communication

  • March 7, 2024
  • 2 replies
  • 1516 views

i am working in a project on stm32u5a9j-dk board. i am fetching temperature value from inbuilt temperature sensor using ADC channel. I am getting the value in 4 digit int. i want to know to know how to transfer that value into *celcius. And one more thing how to implement this thing using i2c.

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    If I understand well your question, you need to use the built-in temperature sensor of the MCU then you need to send the value over an I2C bus, right?

    If yes, first read the reference manual from this link:

    SofLit_2-1709832640569.png

    Then, for the I2C communication you can refer to any I2C example provided in the Cube HAL package either if it was available on your target MCU package or inspire from any other I2C example available from other CubeHaL package example: https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32F411E-Discovery/Examples/I2C

     

    2 replies

    Super User
    March 7, 2024

    The datasheet will tell you how to convert the value from the sensor into Celsius.

     


    @eyeamskd wrote:

    how to implement this thing using i2c.


    Not sure what you mean by that?

    mƎALLEmAnswer
    Technical Moderator
    March 7, 2024

    Hello,

    If I understand well your question, you need to use the built-in temperature sensor of the MCU then you need to send the value over an I2C bus, right?

    If yes, first read the reference manual from this link:

    SofLit_2-1709832640569.png

    Then, for the I2C communication you can refer to any I2C example provided in the Cube HAL package either if it was available on your target MCU package or inspire from any other I2C example available from other CubeHaL package example: https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32F411E-Discovery/Examples/I2C