Skip to content
Buy 10+ on select items — save 10% auto-applied
Free US shipping on orders $35+
Order by 3pm ET — ships same-day from the US
Skip to main content

Arduino BH1750: Read Real Lux Over Serial | ShillehTek

May 14, 2026 9 views

Arduino BH1750: Read Real Lux Over Serial | ShillehTek
Project

Build an Arduino Nano lux meter with the BH1750 (GY-302) sensor and read real light intensity over I2C in the Serial Monitor using ShillehTek parts.

10 min Beginner3 parts

Project Overview

Arduino Nano + BH1750 light sensor: In this project, you will wire a BH1750 (GY-302) digital ambient light sensor to an Arduino Nano and print real lux readings to the Serial Monitor for a simple, accurate lux meter.

The BH1750 is a 16-bit digital light sensor that outputs lux directly, so you do not need calibration math like you would with a photoresistor. It is a good fit for plant grow-lights, photography meters, and circadian-rhythm projects.

  • Time: ~10 minutes
  • Skill level: Beginner
  • What you will build: An Arduino reading ambient light in lux over Serial.
Arduino Nano project cover showing a BH1750 GY-302 digital light sensor module used to measure ambient light in lux
The BH1750 (GY-302) is a tiny board with true-lux output.

Parts List

From ShillehTek

External

  • USB cable + Arduino IDE

Note: BH1750 default I2C address is 0x23. Tie ADDR HIGH for 0x5C (rare).

Step-by-Step Guide

Step 1 - Inspect the module

Goal: Identify the BH1750 pins so you can wire I2C correctly.

What to do: Locate the 5 header pins on the GY-302 board: VCC, GND, SCL, SDA, and ADDR.

Front of the BH1750 GY-302 light sensor module showing pins VCC, GND, SCL, SDA, and ADDR
5 pins: VCC, GND, SCL, SDA, ADDR.
Back of the BH1750 GY-302 module showing onboard pull-up resistors and voltage regulator for I2C use
Pull-ups and a regulator are on the back.

Expected result: You can confidently match each BH1750 pin to the correct Arduino Nano connection in the next step.

Step 2 - Wire I2C to the Arduino

Goal: Connect the BH1750 to the Arduino Nano using I2C.

What to do: Wire the module as shown: VCC to 5 V, GND to GND, SDA to A4, and SCL to A5. Leave ADDR floating to use the default address (0x23).

BH1750 GY-302 module wired to an Arduino Nano using I2C with SDA to A4 and SCL to A5
VCC to 5 V, GND to GND, SDA to A4, SCL to A5, ADDR floating.

Expected result: The BH1750 is powered and connected to the Nano I2C bus.

Step 3 - Install the library and upload the sketch

Goal: Load code that initializes the BH1750 and prints lux readings to Serial.

What to do: In the Arduino IDE, open Library Manager and install BH1750 by Christopher Laws. Then paste the sketch below, select your board and port, and upload.

Arduino IDE showing a BH1750 lux reading sketch that calls begin() and readLightLevel()
Key calls are begin() and readLightLevel().

Code:

#include <Wire.h>
#include <BH1750.h>

BH1750 light;

void setup() {
  Serial.begin(9600);
  Wire.begin();
  light.begin();
}

void loop() {
  float lux = light.readLightLevel();
  Serial.print("Lux: "); Serial.println(lux, 1);
  delay(500);
}

Expected result: The sketch uploads successfully and the Arduino begins sampling the sensor about twice per second.

Step 4 - View lux readings in Serial Monitor

Goal: Confirm the BH1750 is reporting real lux values.

What to do: Open the Serial Monitor at 9600 baud. Change the light level (cover the sensor, point it at a lamp, move it near a window) and watch the lux values change.

Arduino Serial Monitor displaying changing BH1750 lux readings as ambient light changes
Typical readings: ~50 lx in a dim room, ~500 lx in an office, ~10,000 lx near a window, and above 50,000 lx outside.

Expected result: You see lines like Lux: 123.4 updating repeatedly, and the value changes when lighting changes.

Step 5 - Build on the lux value

Goal: Use the lux reading as an input for automation or logging.

What to do: Pick a direction and add your own logic based on a lux threshold or target value.

  • Auto-dim an LED strip to maintain target lux on a desk
  • Trigger a relay-controlled grow-light when ambient drops below a threshold
  • Build a photographer’s exposure meter with an OLED
  • Log daily light exposure for plants or chickens

Expected result: You have a working lux signal that can drive decisions in your next project.

Conclusion

You built an Arduino Nano and BH1750 light sensor setup that reports real lux values over Serial. Switching from raw ADC counts to lux makes smart-lighting and light-logging projects much more actionable.

Want the exact parts used in this build? Grab them from ShillehTek.com. If you want help customizing this project or building something for your product, check out our IoT consulting services.