Skip to content

setQuality

Stefan Armborst edited this page Dec 30, 2019 · 15 revisions

setQuality

sets the Quality for the next measurement.

void setQuality(Quality quality);

result void

Internal at startMeasure() the Quality must be send. So with this function no real call to the sensor is made.


Parameter Quality

enum Quality
{
  BH1750_HIGH = 0x20,
  BH1750_HIGH2 = 0x21,
  BH1750_LOW = 0x23,
};

Here a table for comparison of the range and precision of different MTreg's and qualities:

Quality MTreg resolution lux highest lux time
LOW 31 7.4 121557 7
LOW 254 0.9 14836 59
HIGH 31 1.85 121557 54
HIGH 254 0.23 14836 442
HIGH2 31 0.93 60778 54
HIGH2 254 0.11 7418 442

Internal each Quality can provide the brightness as a 16-bit value (0-65535)

First let's explain the difference between quality LOW and HIGH
As you can see: quality LOW and quality HIGH have the same range (highest lux).
But the conversion time of LOW is 7.5 times faster than HIGH (442 ms against 59ms at MTreg 254).
The drawback is the resolution: LOW x is 4 times less sensitive:

With quality HIGH you will read raw data like: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
With quality LOW you will read raw data like: 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, ... So at LOW you can only read values as multiples of 4. E.g. 3 or 7 is not possible.

As you can see in the table Quality HIGH2 has only the half of the range of HIGH or LOW.
But the resolution is twice as high. The datasheet recommends the use of ''' HIGH2''', but when the value is saturated, you have to switch to HIHG.

Examples and hints:

There are several ways to set this value. Every time the value is used for further measurements. For example you can set the Quality at startMeasure(BH1750_HIGH2, MTregDefault) the call startMeasure() with empty brackets will use the same settings set before.

Clone this wiki locally