Page 1 of 1
HTU21D and MQTT
Posted: 19 Feb 2018, 04:18
by olivernz
Hi,
I have ESPeasy boards aplenty and usually use a BME280 for temp and humidity (barometer is a bonus extra). they work excellently. BUT I have built one device with a HTU21D. Every 60 sec. It sends results to my mosquitto MQTT server. I noticed that the temps and humidity that get sent differ by several degrees from what i can see on the ESPeasy Device tab. I still need to look at the MQTT raw message arriving but has anyone had such an issue before?
Cheers Oliver
Re: HTU21D and MQTT
Posted: 19 Feb 2018, 09:47
by TD-er
I've also noticed the Bosch sensors output a few degrees higher than any other sensor and I still cannot see why.
I have re-implemented the procedure to sample them according to the datasheet, but still the temp value is too high.
This update is in the Mega branch for the BMx280 plugin by the way. (autodetect between BME/BMP-280)
In this plugin, there is an option to set an offset in degrees (0.1 degree), which also applies a correction to the measured humidity.
These sensors tend to warm themselves while measuring, so I reduced the awake time to a minimum, which also make the reported values about 1.5 degree lower.
The only thing I still want to try, is to read all registers at once and see if that makes a difference.
There is also another issue with support for >1 sensor active, so I will have a look at it anyway.
Re: HTU21D and MQTT
Posted: 19 Feb 2018, 21:02
by olivernz
Hi,
I'm having issues with the HTU21D though. The difference in temp is 5-10 degrees C. And the issue is not the sensor not reading correctly (displays fine in UI) but somewhere in the MQTT send process. I still need to track down where the error occurs if on ESP send side or Node.red receive side.
As for the BME280's, yes, now that you mention it... I do notice a 1-1.5 degree error. Not to crucial for me there as I compare BME outside against BME inside. So they'd bot error in a similar way i presume. But I will correct them in ESPeasy. Against what do you compare?
Cheers Oliver
Re: HTU21D and MQTT
Posted: 19 Feb 2018, 23:25
by TD-er
I have tested a number of those Bosch sensors (about 5) and tested with about 3 brands of other thermometers (not just sensors, complete devices) and these other brands agree with eachother within about 0.5 degree, while the Bosch reports 3+ degree more in open air. In a contained box with other sensors and an ESP board, the difference is obviously more.
Such heating and/or misreporting of the sensor affects also the reported humidity of the BME version.
About the HTU21D sensor.
If you think you can reproduce it and perhaps with a little more information like the MQTT controller used, Used version of ESPeasy, etc.
Could you please open an issue for it on Github?
Did you also test with the latest builds? I recently changed some parts of the MQTT parts of the code.
Re: HTU21D and MQTT
Posted: 19 Feb 2018, 23:32
by olivernz
Hi,
Will do but let me do a bit more investigation just to make sure it's not something else in my IoT setup. But vert sad to hear about the BME issues. Would be an issue for me as I have 4 running at the moment. Can't you send them to sleep in between reads? Did you try and contact BOSCH and ask them about it?
Cheers Oliver
Re: HTU21D and MQTT
Posted: 19 Feb 2018, 23:49
by TD-er
I did not yet contact Bosch. And I put them to sleep already. But still you need to read at least a number of samples due to the internal filtering of the sensor.
That filter is selectable, but still you want some sort of moving average, especially for the pressure sensor part.
If you google on it, there are lots of reports on high temperature output of these sensors.
And also reports (without sourcecode) about how stable they are.
So I guess there is something not right in the datasheet (would be the first datasheet with errors, really

)
Maybe I should contact Bosch. I also have about 10+ in my stock cabinet

Re: HTU21D and MQTT
Posted: 20 Feb 2018, 00:41
by olivernz
Bought the BME280s because they were oh so accurate. So this is a bit of a let-down. SO what are accurate alternatives?
Maybe in the meantime I attach some DS18B20 to compare against.
Cheers Oliver
Re: HTU21D and MQTT
Posted: 20 Feb 2018, 13:55
by TD-er
Currently they are precise, not accurate

But I will contact Bosch about this, since I am also not happy about it.
Re: HTU21D and MQTT
Posted: 21 Feb 2018, 01:36
by olivernz
Ok. So checked the most accessible BME280 yesterday and it's about 1 degree C out. That I can correct via "%value%-1". The HTD21D seems to be reporting the correct temperature to MQTT from what i saw. So the issue I have is somewhere between MQTT-->Node.red-->Slack (where i see the incorrect values). So I'll need to check that coding and that would be my own doing and nothing to do with ESPeasy.
Still want to check with DB18S20's though. Get more accuracy on how far they are out.
Cheers Oliver
Re: HTU21D and MQTT
Posted: 21 Feb 2018, 01:40
by olivernz
Nice pic btw! Yeah not using language correctly is an issue.
As long as they are precise we can deal and I have no issue with it. I compare temps to each other to do stuff. If all show a degree more, who cares. Even for me to reference that would be fine as long as the aberration is constant through time and temperature range.
Gave me a new idea! Will my wife feel the cold less if the thermometer is lying to her?

Might get into trouble for that but worth a shot.