Ambient Light Lux Sensor VEML7700: Unterschied zwischen den Versionen

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
Onyesi-john.abiagam@stud.hshl.de (Diskussion | Beiträge)
Onyesi-john.abiagam@stud.hshl.de (Diskussion | Beiträge)
Zeile 65: Zeile 65:
| 4 || SDA || Serial Data Line for I²C communication
| 4 || SDA || Serial Data Line for I²C communication
|}
|}




= Measurement Method =
= Measurement Method =
== Reference Lux Meter Reading vs LX-1108 Measurement ==
* Measurements were obtained simultaneously using the laboratory reference lux meter and the LX-1108 lux meter.
* The laboratory reference lux meter served as the reference instrument, while the LX-1108 was treated as the instrument under investigation.
* The relationship between the two instruments was examined over the selected illuminance range.
* Table X presents the recorded measurements obtained from both instruments.
* Figure X shows the corresponding LX-1108 measurements plotted against the reference lux meter readings.
* The observed deviation between the two instruments suggests that the relationship cannot be adequately represented by a single constant correction factor.
'''Note:''' The analysis presented in this report is specific to the LX-1108 lux meter used during the experiment and should not be generalized to Ambient Light Sensors (ALS) or other light-sensing devices, as different devices exhibit different measurement characteristics and require independent calibration procedures.
=== Table X: Reference Lux Meter and LX-1108 Measurement Data ===
{| class="wikitable"
{| class="wikitable"
|+                             Maximum Lux Raw Values
|+ Table X: Reference Lux Meter and LX-1108 Measurement Data
! Reference Lux Meter (Lab_Ref) [Lux]
! LX-1108 Reading (LX_Reading) [Lux]
|-
| 0 || 0
|-
| 64 || 51
|-
| 1174 || 924
|-
| 2349 || 1889
|-
|-
! Integration Time (IT)!! Gain 2 !! Gain 1 !! Gain 1/4 !! Gain 1/8
| 3226 || 2573
|-
|-
| 800 ms || 65535 ||65535  ||65535  ||36801
| 4091 || 3247
|-
|-
| 400 ms ||65535  ||65535  ||36844  ||18425
| 5049 || 3870
|-
|-
| 200 ms||65535  ||42485  ||18435  || 9213
| 6307 || 4880
|-
|-
| 100 ms||42490  ||21247  || 9227 || 4614
| 7070 || 5570
|-
|-
| 50 ms||21258  ||10624 ||4610  || 2307
| 8231 || 6510
|-
|-
| 25 ms||10622  || 5309 ||2307  || 1152
| 9105 || 7150
|}
 
{| class="wikitable"
|+ Reference Lux vs Raw ALS Values (Gain = 1/8, Integration Time = 100 ms)
! Reference (LUX Meter)
! Raw ALS Value
|-
|-
| 0    || 0
| 10340 || 7990
|-
|-
| 33  || 74
| 11213 || 8780
|-
|-
| 348  || 772
| 12361 || 9670
|-
|-
| 575  || 1271
| 13259 || 10030
|-
|-
| 731  || 1604
| 14058 || 10450
|-
|-
| 960  || 2084
| 15334 || 11200
|-
|-
| 1182 || 2545
| 16257 || 11700
|-
|-
| 1401 || 2993
| 17322 || 12500
|-
|-
| 1617 || 3429
| 18078 || 13400
|-
|-
| 1831 || 3854
| 19737 || 14600
|}
|}
[[Datei:Lux ALS.png|thumbnail|700px|Comparison of measured ALS response (gain 1/8, 100 ms) with datasheet linearity curve]]
 
<div style="clear: both;"></div>
'''Figure X''' illustrates the relationship between the laboratory reference lux meter readings and the corresponding LX-1108 measurements.
 
[[Datei:Lab Ref Vs LX Reading.png|center|thumb|800px|Figure X: Reference Lux Meter Reading vs LX-1108 Measurement]]
 
