Introduction
In this tutorial, we will learn about the GY-302 module, what is a BH1750 light sensor and we will build a simple project using the GY-302 module and an Arduino.
Digital Light Intensity Sensor Module GY-302
The GY-302 Module will be our main component for this tutorial. This module has a BH1750 light sensor IC mounted on a breakout board. Figure 1 shows the module as seen in fritzing.

Pinout
The GY-302 module has five pins.
Pin | Description |
---|---|
ADDR | I2C Device Address: 0x23 (when ADDR = LOW) or 0x5c (when ADDR = HIGH) |
SDA | I2C |
SCL | I2C |
GND | Ground |
VCC | +3.3V |
What is a BH1750 Light Sensor
A BH1750 light sensor senses the amount of ambient light and gives out the light intensity via the i2c interface.
Project - Arduino Light Sensor
Our project will get the analog and digital signals from the GY-302 module, and display it on the serial monitor.
Components
For this project, we need the following components:
Wiring Diagram

Figure 2 shows the connection between the Arduino Uno and the GY-302 Digital Light Intensity Sensor Module.
The GY-302 module pins are connected to the Arduino Uno board as follows:
Pin | Description |
---|---|
ADDR | No Connection |
SDA | A4 |
SCL | A5 |
GND | Ground |
VCC | +3.3V |
Library
To make our Arduino more simple, we will use the BH1750.h library. Use the built-in Library Manager to download and install the library.

The Code
Below is the Arduino sketch for our project. I have added comments to explain important parts of the code. Save the code as GY-302.ino and upload it to your Arduino board.
// Arduino and GY-302 module
#include
#include
BH1750 GY302; // initialize BH1750 object
void setup() {
Serial.begin(9600); // initialize serial
GY302.begin(); // initialize GY-302 module
}
void loop() {
// get reading from module
uint16_t lux = GY302.readLightLevel();
// display to Serial Monitor
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lx");
// pause for 1 second
delay(1000);
}
Project Test
Apply power to your Arduino Uno board and open the Serial Monitor in the Arduino IDE. Arduino will output the values sent by the module to the serial monitor.