HTU21D shows 128.86 degrees

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

HTU21D shows 128.86 degrees

#1 Post by akhabel » 23 Oct 2022, 19:25

Hi,
My question is if someone have experienced this issue with HTU21D I2C sensor that the measured humidity looks real while the temperature is 128.86 for 14 bit resolution and 128.90 for any other resolution no matter if I set slow I2C or not.
I'm using git version as I needed a custom build on ESP-01.
Thanks in advance.

BR,
AA

User avatar
Ath
Normal user
Posts: 3520
Joined: 10 Jun 2018, 12:06
Location: NL

Re: HTU21D shows 128.86 degrees

#2 Post by Ath » 23 Oct 2022, 19:52

Does the sensor show up correctly in the I2C scan?
/Ton (PayPal.me)

akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

Re: HTU21D shows 128.86 degrees

#3 Post by akhabel » 23 Oct 2022, 19:58

yes, it does, at 0x40. And also tested the sensor with arduino htu21d example sketch and works well, both RH and temp.

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: HTU21D shows 128.86 degrees

#4 Post by chromo23 » 23 Oct 2022, 20:39

It´s probably defective. One of my five sensors had the same issue.

Edit:
And also tested the sensor with arduino htu21d example sketch and works well, both RH and temp.
Ubbs, missed that part.. sorry.
It´s strange....

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: HTU21D shows 128.86 degrees

#5 Post by chromo23 » 24 Oct 2022, 12:05

Just tested it with a recent build and you are right... it indeed shows 128,86
So i guess there is an issue with the plugin...

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: HTU21D shows 128.86 degrees

#6 Post by chromo23 » 24 Oct 2022, 12:11

The latest release (20220809) doesn’t seem to have this issue

Edit: I filed an issue on github...

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#7 Post by TD-er » 24 Oct 2022, 12:54

Do you have any log output?
Each log item regarding this plugin, will probably start with "SI70xx"

akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

Re: HTU21D shows 128.86 degrees

#8 Post by akhabel » 24 Oct 2022, 12:57

Hi chromo23,
thanks for confirming, I came to the same conclusion by loading latest release. I will try to rollback to that git version and see

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#9 Post by TD-er » 24 Oct 2022, 13:01


TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#10 Post by TD-er » 24 Oct 2022, 13:08

I'm browsing through the changes and noticed the I2C address wasn't a configurable parameter before.

Can you check it is set to the previous default of 0x40?

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: HTU21D shows 128.86 degrees

#11 Post by chromo23 » 24 Oct 2022, 13:38

TD-er wrote: 24 Oct 2022, 13:08 Can you check it is set to the previous default of 0x40?
Here it is set to default...
Log is inconspicuous:
Bildschirmfoto 2022-10-24 um 13.35.21.png
Bildschirmfoto 2022-10-24 um 13.35.21.png (24.5 KiB) Viewed 3858 times

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#12 Post by TD-er » 24 Oct 2022, 13:40

But did you actually save the settings with the address set?

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: HTU21D shows 128.86 degrees

#13 Post by chromo23 » 24 Oct 2022, 13:46

I´m not sure what you mean. But i did set it to 0x40 and hit the submit button (changed it to 0x41 before just to check)...

akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

Re: HTU21D shows 128.86 degrees

#14 Post by akhabel » 24 Oct 2022, 14:28

Hi
checked the same
in log see like: P014: Temperature: 128.86 Humidity: 46.60
i2c address is 0x40 (64) - (default)
just for curiosity switched to 0x41 but that case gives "nan" for both values and in log: SI70xx: Not available at address: 41

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#15 Post by TD-er » 24 Oct 2022, 15:25

OK, so it seems it is more of an interpretation issue of the temperature data.
The humidity does seem to be plausible and at least differing among both your setups.

akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

Re: HTU21D shows 128.86 degrees

#16 Post by akhabel » 24 Oct 2022, 16:40

Hi,
basically yes. rolled back git revision and now works fine.
thanks for helping me out with this question you are doing a great job!

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#17 Post by TD-er » 24 Oct 2022, 16:42

Thanks for reporting the issue.
This needs to be fixed for sure before making a new build.

fmuntean
New user
Posts: 6
Joined: 24 Apr 2018, 02:04

Re: HTU21D shows 128.86 degrees

#18 Post by fmuntean » 25 Oct 2022, 00:22

akhabel wrote: 24 Oct 2022, 16:40 Hi,
basically yes. rolled back git revision and now works fine.
thanks for helping me out with this question you are doing a great job!
The sensor has a heater inside it. Is the sensor really at the 128 Celsius ? Can you check if the sensor is hot ?
If it is not hot then I recommend to remove the plugin then add the plugin back which should reset the internal variables as now I2C address can be selected and is stored internally with the resolution.
A screen shot of the plugin settings and some logs would help here.

akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

Re: HTU21D shows 128.86 degrees

#19 Post by akhabel » 25 Oct 2022, 14:00

the chip is not hot.
if you provide what to check and how to check then I can do it and share
by the way I'm using gpio1/3 for i2c communication so I can't capture terminal logs.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#20 Post by TD-er » 25 Oct 2022, 16:44

You can also see the logs via the web interface (tools -> log)
Just make sure to set the web log level on the tools->Advanced page.

akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

Re: HTU21D shows 128.86 degrees

#21 Post by akhabel » 26 Oct 2022, 07:48

Hi there,
With info level the printout is the same as I sent earlier and chromo23 sent the screenshot as well.
With error level I don't get anything

fmuntean
New user
Posts: 6
Joined: 24 Apr 2018, 02:04

