← 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| Pin | Name | Functions | Notes |
|---|---|---|---|
| VIN | Power | POWER | |
| 3Vo | 3.3V Output | GND | |
| GND | Ground | GND | |
| SCL | I2C Clock | I2C | |
| SDA | I2C 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
| Pin | Arduino Uno R3 | ESP32 DevKitC (WROOM-32) | Notes |
|---|---|---|---|
| VCC | +5V | 3V3 | Breakout 3-5 V safe |
| GND | GND | GND | |
| SCL | A5/SCL | GPIO22 | I2C clock |
| SDA | A4/SDA | GPIO21 | I2C data |
Typical uses
- Ambient light measurement in lux
- Auto-brightness and daylight sensing