Skip to main content

bh1750

Measure ambient light intensity in lux using the BH1750 digital light sensor via I2C.

Overview

The bh1750 node reads ambient light levels from the BH1750 digital light sensor. It directly outputs light intensity in lux (no manual calibration needed), making it ideal for automatic brightness control, daylight harvesting, and grow light management.

1-65535
Lux Range
16-bit
Resolution
I2C
Interface
3.3V
Power

Light Levels Reference

Environment Lux
Moonlight 0.1 - 1
Street lighting 10 - 20
Living room 50 - 300
Office lighting 300 - 500
Overcast day 1,000 - 2,000
Full daylight 10,000 - 25,000
Direct sunlight 32,000 - 130,000

Properties

Property Type Default Description
address number 0x23 I2C address (0x23 or 0x5C)
mode string "continuous" "continuous" or "oneshot"
resolution string "high" "high" (1 lux), "high2" (0.5 lux), "low" (4 lux)
interval number 1000 Reading interval (ms)

Output

{
  "payload": 342.5,
  "unit": "lux",
  "timestamp": 1640000000000
}

Example: Automatic Blinds Control

Control motorized blinds based on ambient light levels.

// Function node: Blinds position logic
var lux = msg.payload;
var position;

if (lux > 30000) {
    position = 100; // Fully closed - too bright
} else if (lux > 10000) {
    position = 75;  // Mostly closed
} else if (lux > 1000) {
    position = 50;  // Half open
} else if (lux > 100) {
    position = 25;  // Mostly open
} else {
    position = 0;   // Fully open - it's dark
}

msg.payload = {
    lux: lux,
    blindsPosition: position,
    action: "set_blinds"
};

return msg;

Related Nodes