Re: HTU21D shows 128.86 degrees

#22 Post by fmuntean » 26 Oct 2022, 23:51

open the log in the browser then on a separate tab go and configure the plugin.
Then from the log tab copy the entire logs.
I need to see the logs that are sent during initialization of the plugin.

akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

Re: HTU21D shows 128.86 degrees

#23 Post by akhabel » 27 Oct 2022, 08:06

646798: EVENT: TaskExit#htu=2,0
646819: EVENT: TaskInit#htu=2,0
646839: SI7013 : sn=405ba4-32114854
646839: P014: chip_id=50
646973: P014: Temperature: 128.86 Humidity: 59.40
646976: EVENT: htu#temp=128.86
646977: EVENT: htu#humid=59.40

fmuntean
New user
Posts: 6
Joined: 24 Apr 2018, 02:04

Re: HTU21D shows 128.86 degrees

#24 Post by fmuntean » 27 Oct 2022, 19:02

akhabel wrote: 27 Oct 2022, 08:06 646798: EVENT: TaskExit#htu=2,0
646819: EVENT: TaskInit#htu=2,0
646839: SI7013 : sn=405ba4-32114854
646839: P014: chip_id=50
646973: P014: Temperature: 128.86 Humidity: 59.40
646976: EVENT: htu#temp=128.86
646977: EVENT: htu#humid=59.40
Thank you this is what I need.
This sensor seems to be a "clone" of the SI70xx and the datasheet is very vague on the implementation.
However I see that a change I made is to read the temperature from the humidity measurement.

This is a detailed info on the approach:
- in order to get better humidity response the temperature is required so when measuring humidity the temperature is also measured
- then for Si70xx to keep the sensor from heating up we do not need to start a new measurement for temperature but just need to read the previous value.
- the HTU21D does not seems to have that command implemented returning all 1s thus giving you the max temp always.

I can use the chip_id = 50 to switch the state machine into doing an extra temperature read.

The serial number command is not documented at all for HTU21D either so if you have multiple sensors please check the chip_id for all to see if it is the same.
If not then please provide the serial numbers to see if we can figure out the location of chip_id.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#25 Post by TD-er » 27 Oct 2022, 21:31

fmuntean wrote: 27 Oct 2022, 19:02 [...]
- the HTU21D does not seems to have that command implemented returning all 1s thus giving you the max temp always.

I can use the chip_id = 50 to switch the state machine into doing an extra temperature read.
[...]
You could also check for the return value using that command.
This can be done in the init and if it returns only 1's then set a flag to not use this command.

fmuntean
New user
Posts: 6
Joined: 24 Apr 2018, 02:04

Re: HTU21D shows 128.86 degrees

#26 Post by fmuntean » 27 Oct 2022, 22:28

I would prefer to use the chip_id if possible.
as the all 1s is also not documented. but that value of 128.86 is when the raw value is the max (all bits are 1)
I am preparing the pull request as we speak with the change.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#27 Post by TD-er » 27 Oct 2022, 22:33

Great!
Let's hope people can then test it for a few days, so we will be making a new build on Sunday or Monday as this is (as far as I know) the last blocking one for the new build.

akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

Re: HTU21D shows 128.86 degrees

#28 Post by akhabel » 28 Oct 2022, 09:11

Hi there,
I did the same test with all sensors I've got:

83465: EVENT: TaskExit#htu=2,0
83485: EVENT: TaskInit#htu=2,0
83503: SI7013 : sn=405dc7-32114854
83503: P014: chip_id=50
83638: P014: Temperature: 128.86 Humidity: 57.60

59643: EVENT: TaskInit#htu=2,0
59658: SI7013 : sn=6464c2-32114854
59659: P014: chip_id=50
59793: P014: Temperature: 128.86 Humidity: 46.70

46880: EVENT: TaskExit#htu=2,0
46903: EVENT: TaskInit#htu=2,0
46988: SI7013 : sn=6466c7-32114854
46988: P014: chip_id=50
47130: P014: Temperature: 128.86 Humidity: 56.00

fmuntean
New user
Posts: 6
Joined: 24 Apr 2018, 02:04

Re: HTU21D shows 128.86 degrees

#29 Post by fmuntean » 28 Oct 2022, 14:05

excellent. I started the pull request https://github.com/letscontrolit/ESPEasy/pull/4321 with the changes.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#30 Post by TD-er » 28 Oct 2022, 14:54

When the GitHub Actions build is ready, could someone try it?
https://github.com/letscontrolit/ESPEas ... 3345553088

akhabel
Normal user
Posts: 10
Joined: 23 Oct 2022, 19:17

Re: HTU21D shows 128.86 degrees

#31 Post by akhabel » 03 Nov 2022, 16:01

Hi,

built again from this commit:
commit cff4e44522261f9b312732b01225fd52faefdd1b (HEAD -> mega, origin/mega, origin/HEAD)
Merge: 22cc1fbbc ce04d1009
Author: TD-er <gijs.noorlander@gmail.com>
Date: Wed Nov 2 22:39:46 2022 +0100

Merge pull request #4321 from fmuntean/P014-SI70xx

[P014 si70xx] fixing support for htu21D

here is the log output:
306905: EVENT: TaskInit#htu=2,0
306924: SI7013 : sn=6466c7-32114854
306924: P014: chip_id=50
307165: P014: Temperature: 21.80 Humidity: 60.10

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTU21D shows 128.86 degrees

#32 Post by TD-er » 03 Nov 2022, 16:38

Cool!
Thanks for the feedback.

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests