Skip to content

Bouncing temperature compensation #2

Description

@JsBergbau

This is an issue with the LYWSD03MMC Sensor. On successive readings/receiving of the temperature the value bounces a lot. Therefore the debouncing switch has been implemented. It works that way:
(We skip the rounding which is only used after startup until the second decimal place is not anymore within 0.2 and 0.7).
Say temperature read is 11.81 degrees. Than it is rounded downwards (floor) to 11.8 If the next reading is 11.86 it is still floored to 11.8
If it reaches 11.7 it rounded up to 11.8
If the next reading is 11.83 it is still rounded up to 11.9
When the next reading is 11.82 it is floored to 11.8
When next reading is 11.85 or 11.86 it is still florred to 11.8

Due to the way debouncing works it can only be used together with --round option. If round option is not specified, but --debounce than debouncing is ignored.

I have multiple BME280 and also DS18B20 sensors. Without any measures they show a lot less bouncing values. They just give a lot more decimal places and I'm using only 2 of them. Giving quite stable values.

LYWSD03MMC gives 17 bounces in that measurement without debouncing measures within about 20 minutes
grafik

LYWSD03MMC with debouncing. Within roughly more than half an hour "only" 6 temperature bounces. The humidity is bouncing, but there is no possibility to debounce without losing precision. Things like moving average can still be down when displaying the data
grafik

--> Debouncing ok

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions