

The BH1750 is a digital light sensor designed to measure ambient light levels in lux, providing precise and reliable readings. It communicates via the I2C protocol, making it easy to integrate into microcontroller-based systems. The sensor is highly sensitive and can detect a wide range of light intensities, from very dim to bright sunlight.








The BH1750 is a compact and efficient light sensor with the following key specifications:
| Parameter | Value |
|---|---|
| Operating Voltage | 2.4V to 3.6V |
| Operating Current | 0.12 mA (typical) |
| Measurement Range | 1 lux to 65535 lux |
| Communication Interface | I2C (7-bit address: 0x23 or 0x5C) |
| Resolution | 1 lux |
| Operating Temperature | -40°C to +85°C |
| Dimensions | 3.0mm x 1.6mm x 0.7mm |
The BH1750 has six pins, as described in the table below:
| Pin Name | Pin Number | Description |
|---|---|---|
| VCC | 1 | Power supply (2.4V to 3.6V) |
| GND | 2 | Ground |
| SDA | 3 | I2C data line |
| SCL | 4 | I2C clock line |
| ADDR | 5 | I2C address selection (LOW: 0x23, HIGH: 0x5C) |
| NC | 6 | Not connected (leave floating or grounded) |
0x23.0x5C.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 in continuous high-resolution mode
if (lightMeter.begin(BH1750::CONTINUOUS_HIGH_RES_MODE)) {
Serial.println("BH1750 initialized successfully.");
} else {
Serial.println("Error initializing BH1750. Check connections.");
while (1); // Halt execution if initialization fails
}
}
void loop() {
// Read light level in lux
float lux = lightMeter.readLightLevel();
// Print the light level to the serial monitor
if (lux >= 0) {
Serial.print("Light Level: ");
Serial.print(lux);
Serial.println(" lux");
} else {
Serial.println("Error reading light level.");
}
delay(1000); // Wait 1 second before the next reading
}
No Response from the Sensor
Inconsistent Readings
Sensor Not Detected
Readings Stuck at Zero
begin() function is called in the setup and check for initialization errors.Q: Can the BH1750 measure light through glass or plastic?
A: Yes, the BH1750 can measure light through transparent materials, but the material may slightly attenuate the light intensity.
Q: What is the maximum distance for I2C communication with the BH1750?
A: The maximum distance depends on the pull-up resistor values and the I2C clock speed. For reliable communication, keep the distance under 1 meter.
Q: Can the BH1750 operate at 5V?
A: No, the BH1750 operates at a maximum voltage of 3.6V. Use a level shifter if interfacing with a 5V system.
Q: How do I switch between measurement modes?
A: Use the appropriate command in your code to set the desired mode. Refer to the BH1750 datasheet for mode-specific commands.