Back to Sensors & Actuators Series

BH1750 Digital Ambient Light Sensor

April 10, 2026 Wasil Zafar 7 min read

BH1750 deep dive — photodiode lux principle, I2C wiring, high/low resolution modes, spectral response, complete code, and automatic brightness applications.

Contents

  1. Working Principle
  2. Electrical Characteristics
  3. Interfacing with MCU
  4. Calibration
  5. Code Example
  6. Real-World Applications
  7. Limitations

Working Principle

The Rohm BH1750 is a digital ambient light sensor that outputs illuminance directly in lux. An internal photodiode converts incoming light into current. An integrating ADC accumulates the photocurrent over a programmable measurement window, then a microcontroller scales the count to calibrated lux units.

Analogy: Think of a bucket catching raindrops (photons). After a set time, you weigh the bucket (count photons) and calculate the rainfall rate (lux). The BH1750 does this electronically and reports the number via I2C.

Electrical Characteristics

ParameterValue
Supply Voltage2.4 V – 3.6 V
Illuminance Range1 – 65535 lux
Resolution1 lux (high-res mode) / 4 lux (low-res mode)
Measurement Time120 ms (high-res) / 16 ms (low-res)
Spectral ResponseClose to human eye (peak ~550 nm)
InterfaceI2C (addr 0x23 or 0x5C)
Current120 µA (measurement), 0.01 µA (power-down)

Interfacing with an MCU

The BH1750 uses I2C at address 0x23 (ADDR pin LOW) or 0x5C (ADDR pin HIGH). The GY-302 breakout module includes pull-ups and a regulator for 5 V operation.

I2C Wiring (Arduino): VCC → 3.3 V (or 5 V via module), GND → GND, SCL → A5, SDA → A4, ADDR → GND (0x23).

Calibration

The BH1750 is factory-calibrated and needs no user calibration for most applications. However:

  • Measurement Time Register (MTreg): Change integration time to extend or reduce the lux range (31–254, default 69).
  • Filtering: Average multiple readings to reduce flicker noise from artificial lighting (50/60 Hz).
  • Optical window: If placed behind glass or diffuser, apply a correction factor by measuring against a reference lux meter.

Code Example

/*
 * BH1750 Ambient Light Sensor — Arduino I2C
 * Requires: BH1750 library (by Christopher Laws)
 * Wiring: SCL→A5, SDA→A4, VCC→3.3V, ADDR→GND
 */
#include <Wire.h>
#include <BH1750.h>

BH1750 lightMeter(0x23);

void setup() {
    Serial.begin(9600);
    Wire.begin();
    lightMeter.begin(BH1750::CONTINUOUS_HIGH_RES_MODE);
    Serial.println("BH1750 Light Sensor Ready");
}

void loop() {
    float lux = lightMeter.readLightLevel();
    Serial.print("Light: ");
    Serial.print(lux);
    Serial.println(" lux");

    /* Simple ambient descriptor */
    if (lux < 10) Serial.println("  → Dark");
    else if (lux < 500) Serial.println("  → Indoor");
    else if (lux < 10000) Serial.println("  → Overcast");
    else Serial.println("  → Bright sunlight");

    delay(1000);
}

Real-World Applications

Consumer

Adaptive Display Backlighting

Smartphones and automotive instrument clusters use ambient light sensors (BH1750 or equivalent) to automatically adjust screen brightness. Matching backlight intensity to ambient light reduces eye strain and extends battery life by up to 30%.

DisplayAuto-BrightnessUX

Limitations

  • Limited range: Maxes out at 65535 lux — direct sunlight can exceed 100,000 lux.
  • No colour data: Reports total visible illuminance only; use TCS3200 or VEML6040 for colour sensing.
  • IR sensitivity: Though optimised for visible light, significant IR sources (heat lamps) can add error.
  • Slow update: 120 ms per measurement means maximum ~8 Hz update rate in high-res mode.