Product Overview
The GY-302 BH1750 Light Intensity Illumination Module is a sophisticated digital ambient light sensor that provides precise illuminance measurements directly in Lux (lx) via the I2C interface. Unlike traditional Light Dependent Resistors (LDRs) that require complex analog calculations and calibration, this module features a built-in 16-bit Analog-to-Digital Converter (ADC) and outputs calibrated light intensity data directly—no additional math or calibration required .
Manufactured by ROHM Semiconductor, the BH1750FVI chip is designed to detect a wide range of light levels from 1 to 65,535 lux with high resolution, making it suitable for applications ranging from dimly lit rooms to bright outdoor environments . Its spectral response is specifically optimized to closely match the sensitivity of the human eye, ensuring that the sensor measures brightness as humans perceive it, rather than being influenced by infrared or ultraviolet light .
The GY-302 module includes onboard level shifting, making it directly compatible with both 3.3V and 5V microcontrollers such as Arduino, ESP32, ESP8266, Raspberry Pi, and STM32 without requiring external level converters . Whether you are building automatic screen brightness adjustment systems, greenhouse lighting controls, weather stations, or smart home automation, this module offers plug-and-play simplicity with accurate, repeatable results.
Key Features
-
Direct Digital Output: Built-in 16-bit ADC outputs calibrated lux values—no complex analog calculations or calibration required
-
Wide Measurement Range: Detects illuminance from 1 to 65,535 lux (extendable to 0.11 – 100,000 lx via MTreg adjustment), covering everything from dark rooms to bright sunlight
-
Human-Eye Spectral Response: Spectral sensitivity closely matches the human eye (peak at approximately 560nm), providing accurate brightness measurements as perceived by humans
-
I2C Digital Interface: Simple 2-wire communication (SDA, SCL) with selectable slave addresses (0x23 or 0x5C via ADDR pin), allowing multiple sensors on the same bus
-
Dual Voltage Compatibility: Operates on 3V-5V power with onboard level shifting; directly compatible with both 3.3V (ESP32, ESP8266) and 5V (Arduino) microcontrollers
-
Low Power Consumption: Active measurement current as low as 120µA with power-down mode reducing consumption to near zero when idle
-
Built-in Noise Rejection: Integrated 50Hz/60Hz light noise rejection filters ensure stable readings under fluorescent and artificial lighting
-
Adjustable Sensitivity: MTreg (measurement time register) can be modified to adjust sensitivity, allowing for optical window compensation and extended measurement range
-
No External Components Required: Fully self-contained sensor—no external resistors, capacitors, or calibration needed for operation
Technical Specifications
Pinout & Connection Guide
The GY-302 BH1750 module features a compact 5-pin configuration, clearly labeled on the PCB for easy wiring .
Pin Definitions
I2C Address Configuration
The ADDR pin selects between two I2C slave addresses, allowing multiple BH1750 sensors to coexist on the same I2C bus:
I2C Pin Mapping for Common Development Boards
Wiring Diagram (Arduino Uno)
GY-302 Module → Arduino Uno
─────────────────────────────────────────
VCC → 5V
GND → GND
SCL → A5 (SCL)
SDA → A4 (SDA)
ADDR → GND (for address 0x23) or leave floating
Pull-Up Resistor Requirements
The I2C bus requires pull-up resistors on the SDA and SCL lines. The GY-302 module includes onboard 4.7kΩ pull-up resistors, so no external resistors are needed for most applications . If you experience communication issues with long cables or multiple I2C devices, adding external 4.7kΩ – 10kΩ resistors can improve reliability .
Measurement Modes Explained
The BH1750FVI sensor offers multiple measurement modes, allowing you to optimize for resolution, speed, and power consumption :
Continuous Mode: The sensor continuously measures light intensity and updates the data register. Use this when you need constant monitoring .
One-Time Mode: The sensor performs a single measurement and then enters power-down mode. Use this for battery-powered applications where you only need periodic readings .
Usage Guide
Software Setup (Arduino IDE)
Step 1: Install Required Libraries
The BH1750 is compatible with several libraries. The most popular and well-maintained are:
Option A: “BH1750” Library – Simplest to use, provides readLightLevel() function
-
Open Arduino IDE → Sketch → Include Library → Manage Libraries
-
Search for “BH1750”
-
Find the library by Christopher (claws) and click Install
Option B: Manual I2C Implementation – For maximum control over the sensor
Step 2: Basic Test Sketch
GY-302 BH1750 Light Intensity Sensor Basic Read Example
*/
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup() {
Serial.begin(9600);
Wire.begin();
if (lightMeter.begin(BH1750::CONTINUOUS_HIGH_RES_MODE)) {
Serial.println(F("GY-302 Sensor Initialized Successfully"));
} else {
Serial.println(F("Error initializing GY-302 sensor! Check wiring."));
while (1);
}
}
void loop() {
float lux = lightMeter.readLightLevel();
Serial.print("Light Intensity: ");
Serial.print(lux);
Serial.println(" lx");
if (lux < 10) {
Serial.println(" (Very dark - night time or dark room)");
} else if (lux < 50) {
Serial.println(" (Dim light - twilight or dark indoor)");
} else if (lux < 200) {
Serial.println(" (Moderate indoor lighting)");
} else if (lux < 500) {
Serial.println(" (Bright indoor - office lighting)");
} else if (lux < 2000) {
Serial.println(" (Overcast day outdoors)");
} else {
Serial.println(" (Very bright - direct sunlight)");
}
delay(1000);
}
Step 3: Manual I2C Code (Without Library)
GY-302 Manual I2C Read Example (No Library)
*/
#include <Wire.h>
int BH1750address = 0x23;
byte buff[2];
void setup() {
Wire.begin();
Serial.begin(9600);
Serial.println("GY-302 Manual Read");
}
void loop() {
Wire.beginTransmission(BH1750address);
Wire.write(0x10);
Wire.endTransmission();
delay(180);
Wire.requestFrom(BH1750address, 2);
int i = 0;
while(Wire.available()) {
buff[i] = Wire.read();
i++;
}
float lux = ((buff[0] << 8) | buff[1]) / 1.2;
Serial.print("Light Intensity: ");
Serial.print(lux);
Serial.println(" lx");
delay(1000);
}
Understanding the Output
-
1 – 10 lx: Very dark environment (night, dark room)
-
50 – 200 lx: Dim indoor lighting (twilight, dark corners)
-
200 – 500 lx: Standard indoor lighting (office, home)
-
500 – 2,000 lx: Bright indoor (near window) or overcast outdoor
-
2,000 – 10,000 lx: Full daylight outdoors (shade or overcast)
-
10,000 – 100,000 lx: Direct sunlight
Power Management for Battery-Powered Projects
The BH1750’s low power consumption makes it excellent for battery-powered applications:
Q: What is the difference between GY-302 and an LDR (photoresistor)?
An LDR is an analog component that changes resistance based on light, requiring an ADC and calibration to convert to meaningful units. The GY-302 is a complete digital sensor with a built-in 16-bit ADC that outputs calibrated lux values directly without any calculations or calibration . Additionally, the BH1750’s spectral response matches the human eye, while LDRs are sensitive to a broader spectrum, making the GY-302 more accurate for applications that measure brightness as humans perceive it.
Q: What are the two I2C addresses, and how do I select them?
The GY-302 module has two possible I2C addresses: 0x23 and 0x5C. The address is selected via the ADDR pin: connect ADDR to GND for address 0x23, or connect ADDR to VCC for address 0x5C . This allows two BH1750 sensors to coexist on the same I2C bus by setting one to 0x23 and the other to 0x5C.
Q: Can the BH1750 measure very low light levels (moonlight)?
Yes, with a limitation. The standard measurement range starts at 1 lux, which is slightly higher than typical moonlight (approximately 0.2 lux). However, by adjusting the measurement time register (MTreg), you can detect light levels as low as 0.11 lux . This requires modifying the sensor’s configuration registers for extended range operation.
Q: Can the GY-302 be used with a 3.3V microcontroller like ESP32?
Yes. The module operates on 3V-5V power and includes onboard level shifting, making it directly compatible with both 3.3V (ESP32, ESP8266) and 5V (Arduino) microcontrollers . Connect VCC to 3.3V, GND to GND, and the I2C pins as usual.
Q: Why does my sensor sometimes return 0 lux when it shouldn't?
This can occur if:
-
You’re using readLightLevel() without first calling begin() to initialize the sensor
-
The measurement mode is not properly configured
-
The ADDR pin is floating—connect it to GND or VCC for a stable address
-
Power supply noise is affecting readings
Q: What is the measurement resolution of the BH1750?
The standard high-resolution mode provides 1 lux resolution. High-resolution mode 2 provides 0.5 lux resolution for very low light environments . The low-resolution mode provides 4 lux resolution but has a faster 16ms measurement time.
Q: What is the purpose of the ADDR pin?
The ADDR pin selects the I2C slave address of the sensor . When ADDR is connected to GND, the address is 0x23. When ADDR is connected to VCC, the address is 0x5C. This allows two BH1750 sensors to be used on the same I2C bus without address conflicts .
Q: Does the GY-302 require calibration?
No. The BH1750 chip is factory-calibrated and outputs direct lux values without any calibration needed . The module is truly plug-and-play—simply connect power and I2C lines, and you’re ready to read light intensity.
Q: What is the maximum I2C communication speed?
The BH1750 supports both Standard Mode (100 kHz) and Fast Mode (400 kHz) I2C speeds . Most microcontroller libraries default to 100 kHz for maximum compatibility. You can increase to 400 kHz for faster communication.
Q: What is the measurement variation between different sensors?
The typical measurement variation between different BH1750 units is ±20% . This is due to variations in the photodiode sensitivity and optical window characteristics. For most consumer applications (screen brightness adjustment, lighting control), this accuracy is sufficient.
Q: Can the GY-302 be used outdoors?
Yes, the BH1750 has an industrial operating temperature range of -40°C to +85°C . This makes it suitable for outdoor installations. However, the module itself is not waterproof—for outdoor use, place it inside a weatherproof enclosure with a transparent window.
Q: What is the difference between GY-302 and other BH1750 modules?
The GY-302 is a specific breakout board design that includes the BH1750FVI chip, onboard level shifting, and pull-up resistors . It is compact (13.9mm × 18.5mm) and includes the standard 5-pin interface (VCC, GND, SCL, SDA, ADDR) . Other BH1750 modules may have different form factors or omit the ADDR pin.
Q: How do I adjust the measurement range to detect very high light levels?
By adjusting the measurement time register (MTreg), the maximum detectable range can be extended to approximately 100,000 lux . This compensates for optical window attenuation and allows measurement of direct sunlight. The sensitivity is shifted by changing the MTreg value from the default “0100_01010” to “1000_1010” (approximately 2x sensitivity) .