BH1750 ambient light sensor I2C to the cloud with an ESP32

ROHM·Environment sensors·I²CBench-verified

The ubiquitous I²C light sensor breakout (GY-302 and friends), read through the gateway's generic I²C driver. It reports illuminance in lux from about 1 to 65 000.

The Synacl ESP32 gateway reads the BH1750 ambient light sensor over I²C. This catalog entry carries the register map, scaling and connection defaults below, so adding it in the app is a pick from a list rather than a form filled in from the datasheet — and it is the same data an AI agent gets from the list_catalog MCP tool.

Registers · 1 tag

TagUnitI²C addressInit byteBytesByte orderScale
Illuminance
illuminance_ambient
lux0x230x102big-endian× 0.8333

Generic I²C: the gateway writes the init byte once, then reads the given number of bytes each poll and combines them in the stated byte order. Engineering value = raw × scale + offset.

Connection defaults

I²C address0x23
Sensor drivergeneric
Bus pins (gateway default)SDA GPIO 21 · SCL GPIO 22 (3.3 V)
Bus clock100 kHz

Wiring

I²C: SDA to GPIO 21, SCL to GPIO 22 (the gateway defaults), VCC to 3.3 V, GND to GND. Leave ADDR unconnected or tied low for address 0x23. The breakout carries its own pull-ups; keep the wires short.

Notes

Set it up in three steps

  1. Flash the gateway from the browser
    Plug an ESP32 dev board into USB, open the free web flasher in Chrome or Edge and write the Synacl gateway firmware. It asks for Wi-Fi and pairs the gateway with your account — nothing to install, about two minutes.
  2. Add the BH1750 ambient light sensor from the catalog
    In the app open Devices → Add device and choose “Start from a catalog device”, then pick BH1750 ambient light sensor. The I²C settings and every tag in the table above are filled in; choose the gateway it is wired to, change the I²C address if yours differs, and save. How the catalog picker works →
  3. Watch the live data arrive
    The gateway receives the new configuration over MQTT within seconds and starts polling. Readings show on the device page and in any dashboard widget you bind to them; add a rule for alerts, keep history for reports, or let an AI agent read it over MCP.

How this entry was verified

Bench-verified — confirmed on real hardware by Synacl.

Bench-verified means Synacl ran this entry on real hardware. Datasheet-derived means the map was transcribed from the vendor's documentation, so a register may be off by one or in the other word order on your unit — a two-line email fixes it for everyone.

Report a register mismatch · Vendor datasheet ↗ · All catalog devices

Try it on your own hardware

Synacl is free for five devices — no card, no sales call. Flash a gateway from the browser, add the BH1750 ambient light sensor from the catalog, and see live data in a few minutes.