#light-sensor #light #sensor #ambient #embedded-hal-driver #i2c-driver

no-std veml7700

Platform-agnostic Rust driver for the VEML7700 High Accuracy Ambient Light Sensor

3 unstable releases

0.2.0 Jan 29, 2024
0.1.7 Jul 17, 2021

#307 in Embedded development

Download history 24/week @ 2024-01-28 21/week @ 2024-02-18 38/week @ 2024-02-25 19/week @ 2024-03-03 24/week @ 2024-03-10 1/week @ 2024-03-17 130/week @ 2024-03-31

158 downloads per month


420 lines

Rust VEML7700 High Accuracy Ambient Light Sensor Driver

crates.io Docs

This is a platform agnostic Rust driver for the VEML7700 high accuracy ambient light sensors using the embedded-hal traits. It's alternative version of veml6030 crate that uses the micromath library and 32 bit precision for sensor correction.

This driver allows you to:

  • Enable/disable the device. See: enable().
  • Read the measured lux value. See: read_lux().
  • Read the white channel measurement. See: read_white().
  • Read the measured ALS value in raw format. See: read_raw().
  • Calculate the compensated lux for a raw ALS value. See: convert_raw_als_to_lux().
  • Set the gain. See: set_gain().
  • Set the integration time. See: set_integration_time().
  • Set the fault count. See: set_fault_count().
  • Enable/disable and configure power saving mode. See: enable_power_saving().
  • Enable/disable interrupts. See: enable_interrupts().
  • Read the interrupt status. See: read_interrupt_status().
  • Set the high/low thresholds in lux or raw. See: set_high_threshold_lux().
  • Calculate the compensated raw threshold value ahead of time. See: calculate_raw_threshold_value().

The device

The Vishay VEML7700 is a high accuracy ambient light digital 16-bit resolution sensor in a miniature transparent package. It includes a high sensitive photodiode, a low noise amplifier, a 16-bit A/D converter and support an easy to use I2C bus communication interface and additional interrupt feature. The ambient light result is as digital value available.


Application Note:


To use this driver, import this crate and an embedded_hal implementation, then instantiate the device.

VEML7700 expose interface over I2C.


For questions, issues, feature requests, and other changes, please file an issue in the github project.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.