Skip to main content
Visitor II
November 10, 2019
Question

Hi, I'm using the STM32 temperature and turbidity sensor, and I want to know that, what binary representation the sensor would output for 98.23% humidity and what binary representation the sensor would output for 107.32 deg C.

  • November 10, 2019
  • 2 replies
  • 1409 views

I looked into the user manual, but don't really know how to calculate that. I'd really appreciate it if someone could give me some clue on that

    This topic has been closed for replies.

    2 replies

    Graduate II
    November 10, 2019

    Cite the specific part number you're talking about, link to the document.

    Usually fractional values need to be scaled, rebased, or use some fixed-point representation.

    ILau.998Author
    Visitor II
    November 10, 2019

    0690X00000ArsQEQAZ.png

    Thank you indeed!

    https://www.st.com/content/ccc/resource/technical/document/reference_manual/02/35/09/0c/4f/f7/40/03/DM00083560.pdf/files/DM00083560.pdf/jcr:content/translations/en.DM00083560.pdf

    This is the reference manual of the chip I use. The temperature sensor is internally connected to the ADC input channel which is used to convert the sensor’s output voltage to a digital value. 

    The temperature reading steps are listed as in the picture according to the reference manual

    Graduate II
    November 10, 2019

    This would be the die temperature of the STM32L4. Couple of calibration points are stored as words in the ROM/OTP memory.

    You're scaling and rebasing, given an 80 degree (temp) slope and the value read from the ADC. Secondary school math I'd suppose.

    Try feeding in TS_DATA (ADC) values of TS_CAL1 and TS_CAL2 and confirm you're understanding by pulling out the expected temps.

    Visitor II
    November 10, 2019

    Are you talking about the HTS221? This is not a STM32 chipset function.

    ILau.998Author
    Visitor II
    November 10, 2019

    Yes, I think so