calibration BH1750 sensor

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
bubastic
Normal user
Posts: 10
Joined: 12 Jan 2022, 18:47

calibration BH1750 sensor

#1 Post by bubastic » 04 Sep 2024, 09:08

Friends,

can you tell me how to enter the calibration constant & accuracy for the BH1750 sensor ?

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

Re: calibration BH1750 sensor

#2 Post by Ath » 04 Sep 2024, 09:31

The accuracy is a setting you can select in the Device configuration, for calibration there is no setting, but you can use a formula to adjust the output value. The current measured value is available in the %value% variable, and the previous value in %pvalue%.
/Ton (PayPal.me)

bubastic
Normal user
Posts: 10
Joined: 12 Jan 2022, 18:47

Re: calibration BH1750 sensor

#3 Post by bubastic » 04 Sep 2024, 11:14

Why can't we implement editing the calibration constant with a command like this?

This is implemented in the P136 RadSens plugin
Снимок экрана 2024-09-04 120937.jpg
Снимок экрана 2024-09-04 120937.jpg (84.07 KiB) Viewed 971 times

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

Re: calibration BH1750 sensor

#4 Post by Ath » 04 Sep 2024, 12:04

bubastic wrote: 04 Sep 2024, 11:14 Why can't we implement editing the calibration constant with a command like this?
Several reasons, the first being that is a plugin developed early in the ESPEasy project, when command handling wasn't very wide-spread yet, and probably nobody thought of that being wanted at some point.
Another reason not to add it now is that this plugin is available in nearly all builds, and ESP8266 builds are already very cramped in .bin size, so adding more features there will cause (more) technical issues.

It's implemented in the RadSens plugin because one needs it when using a tube with different specs, but that's quite uncommon, so no need to implement in the UI settings, and the setting is (according to the RadSens documentation) stored in the controller-board, and not in ESPEasy.
For this plugin IMHO, there isn't much reason to change the accuracy on the fly, and for calibration, a formula seems more appropriate, as there is no setting available in the sensor or ESPEasy to adjust.
The RadSens plugin is intended to be used with an ESP32 board, where more .bin size is still available (though not unlimited). (in fact, ESP8266 is deprecated for use in new projects, as even Espressif has set it's status to End-of-life)
/Ton (PayPal.me)

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

Re: calibration BH1750 sensor

#5 Post by TD-er » 04 Sep 2024, 12:46

I think the first question here should be if such a calibration would be a non-linear function?
Those are hard to fit in formula or in rules.

If it is just some kind of offset and/or factor (e.g. form of a*%value% + b) then the current formula option is perfectly suitable for this as this is universally available for all plugins.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest