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 Range | 1 – 65535 lx |
---|---|
Resolution | 1 lx (at 0-5461 lx range) |
Accuracy | ±20% (typical) |
Supply Voltage | 2.4V – 3.6V (5V tolerant I/O) |
I2C Address | 0x23 (default) or 0x5C (ADDR pin high) |
Interface | I2C (up to 400kHz) |
Pin Configuration
Pin | Label | Description | Arduino Connection |
---|---|---|---|
1 | VCC | Power (3.3V recommended) | 3.3V |
2 | GND | Ground | GND |
3 | SCL | I2C Clock | A5 (Uno) or SCL |
4 | SDA | I2C Data | A4 (Uno) or SDA |
5 | ADDR | Address Select | GND (0x23) or VCC (0x5C) |
Note: Module includes pull-up resistors for I2C lines
Wiring Diagram (Arduino Uno)
1 2 3 4 5 6 |
// 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#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
1 2 3 4 5 6 7 |
// 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
1 2 |
// Use alternate I2C address (ADDR pin to VCC) BH1750 lightMeter(0x5C); |
Measurement Timing
1 2 3 |
// Adjust measurement time (69 default) lightMeter.adjustMtreg(138); // Double sensitivity // Range: 31 (min) to 254 (max) |
Power Saving
1 2 3 |
// 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