* The LX-1108 readings generally increased with increasing reference illuminance.
* The relationship between the two instruments was not perfectly proportional across the measurement range.
* The varying deviation suggests that a nonlinear model is required to accurately characterize the relationship.
* Consequently, nonlinear regression was employed to establish a calibration model for the LX-1108.
== Relative Error Before Calibration ==
 
To quantify the deviation between the laboratory reference lux meter and the LX-1108, the relative error was calculated as:
 
<math>
Relative\ Error =
\frac{LabRef-LXReading}{LabRef}\times100
</math>
 
where LabRef represents the laboratory reference lux meter reading and LXReading represents the corresponding LX-1108 measurement.
 
[[Datei:Error_before.png|center|thumb|800px|Figure X: Relative Error Before Calibration.]]
 
* The LX-1108 exhibited a systematic deviation relative to the laboratory reference lux meter.
* The relative error remained approximately within the range of 20% to 28% over the measurement range.
* The error was not constant and generally increased at higher illuminance levels.
* The varying error indicates that a single constant scaling factor would not adequately compensate for the observed deviation.
* Therefore, a nonlinear regression model was developed to characterize the relationship between the laboratory reference lux meter and the LX-1108.
The nonlinear regression procedure and the resulting calibration model are presented in the following section.
 
== Nonlinear Regression ==
 
The results presented in Figure 1 and Figure 2 indicate that the LX-1108 exhibits a systematic and non-uniform deviation relative to the laboratory reference lux meter. Furthermore, the relative error varies across the measurement range, suggesting that the relationship between the two instruments cannot be adequately described using a single constant scaling factor.
 
To mathematically characterize this relationship, a nonlinear regression model was developed using the experimental measurement data. The laboratory reference lux meter readings (LabRef) were treated as the independent variable, while the corresponding LX-1108 measurements (LXReading) were treated as the dependent variable.
 
A power-law regression model was selected and expressed as:
 
<math>
LXReading = a(LabRef)^b
</math>
 
where:
 
* <math>a</math> is the scaling coefficient,
* <math>b</math> is the nonlinear exponent,
* <math>LabRef</math> represents the laboratory reference lux meter reading, and
* <math>LXReading</math> represents the corresponding LX-1108 measurement.
 
The model parameters were estimated using MATLAB's nonlinear regression fitting tools to obtain the best representation of the observed relationship between the laboratory reference lux meter and the LX-1108.
=== Regression Results ===
=== Regression Results ===
 
The nonlinear regression procedure produced the following parameter estimates:
 
* Scaling coefficient: <math>a = 1.428934</math>
* Nonlinearity exponent: <math>b = 0.932233</math>
 
Substituting these values into the regression model yields:
 
<math>
LXReading = 1.428934(LabRef)^{0.932233}
</math>
 
[[Datei:Power Law Regression.png|center|thumb|800px|Figure 3: Nonlinear regression model fitted to the relationship between the laboratory reference lux meter readings and the corresponding LX-1108 measurements]]
 
* The blue markers represent the experimental measurements obtained from the LX-1108 and the laboratory reference lux meter.
* The red curve represents the fitted nonlinear regression model.
* The dashed black line represents the ideal relationship (<math>y=x</math>) between the two instruments.
* The regression curve closely follows the experimental measurements throughout the calibration range.
* The fitted model captures the systematic deviation of the LX-1108 relative to the laboratory reference lux meter.
* The resulting regression equation provides the mathematical basis for deriving a calibration function for the LX-1108.
 
 
== Derivation of the TrueLux Function ==
 
Using the nonlinear regression model derived in the previous section, the relationship between the LX-1108 measurements and the laboratory reference lux meter readings can be inverted to estimate the corresponding reference illuminance value from a measured LX-1108 reading.
 
Rearranging the regression model:
 
<math>
\frac{LXReading}{a} = (LabRef)^b
</math>
 
Taking both sides to the power of <math>\frac{1}{b}</math>:
 
<math>
LabRef =
\left(\frac{LXReading}{a}\right)^{\frac{1}{b}}
</math>
 
