Automatic display brightness
Read ambient lux and dim or brighten an LCD, OLED, or LED backlight so a screen stays readable indoors and outdoors.
A Vishay VEML7700 high-accuracy ambient light sensor that reports calibrated illuminance in lux over I2C, covering near-darkness up to roughly 120,000 lux.

The VEML7700 is a Vishay high-accuracy ambient light sensor packaged by Adafruit on an I2C breakout. Unlike a bare photoresistor, it integrates a photodiode, a signal-conditioning amplifier, and a 16-bit analog-to-digital converter in one part, so it returns numeric light-level counts you can convert directly to lux instead of an arbitrary voltage. The photodiode carries an optical filter that shapes its response close to the human eye's sensitivity, which is why its readings track perceived brightness better than a generic light sensor.
Measurement behavior is set in software through two registers: gain (0.125x, 0.25x, 1x, and 2x) and integration time (25, 50, 100, 200, 400, and 800 ms). Combining a high gain with the longest integration time gives resolution down to about 0.0036 lux per count for dim environments, while a low gain and short integration time extend the range up toward 120,000 lux in bright sun without saturating. This wide dynamic range is the sensor's main advantage over cheaper light parts.
The Adafruit board adds a 3.3V regulator and an I2C level shifter so the same breakout works from either 3.3V or 5V logic, and it exposes STEMMA QT / Qwiic connectors for solderless wiring. The sensor answers at the fixed I2C address 0x10. Vishay and Adafruit provide Arduino and CircuitPython libraries that handle the register configuration and the lux conversion, including the non-linear correction needed at high light levels.
| Pin | Function | Type |
|---|---|---|
VIN VIN (3-5V) | Power | Power in |
3V3 3V3 (out) | Power | Power out |
GND GND | Power | Power in |
SCL SCL | I²C SCL | Bidirectional (GPIO) |
SDA SDA | I²C SDA | Bidirectional (GPIO) |
Verified from the Tinkered component library · Adafruit (Vishay VEML7700).
The VEML7700 connects to any of the microcontrollers supported in Tinkered. Mind the 3.3 V logic level on 3.3 V boards.
After writing the enable bit, the sensor needs its startup time plus one full integration period before valid data is ready. Polling immediately returns 0 or a stale value, so wait for the configured integration time (25 to 800 ms) before your first read.
High gain combined with a long integration time will clip to full scale (0xFFFF) under sunlight or strong indoor light. Lower the gain or shorten the integration time, or use the library's auto-ranging, so the value stays inside the usable range.
At high gain or high light levels the raw counts are non-linear. Applying only the linear resolution factor gives readings that drift well off true lux. Use the manufacturer correction polynomial (the Adafruit and Vishay libraries apply it for you) when accuracy matters.
The address is fixed at 0x10 with no jumper, so two VEML7700 boards on the same I2C bus collide. Use an I2C multiplexer such as a TCA9548A, or a second bus, to read more than one.
The 3V3 pin is a regulated output from the onboard regulator, not an input. Supply the board through VIN (3.3V to 5V) and treat 3V3 only as a source for other 3.3V parts.
Read ambient lux and dim or brighten an LCD, OLED, or LED backlight so a screen stays readable indoors and outdoors.
Trigger room or desk lighting only when measured lux drops below a threshold, saving power by using available daylight first.
Track light levels reaching plants over the day and log lux to spot shaded spots or verify a grow light's coverage.
Pair the sensor with a small display to build a calibrated pocket light meter for photography, workspace, or lighting audits.
Drop the VEML7700 into a circuit, write firmware, and simulate it in your browser, then deploy to real hardware. All in one editable Tinkered project.