BH1750 is an ambient light sensor & it’s module design is known as GY-30. Ambient light is the light which is already present in a scene, without any additional lighting is added. It usually refers to natural light & also mean artificial lights such as normal room lights. For photography, ambient light is most important as camera lens requires it to generate the image from the scene. An ambient light sensor is a component in smartphones, notebooks, other mobile devices, gadgets, automotive displays and LCD TVs. It is a photo-detector that is used to sense the amount of ambient light present, and appropriately dim the device’s screen to match it. This avoids having the screen be too bright when the user’s pupils are adapted for vision in a dark room, or too dim when the device is used outdoors in the daytime. Dimming the screen on a mobile device also prolongs the lifetime of the battery. The standard international unit for the illuminance of ambient light is the lux. The typical performance of an ambient light sensor is from less than 50 lux in dim light to over 10,000 lux at noon.
This is a BH1750 light intensity sensor breakout board/module with a built-in 16 bit AD converter which can directly give digital signal (on I2C) as output, hence no need for complicated calculations in controlling unit. It consumes a very low amount of current. This photo diode contains a PN junction. When light falls on it, electron-hole pairs are created in the depletion region. Due to the internal photoelectric effect, electricity is produced in the photo-diode. This produced electricity is proportional to the intensity of light. This electricity is changed into a voltage by the Op-amp. With the BH1750 light sensor intensity can be directly measured by the lux-meter, without making calculations because the sensor directly output in Lux (Lx).
Block diagram of BH1750
- PD : Photo diode with approximately human eye response.
- AMP : Integration-OPAMP for converting from PD current to Voltage.
- ADC : AD converter for obtainment Digital 16-bit data.
- Logic + I2C Interface : Ambient Light Calculation and I2C BUS Interface. It is including below register.
Data Register : This is for registration of Ambient Light Data. Initial Value is “0000_0000_0000_0000″.
Measurement Time Register : This is for registration of measurement time. Initial Value is “0100_0101″.
- OSC : Internal Oscillator (typ. 320 kHz ). It is CLK for internal logic.
- Sensor : BH1750FVI (Compact surface mount package 1.6 x 1.6 x 0.55 mm)
- Power Supply : 3.3V – 5V
- Current consumption : 0.12mA
- Measurement Range : 0 – 65535 lx (Lux)
- Built-in 16 bit analog (Illuminance) to digital converter
- Module Size (L x W) : Approx. 3.26 cm x 1.51 cm
- I2C bus Interface ( f / s Mode Support, Slave Address : “0100011” )
- No calibration required.
- Measurement resolution : 1 lux
- IR radiation has very less effect on the measurements
- 50Hz/60Hz Light noise rejection function
- Operating temperature range : – 40°C to 85°C
- Spectral responsibility is approximately human eye response
- Light source dependency is little. (ex. Incandescent Lamp. Fluorescent Lamp. Halogen Lamp. White LED. Sun Light)
- Small measurement variation (+/- 15%)
GY-30 BH1750 Pin-out
Interface with Arduino
Arduino Code: To get Lux values on serial monitor
You have to installed required library to use this module’s output values easily in code. In Arduino IDE Menu, go to Sketch > Include Library > Manage libraries and search BH1750. You’ll get multiple libraries in list, we will use BH1750FVI by PeterEmbedded.
First, we will test the module and see the output values on Arduino IDE serial monitor, to ensure the connection & module functionality. Select your Arduino boards & port in Arduino IDE, Upload following code:
uint16_t lux = LightSensor.GetLightIntensity();
After uploading this code, you will see ambient light readings in Lux unit on serial monitor of Arduino IDE at every 1 seconds.
In further, you can refer 16×2 LCD interface tutorial & 128×64 Monochrome OLED tutorial to display Lux readings on LCDs to make it more attractive & user friendly. You can also make Photometer/Lightmeter using this module for photography purpose.
I hope you will learn to use BH1750/BH1750FVI module from this tutorial & it will be helpful to add ambient light intensity measurement in your DIY stuff. You can add this module various projects using where you need to control brightness of background LEDs or ambient light measurement is necessary, in future such projects will be uploaded in #BeatYourBit website. If you like this tutorial, share it with your friends & any Arduino newbie you know. Give your feedback about this tutorial in Contact, Your feedback will be appreciated.
Like/Follow @beatyourbit on Facebook, Twitter, Instagram & Telegram for latest updates.