Reference
VEML7700
High-accuracy ambient light sensor.
- Connects over
- I²C
- Address
- 0x10
- Made by
- Vishay
- Datasheet
- vishay.com
Use it
hardware {
device veml7700: VEML7700
}
every 1s {
let value: float = veml7700.lux()
log("veml7700", "lux={value}")
}
On its own, the declaration puts the VEML7700 on the first I²C bus (SDA 21, SCL 22 on the ESP32) at 0x10. To choose the pins or the address, declare the bus and attach the device: device veml7700: VEML7700 on i2c0 at 0x10 with i2c i2c0(sda: 21, scl: 22).
Methods
-
veml7700.lux() -> float
Light in lux (corrected)
-
veml7700.white() -> float
White channel
Wiring
| Pin | Connect to |
|---|---|
VCC | 3.3V ONLY — 5V damages the chip |
GND | Ground |
SDA | Pull-up to 3.3V |
SCL | Pull-up to 3.3V |
Specifications
- Voltage
- 2.5V – 3.6V
- Current
- 45 μA
- Range
- 0 – 120k lux
- Resolution
- 0.0036 lux/count at default gain
- Interface speed
- I²C up to 400 kHz
Tips
- Wider dynamic range than BH1750 — better for both very dim and very bright environments.
- Configurable gain + integration time trades sensitivity for sample rate.
- Optical filter approximates the human eye's response (photopic).
Alternatives worth knowing:
- BH1750: Cheaper, narrower range, simpler protocol.
- TSL2591: Even wider range; two diodes for IR rejection.