2024-03-07 06:44 AM
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.
Solved! Go to Solution.
2024-03-07 09:29 AM - edited 2024-03-07 09:30 AM
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:
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
2024-03-07 06:47 AM
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?
2024-03-07 09:29 AM - edited 2024-03-07 09:30 AM
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:
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