From Let's Control It
Jump to navigation Jump to search


BH1750 2.jpg

The BH1750 Sensor is a luminosity sensor. It's spectral sensivity approximately meets the human eye sensivity. The sensor supports different resolutions. The settings with ESPEasy offer the possibility to set resolution to your needs. It is connected to the ESP via I²C so connecting even with several sensors and a display is easy to do. The sensor gives relative humidity and temperature as digital values.


The BH1750 runs well on 3,3V so no level shifter or special power supply is needed.

The bare circuit is very small and difficult to handle and solder. Usually you will use a breakout board from the market that is much easier to handle.


Connecting the BH1750 is easy. Just connect it as shown in the schematic:

  BH1750		ESP
  VCC		3,3V
  SCL		D1(GPIO5)
  SDA		D2(GPIO4)
  ADDR		not connected. (For default address)


BH1750-Breadboard Example.jpg

If you're connecting several devices to I²C and/or using longer cabling please see the "Basics: The I²C Bus" wiki for further informations. [link]


First check if the BH1750 show up:

Go to the "Advanced" Tab and click "I³C Scan" It should show this result:

BH1750 Scan-Result.jpg

Set up the ESPEasy task according to the screenshot.

BH1750 Setiings.jpg

Additional Settings=

You may set the resolution to your needs. Lower resolution works faster with less accuracy. The "RESOLUTION_AUTO_HIGH" setting gives a reasonable compromise for usual purposes.

After some seconds the tasklist will show like this:

BH1750 Device-List.jpg

If it shows all values as zero, don't worry. Wait a minute and refresh the browser page.


See "Basics: Calibrating" for further information [link]


Your BH1750 does not show up at I²C-scan

Usually this failure results of cabling faults. If your device does not show up, SCL and SCA might be swapped or the module does not get power or ground. If you are testing on a breadboard, the breadboard contacts might be worn out or you got some faulty cables. A digital multimeter will help with this situations.

Your BH1750 shows all values zero

The I²C-scan showed your BH1750 but after submitting and returning to the task list all values are zero. First, wait a minute and then refresh the page. Depending on the "Delay" value in the settings it might take some seconds until the first measurement takes place. If that does not help, switch the ESP completely off and back on after some seconds.

Your BH1750 shows deviating values

This might have several reasons.

These sensors all have their own tolerances. On top the analog to digital conversion produces a deviation of about +/- 1...2 digits.

It is possible to calibrate sensors using a formula See "Basics: Calibrating" for further information [link]

Last but not least problems with the power supply are quite usual. See "Basics: Taming false positives" in the wiki for info about filtering power supply. {link]