Substituting the estimated regression parameters:
 
<math>
LabRef =
\left(\frac{LXReading}{0.8856}\right)^{\frac{1}{0.9838}}
</math>
 
The resulting function is therefore:
 
<math>
TrueLux = Lux2Ref(LXReading)
</math>
 
where:
 
* <math>LXReading</math> represents the raw LX-1108 measurement.
* <math>TrueLux</math> represents the estimated reference illuminance value.


= Measurement Circuit =
= Measurement Circuit =

Version vom 30. Mai 2026, 17:45 Uhr

Abb. 1: Ambient Light Lux Sensor VEML7700
Autor: Onyesi John Abiagam
Sprache: DE EN

Introduction

The Ambient Light Sensor (VEML7700) is a high-accuracy sensor with 16-bit resolution. It integrates a highly sensitive photodiode, a low-noise amplifier, and a built-in analog-to-digital converter to enable precise light measurements. The sensor communicates via a simple I²C interface and provides ambient light data directly in digital form.

Technical Overview

Key Features

Feature Description
Package Type Surface-mount (SMD), side-view
Dimensions 6.8 mm × 2.35 mm × 3.0 mm
Sensor Type Ambient Light Sensor (ALS)
Resolution 16-bit digital output
Supply Voltage (VDD) 2.5 V to 3.6 V
Communication Interface I²C
Dynamic Range 0 lx to about 140 klx
Sensitivity Up to 0.0042 lx/count
Flicker Rejection 100 Hz and 120 Hz noise suppression
Power Consumption Low shutdown current ( about 0.5 µA typical)
Temperature Stability Built-in temperature compensation
Additional Feature Software-controlled shutdown mode

Components Requirements

Component Description
Arduino Uno Microcontroller board used to interface with the sensor
VEML7700 Sensor Module Ambient light sensor with built-in I²C support and onboard circuitry
Jumper Wires Used to connect the sensor module to the Arduino

Pin Configuration

Pin Number Pin Name Description
1 SCL Serial Clock Line for I²C communication
2 VDD Power supply (2.5 V – 3.6 V)
3 GND Ground
4 SDA Serial Data Line for I²C communication


Measurement Method

Reference Lux Meter Reading vs LX-1108 Measurement

  • Measurements were obtained simultaneously using the laboratory reference lux meter and the LX-1108 lux meter.
  • The laboratory reference lux meter served as the reference instrument, while the LX-1108 was treated as the instrument under investigation.
  • The relationship between the two instruments was examined over the selected illuminance range.
  • Table X presents the recorded measurements obtained from both instruments.
  • Figure X shows the corresponding LX-1108 measurements plotted against the reference lux meter readings.
  • The observed deviation between the two instruments suggests that the relationship cannot be adequately represented by a single constant correction factor.

Note: The analysis presented in this report is specific to the LX-1108 lux meter used during the experiment and should not be generalized to Ambient Light Sensors (ALS) or other light-sensing devices, as different devices exhibit different measurement characteristics and require independent calibration procedures.

Table X: Reference Lux Meter and LX-1108 Measurement Data

Table X: Reference Lux Meter and LX-1108 Measurement Data
Reference Lux Meter (Lab_Ref) [Lux] LX-1108 Reading (LX_Reading) [Lux]
0 0
64 51
1174 924
2349 1889
3226 2573
4091 3247
5049 3870
6307 4880
7070 5570
8231 6510
9105 7150
10340 7990
11213 8780
12361 9670
13259 10030
14058 10450
15334 11200
16257 11700
17322 12500
18078 13400
19737 14600

Figure X illustrates the relationship between the laboratory reference lux meter readings and the corresponding LX-1108 measurements.

Figure X: Reference Lux Meter Reading vs LX-1108 Measurement
  • The LX-1108 readings generally increased with increasing reference illuminance.
  • The relationship between the two instruments was not perfectly proportional across the measurement range.
  • The varying deviation suggests that a nonlinear model is required to accurately characterize the relationship.
  • Consequently, nonlinear regression was employed to establish a calibration model for the LX-1108.

