Tutorials

Interfacing BH1750 Light intensity sensor with Arduino in Lux

Learn how to interface a BH1750 Ambient Light intensity sensor with Arduino to measure the light intensity in the units of Lux

Overview:

In this tutorial, let’s learn how to connect BH1750 light intensity sensor with Arduino and display the light intensity values on 16X2 LCD display in Lux Units. So in this article you are going to learn the Overview of BH1750 light sensor, How BH1750 sensor works? and interfacing it with Arduino Microcontroller.

BH1750 Light sensor Overview:

BH1750 is a digital ambient light sensor which measures the light intensity incident on the sensor and converts it into a 16 bit digital number. It doesn’t required any type of converting modules as the sensor itself has an ADC which converts and outputs a digital signal.

bh1750 ambient digital light sensor

BH1750 uses I2C communication protocol to transmit the data which makes it compatible with almost all microcontroller boards. BH1750 directly outputs the measured light in Lux units which is the unit of light intensity.

1lux = the amount of illumination provided when one lumen is evenly distributed over an area of one square metre.

Working of BH1750 Light intensity sensor:

BH1750 Sensor board contains BH1750FVI IC. When an Ambient light is incident on the sensor the photo diode with a latency nearly equals to human eye absorbs the light and produces an analog voltage signal which is further connected to ADC unit to convert it from analog to digital 16 bit data.

In the next step with the help of two registers data register and time register the light intensity is calculated and transmit the data signal through I2C bus.

This sensor is mainly used in LCD displays, TVs, Monitors and mainly in Mobile displays to automatically adjust the screen brightness according to the outdoor light conditions. This sensor can also used to Turn on/Off the lights.

You might be thinking of LDR(Light dependent Resistor) which works as same but this BH1750 sensor has more advantages like higher accuracy and stability over LDR.

BH1750 Pinout diagram:

BH1750 light intensity sensor pinout diagram

From the above pinout diagram as you can see there are 5 pins. 2 Pins for power supply VCC and GND. Another 2 pins for I2C communication SCL and SDA. And the last one is I2C Address pin which we are not going to use in this tutorial.

Related project: UV index meter interfacing Arduino

ADD pin is used to set sensor I2C address. If it has voltage greater or equal to 0.7VCC voltage (e.g. you’ve connected it to VCC) the sensor address will be 0x5C. In other case (if ADD voltage less than 0.7 * VCC) the sensor address will be 0x23 (by default).

Technical specifications of BH1750:

  • Operating voltage: 3v to 5v
  • Measures Lux range with a high resolution from 1 to 65535lx.
  • Illuminance to Digital Converter
  • The influence of infrared is very small
  • Small measurement variation (+/- 20%)
  • Feature to select 2 types of I2C addresses.
  • Low power consumption

Interfacing BH1750 with Arduino Microcontroller and LCD Display

Bill of Materials:

Product NameQuantityamazon logoamazon logo india
BH1750 Ambient light intensity sensor1https://amzn.to/33C6aRThttps://amzn.to/3J0WRKw
Arduino Uno Microcontroller1https://amzn.to/3H4cKxZhttps://amzn.to/3638aTS
16X2 LCD display module with I2C adapter1https://amzn.to/3I3Uaaxhttps://amzn.to/363ki7F
Few Connecting Wireshttps://amzn.to/3H2BV4ehttps://amzn.to/3J0WVu2
5V power supply (Micro USB or External).1https://amzn.to/3s1a8g3https://amzn.to/364yInH
You can buy the required components from the given best buy links. We choose the components according to value for money.

Circuit Diagram:

Connect all the required components according to the below circuit diagram

interfacing BH1750 light sensor module with Arduino

As you can see from the above pinout diagram BH1750 power pins VCC and GND are connected to 3.3v and GND pins of Arduino respectively. The I2C pins of BH1750 SDA and SCL are connected to A4 and A5 pins of Arduino respectively.

The power pins VCC and GND of 16X2 LCD display with I2C adapter is connected to 5V and GND pins of Arduino respectively and I2C communication pins SDA and SCL are connected to the same A4 and A5 of Arduino respectively.

That’s it for connection now its time to upload the code to Arduino

Program Code:

Now connect the Arduino to the PC where Arduino IDE is installed to upload the below code. This source code required few libraries which are listed below, you can install them directly through Arduino IDE library manager or you can Download them from the below links and extract them into libraries folder in Documents.

  • Download Liquidcrystal_I2C Library: Link
  • Download BH1750 Library: Link

Copy the below code and paste it into Arduino IDE workspace and hit upload button.

After uploading the code you can see the light intensity lux values are displayed on the serial monitor and LCD display module. You can check with any light sources like torch light, flashlight or even sun.

Output:

Bh1750 with arduino output in lux

As you can see from the output image that when a light falls on the sensor it shows the intensity of the light on the LCD display connected. Through this values you can create projects like automatic streetlights, Automatic sensor car headlamps and more.

If you like this tutorial please share with your friends and also please follow our Facebook page “Circuit Schools” for more interesting updates.

CircuitSchools Staff

We at CircuitSchools publish on basics of electronics and electric components and everything related to evolution of electrical technology with complete analysis of development boards and modules along with latest projects with innovative ideas.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button