

The BH1750 is a digital light sensor designed to measure ambient light intensity in lux, providing precise and reliable readings. It communicates via the I2C protocol, making it easy to integrate with microcontrollers and development boards. The sensor is widely used in applications such as automatic brightness control for displays, energy-efficient lighting systems, and environmental monitoring.








The BH1750 offers high accuracy and a wide measurement range, making it suitable for various lighting conditions. Below are its key technical details:
The BH1750 has six pins, as described in the table below:
| Pin Name | Description |
|---|---|
| VCC | Power supply (2.4V to 3.6V) |
| GND | Ground |
| SDA | I2C data line |
| SCL | I2C clock line |
| ADDR | I2C address selection (0x23/0x5C) |
| NC | Not connected |
The BH1750 is straightforward to use in a circuit, thanks to its I2C interface. Below are the steps to integrate and use the sensor:
Below is an example of how to use the BH1750 with an Arduino UNO:
#include <Wire.h>
#include <BH1750.h>
// Create an instance of the BH1750 sensor
BH1750 lightMeter;
void setup() {
Serial.begin(9600); // Initialize serial communication
Wire.begin(); // Initialize I2C communication
// Initialize the BH1750 sensor
if (lightMeter.begin()) {
Serial.println("BH1750 initialized successfully");
} else {
Serial.println("Error initializing BH1750. Check connections.");
while (1); // Halt execution if initialization fails
}
}
void loop() {
// Read light intensity in lux
float lux = lightMeter.readLightLevel();
// Print the lux value to the serial monitor
Serial.print("Light Intensity: ");
Serial.print(lux);
Serial.println(" lux");
delay(1000); // Wait for 1 second before the next reading
}
loop() function as needed for your application.No response from the sensor:
Incorrect or fluctuating lux readings:
Compilation errors in Arduino IDE:
Can the BH1750 operate at 5V?
What is the maximum I2C clock speed supported?
How do I change the I2C address?
By following this documentation, you can effectively integrate and use the BH1750 light sensor in your projects.