cancel
Showing results for 
Search instead for 
Did you mean: 

about temperature sensor and i2c communication

eyeamskd
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

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

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2

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?

SofLit
ST Employee

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

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.