

The Adafruit VEML7700 is a high-precision ambient light sensor designed to measure light intensity in lux. It features an I2C interface, making it easy to integrate with microcontrollers and development boards such as the Arduino UNO. The sensor is capable of detecting a wide range of light levels, from dim to bright, with high accuracy and low power consumption. Its compact design and precise measurements make it ideal for applications such as automatic brightness adjustment, smart lighting systems, and environmental monitoring.








The following table outlines the key technical details of the Adafruit VEML7700:
| Parameter | Value |
|---|---|
| Manufacturer | Adafruit |
| Part ID | VEML7700 |
| Operating Voltage | 3.3V to 5V |
| Communication Interface | I2C |
| I2C Address (Default) | 0x10 |
| Lux Range | 0.0036 lux to 120,000 lux |
| Resolution | 16-bit |
| Operating Temperature | -25°C to +85°C |
| Power Consumption | Low power mode available |
The Adafruit VEML7700 sensor module has the following pinout:
| Pin | Name | Description |
|---|---|---|
| 1 | VIN | Power supply input (3.3V to 5V) |
| 2 | GND | Ground connection |
| 3 | SCL | I2C clock line |
| 4 | SDA | I2C data line |
| 5 | INT | Interrupt output (optional, not always used) |
VIN pin to a 3.3V or 5V power source and the GND pin to ground.SCL pin to the I2C clock line and the SDA pin to the I2C data line of your microcontroller. Use pull-up resistors (typically 4.7kΩ) on the SCL and SDA lines if they are not already present on your board.INT pin to a GPIO pin on your microcontroller.Below is an example of how to use the Adafruit VEML7700 with an Arduino UNO:
#include <Wire.h>
#include "Adafruit_VEML7700.h"
// Create an instance of the VEML7700 sensor
Adafruit_VEML7700 veml = Adafruit_VEML7700();
void setup() {
Serial.begin(9600); // Initialize serial communication
while (!Serial) delay(10); // Wait for Serial Monitor to open
Serial.println("Adafruit VEML7700 Test");
// Initialize the sensor
if (!veml.begin()) {
Serial.println("Failed to find VEML7700 sensor!");
while (1);
}
Serial.println("VEML7700 sensor found!");
// Configure the sensor
veml.setGain(VEML7700_GAIN_1); // Set gain to 1x
veml.setIntegrationTime(VEML7700_IT_100MS); // Set integration time to 100ms
Serial.println("Sensor configured.");
}
void loop() {
// Read and print the lux value
float lux = veml.readLux();
Serial.print("Ambient Light (lux): ");
Serial.println(lux);
delay(1000); // Wait 1 second before the next reading
}
Sensor Not Detected
SCL and SDA lines are correctly connected. Verify the I2C address using an I2C scanner sketch.Inaccurate Lux Readings
No Output in Serial Monitor
Serial.begin(9600) matches the baud rate in the Serial Monitor.Intermittent Readings
Q: Can the VEML7700 measure infrared light?
A: No, the VEML7700 is designed to measure visible light intensity in lux and does not detect infrared light.
Q: What is the maximum distance for I2C communication?
A: The maximum distance depends on the pull-up resistor values and the I2C clock speed. For typical setups, distances up to 1 meter are reliable.
Q: Can I use the VEML7700 with a 3.3V microcontroller?
A: Yes, the VEML7700 is compatible with both 3.3V and 5V systems.
Q: How do I change the I2C address of the sensor?
A: The I2C address of the VEML7700 is fixed at 0x10 and cannot be changed.
By following this documentation, you can effectively integrate and use the Adafruit VEML7700 in your projects.