I bought a Xiaomi sensor that measures light intensity. The data I get from it is called

  • illuminance_lux and the unit is supposed to be lux
  • illuminance, no unit is provided

"Illuminance" is defined in Wikipedia as

In photometry, illuminance is the total luminous flux incident on a surface, per unit area. It is a measure of how much the incident light illuminates the surface, wavelength-weighted by the luminosity function to correlate with human brightness perception. (...)
In SI derived units these are measured in lux (lx), or equivalently in lumens per square metre (lm·m−2).

Here are the values I am measuring over a day (there were some tests today, so please look at the general shape)

enter image description here

Since Wikipedia gives values of the order of 1000 to 10000 lux for a typical day, I believe the top chart is the illuminance it has in mind (in my case its values max out at 600, which is reasonable for today (a covered day, the sensor is not pointing directly outside)).

I am trying to guess what the other measure could be. It is not simply the scaled version of the top one and since [illuminance is] wavelength-weighted by the luminosity function to correlate with human brightness perception I wonder whether this could be the raw measure.

I found a discussion of the luminosity function but it does not seem to match the scaling: it rather seems that the bottom chart gives a preference for lower values of the illumination.


1 Answer 1


An educated guess: the mystery value is the raw output from the analog-to-digital converter on the sensor. Note that the full scale on your plot goes up to about 30k, and the largest value that fits in a signed 16-bit integer is 32,767. You could test this hypothesis by looking for discretization noise on your "constant" regions. If your sensor has a 12-bit ADC, but the data have been shifted to fill a 15-bit integer, then you would find adjacent measurements of the same value either identical or separated by a multiple of $2^3=8$ ADC units. (Though I once used a sensor that hid meta-information in the least significant bits, so that's not ironclad.)

The inflation of low-brightness values suggests that the hardware sensor has some logarithmic response. That way, questions like "is A twice as bright as B" have similar precision whether A and B are near the top, middle, or bottom of the range of detectable brightnesses.

  • 1
    $\begingroup$ I wanted to come back after some time with an extra thank you: it is indeed as you are saying, including the log response. The lux illuminance seems to be the raw data processed to account for the nature o the response + possibly add the natural eye sensitivity (which would match the definition of illuminance and the raw data should be renamed to remove confusion) $\endgroup$
    – WoJ
    Commented Sep 11, 2020 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.