A GY-302 light sensor board fitted with the BH1750 digital ambient light sensor, for measuring light levels in lux from an Arduino, ESP32 or Raspberry Pi. It runs from 3V to 5V, talks over I2C and gives a reading straight in lux from 1 to 65535, so there is no analogue maths or calibration to do. For direct sunlight or a wider range, see our VEML7700 ambient light sensor.
Specifications
Datasheets
What's in the box
Ships with a 5-pin 2.54 mm male header, loose and ready to solder. Jumper wires and the microcontroller are not included.
Great for
Wiring & getting started
- Solder the header
Push the short ends of the 5-pin header through the board from the back, so the sensor faces up, and solder all five pins on the component side.
- Wire four pins
VCC to 5V on an Uno or Nano, or 3V3 on an ESP32. GND to GND. SCL to A5 and SDA to A4 on an Uno or Nano, or GPIO22 and GPIO21 on an ESP32. Leave ADDR unconnected for address 0x23.
- Run the test sketch
The datasheet has a short sketch that needs no library. Upload it and open the Serial Monitor at 115200 baud. It prints BH1750 found, then a reading in lux every second.
- Check it responds
Cover the sensor with a finger and the reading drops towards 0. Shine a torch on it and it climbs.
Note: To use address 0x5C, connect ADDR to 3.3V, not 5V. The sensor chip runs at 3.3V from the onboard regulator, so ADDR must not go above 3.3V.
