BH1750 - 15 Lux offset

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Wirehead
New user
Posts: 2
Joined: 11 Oct 2015, 21:42

BH1750 - 15 Lux offset

#1 Post by Wirehead » 11 Oct 2015, 21:57

Hi,

I was questioning why this was put in code for the BH1750:

Code: Select all

Wire.requestFrom(BH1750_ADDRESS, 2);
byte b1 = Wire.read();
byte b2 = Wire.read();
float val=0;     
val=((b1<<8)|b2)/1.2;
val=val+15;
As you can see, this augments every lux value with 15. I see no reason to put this in there.
There's 3 resolutions on this sensor:

Code: Select all

Measurement Mode Measurement Time. Resolution
H-resolution Mode2 Typ. 120ms. 0.5 lx
H-Resolution Mode Typ. 120ms. 1 lx.
L-Resolution Mode Typ. 16ms. 4 lx.
The default mode is H-resolution/1lx.

Code: Select all

H-Resolution Mode is 1 l x resolution so that it is suitable for darkness ( less than 10 lx )
H-resolution mode2 is also suitable to detect for darkness.
This is also from the datasheet, at default, it's OK to measure less than 10 lx, so there's no need for the offset.

Could this line of code be changed, ideally, the offset should be removed.

Wirehead
New user
Posts: 2
Joined: 11 Oct 2015, 21:42

Re: BH1750 - 15 Lux offset

#2 Post by Wirehead » 14 Dec 2015, 12:42

This is still in the current revision.. again - why the offset?...

TheSnitz
New user
Posts: 3
Joined: 20 Dec 2015, 13:39

Re: BH1750 - 15 Lux offset

#3 Post by TheSnitz » 21 Dec 2015, 18:55

FYI,

// R54 20-12-2015
// LCD I2C address and display size can be configured in the webgui
// OLED I2C address and display rotation can be configured in the webgui
// OLEDCMD and LCDCMD commands added to turn the display on or off
// Removed the +15 offset in BH1750 plugin

Post Reply

Who is online

Users browsing this forum: No registered users and 47 guests