cancel
Showing results for 
Search instead for 
Did you mean: 

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.

ILau.998
Associate II

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

5 REPLIES 5

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal

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

Yes, I think so

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

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..