Relative Error Before Calibration

To quantify the deviation between the laboratory reference lux meter and the LX-1108, the relative error was calculated as:

RelativeError=LabRefLXReadingLabRef×100

where LabRef represents the laboratory reference lux meter reading and LXReading represents the corresponding LX-1108 measurement.

Figure X: Relative Error Before Calibration.
  • The LX-1108 exhibited a systematic deviation relative to the laboratory reference lux meter.
  • The relative error remained approximately within the range of 20% to 28% over the measurement range.
  • The error was not constant and generally increased at higher illuminance levels.
  • The varying error indicates that a single constant scaling factor would not adequately compensate for the observed deviation.
  • Therefore, a nonlinear regression model was developed to characterize the relationship between the laboratory reference lux meter and the LX-1108.

The nonlinear regression procedure and the resulting calibration model are presented in the following section.

Nonlinear Regression

The results presented in Figure 1 and Figure 2 indicate that the LX-1108 exhibits a systematic and non-uniform deviation relative to the laboratory reference lux meter. Furthermore, the relative error varies across the measurement range, suggesting that the relationship between the two instruments cannot be adequately described using a single constant scaling factor.

To mathematically characterize this relationship, a nonlinear regression model was developed using the experimental measurement data. The laboratory reference lux meter readings (LabRef) were treated as the independent variable, while the corresponding LX-1108 measurements (LXReading) were treated as the dependent variable.

A power-law regression model was selected and expressed as:

LXReading=a(LabRef)b

where:

  • a is the scaling coefficient,
  • b is the nonlinear exponent,
  • LabRef represents the laboratory reference lux meter reading, and
  • LXReading represents the corresponding LX-1108 measurement.

The model parameters were estimated using MATLAB's nonlinear regression fitting tools to obtain the best representation of the observed relationship between the laboratory reference lux meter and the LX-1108.

Regression Results

Regression Results

The nonlinear regression procedure produced the following parameter estimates:

  • Scaling coefficient: a=1.428934
  • Nonlinearity exponent: b=0.932233

Substituting these values into the regression model yields:

LXReading=1.428934(LabRef)0.932233

Figure 3: Nonlinear regression model fitted to the relationship between the laboratory reference lux meter readings and the corresponding LX-1108 measurements
  • The blue markers represent the experimental measurements obtained from the LX-1108 and the laboratory reference lux meter.
  • The red curve represents the fitted nonlinear regression model.
  • The dashed black line represents the ideal relationship (y=x) between the two instruments.
  • The regression curve closely follows the experimental measurements throughout the calibration range.
  • The fitted model captures the systematic deviation of the LX-1108 relative to the laboratory reference lux meter.
  • The resulting regression equation provides the mathematical basis for deriving a calibration function for the LX-1108.


Derivation of the TrueLux Function

Using the nonlinear regression model derived in the previous section, the relationship between the LX-1108 measurements and the laboratory reference lux meter readings can be inverted to estimate the corresponding reference illuminance value from a measured LX-1108 reading.

Rearranging the regression model:

LXReadinga=(LabRef)b

Taking both sides to the power of 1b:

LabRef=(LXReadinga)1b

Substituting the estimated regression parameters:

LabRef=(LXReading0.8856)10.9838

The resulting function is therefore:

TrueLux=Lux2Ref(LXReading)

where:

  • LXReading represents the raw LX-1108 measurement.
  • TrueLux represents the estimated reference illuminance value.

Measurement Circuit

VEML7700 circuit diagram


Software

Arduino IDE

Simulink

Video

Datasheets


→ back to main article: Sensor Kit
→ back to main article: HSHL Mechatronics Kit


→ back to main article: HSHL Mechatronics Kit | Arduino Sensor Collection


→ zurück zum Hauptartikel: HSHL-Mechatronik-Baukasten | Arduino Sensorsammlung