DHT11 temperature/humidity readings bouncing up and down

1,316 views
Skip to first unread message

Paul Morley

unread,
Mar 16, 2017, 11:36:23 AM3/16/17
to SonoffUsers

Hi all.  I have a DHT11 temperature sensor connected to GPI14.  I'm running latest tasmota (4.0.5).  I currently have the teleperiod set to deliver sensor data via mqtt every 10 seconds (just for testing...  will increase later).  I ran it overnight and graphed it in a node-red line chart (below).  As you can see the humidity is bouncing quite a bit and the temperature to a lesser extent.  The pattern is interesting as it appears to be quite consistently bouncing either from one reading to the next or based on some time interval.  The plot below is about 8 hours (~360 data points per hour at 10 second intervals).  Anyone seen this or have an idea what might cause this?  I'm increasing to 60 seconds and will run it for a few hours to see if the bouncing still occurs.  








Paul Morley

unread,
Mar 16, 2017, 11:38:11 AM3/16/17
to SonoffUsers
I should mention.  My DHT11 has a built in 10kohm resistor, so yes I believe the hardware is configured properly.

Don Willingham

unread,
Mar 16, 2017, 4:25:25 PM3/16/17
to SonoffUsers
I haven't worked with them yet, but I've read the DHT22 is much more precise. I wonder if an average over the last however many samples or units of time would provide a better reading/plot. That would be better to do on the node red side.

Julian Knight

unread,
Mar 19, 2017, 12:18:42 PM3/19/17
to SonoffUsers
Hi Paul, the DHT11 is very slow and you are reading it too fast. I recommend no more than every 30s though you might get away with 15s.

The DHT11 really is a fairly naff device and it is likely to be a long way out from reality, possibly 20-30% in some cases and it responds very badly if you go over about 80% humidity. It also can drift quite badly over time.

The 22 is a little better but you get a massive step up if you move to a TI HDC1000 or Bosch BME280. A bit more expensive of course but a lot more accurate in every way.

Ward Wygaerts

unread,
Feb 20, 2019, 9:50:13 AM2/20/19
to SonoffUsers
How/Where can you define on what interval it reads the sensor?


Op zondag 19 maart 2017 17:18:42 UTC+1 schreef Julian Knight:

Hemant Kumar

unread,
Feb 20, 2019, 9:54:25 AM2/20/19
to SonoffUsers
Hi,

It is in config -> logging -> Tele period if you go in the webif.

Hemant

Op woensdag 20 februari 2019 15:50:13 UTC+1 schreef Ward Wygaerts:

Philip Knowles

unread,
Feb 20, 2019, 10:03:56 AM2/20/19
to Hemant Kumar, SonoffUsers

Think there’s confusion here. Teleperiod is how often the device gives an output to MQTT not how often the sensor is read. The sensor is read at least once a second but only transmitted based on the teleperiod. Every 10 seconds is too fast for a slow moving reading like temperature and humidity – once a minute is more than enough.

Having said that something is upsetting the output but slowing down the readings may resolve it. Even if it doesn’t it will give better definition on the graph and you may be able to see what’s happening.

It’s worth watching the main screen of the device for 1 or 2 minutes and checking if the readings are stable. As it stands now we don’t know if the graph accurately represents what’s going on or something else is wrong.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Ward Wygaerts

unread,
Feb 20, 2019, 10:37:04 AM2/20/19
to SonoffUsers
I knew about the telemetry, but eg: I flashed the Blitzwolf BW-SHP6 and this reports every change. So every second, my MQTT broker receives an update for the current power usage. Because my automation tool (openHAB) is subscribed to this topic, it also receives an update every second. If I receive this every 5minutes, this is fine for me.


Op woensdag 20 februari 2019 16:03:56 UTC+1 schreef Philip Knowles:

Philip Knowles

unread,
Feb 20, 2019, 10:45:52 AM2/20/19
to Ward Wygaerts, SonoffUsers

The default in Configuration>Logging is 300 which is 5 minutes if it’s sending more frequently there’s something been changed in the setup. My Sonoff POW R2 (also connected to openHAB) updates every 5 minutes.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

Ward Wygaerts

unread,
Feb 20, 2019, 10:50:14 AM2/20/19
to Philip Knowles, SonoffUsers
The telemetry is also set to 300 (default). I used the standard sonoff.bin file

Ward Wygaerts

unread,
Feb 20, 2019, 10:51:42 AM2/20/19
to SonoffUsers
The telemetry is also set to 300 (default). I used the standard sonoff.bin file


Op woensdag 20 februari 2019 16:45:52 UTC+1 schreef Philip Knowles:

Philip Knowles

unread,
Feb 20, 2019, 11:00:59 AM2/20/19
to Ward Wygaerts, SonoffUsers

There is an issue on GitHub set PowerDelta to 0

Ward Wygaerts

unread,
Feb 20, 2019, 6:47:36 PM2/20/19
to SonoffUsers
Thanks! This solved the issue for me.


Op woensdag 20 februari 2019 17:00:59 UTC+1 schreef Philip Knowles:
Reply all
Reply to author
Forward
0 new messages