Blog

GY-302 BH1750 Digital Light Sensor Module for Arduino 3V-5V

GY-302 BH1750 Digital Light Sensor Module

High-Precision Ambient Light Sensing for Arduino Projects

Introduction

The GY-302 BH1750 is a digital ambient light sensor that measures illuminance in lux (lx) with high resolution (1-65535 lx). This I2C interface module operates from 3V to 5V and is ideal for automatic brightness adjustment in displays, smart lighting systems, and environmental monitoring.

Key Features

💡 Wide Range

1-65535 lx measurement range

🔍 High Resolution

1 lx resolution at low light levels

🔋 Low Power

0.12mA active current (0.01μA standby)

🌈 Spectral Response

Close to human eye sensitivity

Technical Specifications

Measurement Range1 – 65535 lx
Resolution1 lx (at 0-5461 lx range)
Accuracy±20% (typical)
Supply Voltage2.4V – 3.6V (5V tolerant I/O)
I2C Address0x23 (default) or 0x5C (ADDR pin high)
InterfaceI2C (up to 400kHz)

Pin Configuration

PinLabelDescriptionArduino Connection
1VCCPower (3.3V recommended)3.3V
2GNDGroundGND
3SCLI2C ClockA5 (Uno) or SCL
4SDAI2C DataA4 (Uno) or SDA
5ADDRAddress SelectGND (0x23) or VCC (0x5C)
Note: Module includes pull-up resistors for I2C lines

Wiring Diagram (Arduino Uno)

// Basic Connections:
// VCC → 3.3V (or 5V with level shifting)
// GND → GND
// SCL → A5 (or SCL)
// SDA → A4 (or SDA)
// ADDR → GND (for default address 0x23)

 

 

Basic Light Measurement

#include 
#include 

BH1750 lightMeter;

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

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

 

Library Required: Install “BH1750” by Christopher Laws via Arduino Library Manager

Advanced Configuration

Measurement Modes

// Set different measurement modes
lightMeter.begin(BH1750::CONTINUOUS_HIGH_RES_MODE);  // Default
// Other options:
// CONTINUOUS_HIGH_RES_MODE_2
// CONTINUOUS_LOW_RES_MODE
// ONE_TIME_HIGH_RES_MODE
// ONE_TIME_LOW_RES_MODE

Address Selection

// Use alternate I2C address (ADDR pin to VCC)
BH1750 lightMeter(0x5C);

Measurement Timing

// Adjust measurement time (69 default)
lightMeter.adjustMtreg(138); // Double sensitivity
// Range: 31 (min) to 254 (max)

Power Saving

// Power down sensor between readings
lightMeter.begin(BH1750::ONE_TIME_HIGH_RES_MODE);
// Takes measurement then auto-powers down

Troubleshooting

No Readings

  • Verify I2C connections (SDA/SCL)
  • Check with I2C scanner sketch
  • Confirm power supply (3.3V recommended)

Incorrect Values

  • Ensure proper measurement mode selected
  • Check for light leaks or shadows
  • Calibrate against known light source

Communication Errors

  • Add 4.7kΩ pull-up resistors if missing
  • Reduce I2C clock speed if using long wires
  • Check for address conflicts