← All parts

BH1750 Ambient Light Sensor

Adafruit

The BH1750 is a 16-bit ambient light sensor with I2C interface, designed for use with microcontrollers like Arduino and Raspberry Pi.

In stock

Specifications

2
Operating Voltage
3-5V
Logic Level
3-5V

Pinout

5
PinNameFunctionsNotes
VINPower
POWER
3Vo3.3V Output
GND
GNDGround
GND
SCLI2C Clock
I2C
SDAI2C Data
I2C

Interactive pinout

Highlight:
BOARD

Click a pin to copy its name · tap a tag above to spotlight a bus.

Starter code

Community starter examples — minimal, unofficial, and provided to get you wiring fast. Verify against the manufacturer datasheet before relying on them.

Arduino (C++)

Arduino library: BH1750 (by Christopher Laws)

arduino
// BH1750 ambient light (lux) over I2C — community starter example
#include <Wire.h>
#include <BH1750.h>

BH1750 lightMeter;

void setup() {
  Serial.begin(115200);
  Wire.begin();
  lightMeter.begin();
}

void loop() {
  Serial.print(lightMeter.readLightLevel()); Serial.println(" lx");
  delay(1000);
}

MicroPython

MicroPython library: bh1750 (PinkInk/micropython-bh1750)

python
# BH1750 (ESP32) — community starter example
# lib: bh1750.py (e.g. PinkInk/micropython-bh1750)
from machine import Pin, I2C
from bh1750 import BH1750
import time

i2c = I2C(0, scl=Pin(22), sda=Pin(21))
sensor = BH1750(i2c)

while True:
    print(sensor.measurement, "lx")
    time.sleep(1)

Wiring

PinArduino Uno R3ESP32 DevKitC (WROOM-32)Notes
VCC+5V3V3Breakout 3-5 V safe
GNDGNDGND
SCLA5/SCLGPIO22I2C clock
SDAA4/SDAGPIO21I2C data

Typical uses

  • Ambient light measurement in lux
  • Auto-brightness and daylight sensing

Related parts

6