Ks0278 keyestudio BH1750FVI Digital Light Intensity Module: Difference between revisions
Jump to navigation
Jump to search
Keyestudio (talk | contribs) (Created page with "==Keyestudio BH1750FVI Digital Light Intensity Module == ==Introduction== Keyestudio BH1750FVI digital light intensity module is a digital light intensity sensor integrated ci...") |
Keyestudio (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
==Keyestudio BH1750FVI Digital Light Intensity Module == | ==Keyestudio BH1750FVI Digital Light Intensity Module == | ||
==Introduction== | ==Introduction== | ||
Keyestudio BH1750FVI digital light intensity module is a digital light intensity sensor integrated circuit used for two-wire serial bus interface. It uses the light intensity data collected by module to adjust the brightness of LCD and keyboard backlight. The module resolution can detect a wide range of light intensity changes. | Keyestudio BH1750FVI digital light intensity module is a digital light intensity sensor integrated circuit used for two-wire serial bus interface. It uses the light intensity data collected by module to adjust the brightness of LCD and keyboard backlight. The module resolution can detect a wide range of light intensity changes. | ||
Line 12: | Line 13: | ||
* Weak dependency on light source: incandescent, fluorescent, halogen, white LED and fluorescent is available. | * Weak dependency on light source: incandescent, fluorescent, halogen, white LED and fluorescent is available. | ||
==Connection Diagram == | |||
<br>[[File:KS0278-2.png|500px|frameless|thumb]]<br> | |||
== Sample Code == | |||
<pre> | |||
/* | |||
Measurement of illuminance using the BH1750FVI sensor module | |||
Connection: | |||
Module UNO | |||
G <-----> GND | |||
V <-----> 5V | |||
SDA <-----> A4 | |||
SCL <-----> A5 | |||
*/ | |||
#include <Wire.h> | |||
#define ADDRESS_BH1750FVI 0x23 //ADDR="L" for this module | |||
#define ONE_TIME_H_RESOLUTION_MODE 0x20 | |||
//One Time H-Resolution Mode: | |||
//Resolution = 1 lux | |||
//Measurement time (max.) = 180ms | |||
//Power down after each measurement | |||
byte highByte = 0; | |||
byte lowByte = 0; | |||
unsigned int sensorOut = 0; | |||
unsigned int illuminance = 0; | |||
void setup() | |||
{ | |||
Wire.begin(); | |||
Serial.begin(115200); | |||
} | |||
void loop() | |||
{ | |||
Wire.beginTransmission(ADDRESS_BH1750FVI); //"notify" the matching device | |||
Wire.write(ONE_TIME_H_RESOLUTION_MODE); //set operation mode | |||
Wire.endTransmission(); | |||
delay(180); | |||
Wire.requestFrom(ADDRESS_BH1750FVI, 2); //ask Arduino to read back 2 bytes from the sensor | |||
highByte = Wire.read(); // get the high byte | |||
lowByte = Wire.read(); // get the low byte | |||
sensorOut = (highByte<<8)|lowByte; | |||
illuminance = sensorOut/1.2; | |||
Serial.print(illuminance); Serial.println(" lux"); | |||
delay(1000); | |||
} | |||
</pre> | |||
== Test Result == | |||
According to the light intensity, the value will make a corresponding change. The light is strong, the value is large; otherwise, the value is small. Open the serial monitor and set the baud rate of 115200, as the figure shown below: | |||
<br>[[File:KS0278-3.png|500px|frameless|thumb]]<br> | |||
==Resource== | ==Resource== | ||
'''Datasheet:''' | '''Datasheet:''' | ||
http://www.keyestudio.com/files/index/download/id/1501555671/ | http://www.keyestudio.com/files/index/download/id/1501555671/ | ||
<br> | |||
'''Get libraries of Wire''' <br> | |||
http://www.keyestudio.com/files/index/download/id/1505114355/ | |||
==Buy from == | ==Buy from == |
Revision as of 09:09, 15 September 2017
Keyestudio BH1750FVI Digital Light Intensity Module
Introduction
Keyestudio BH1750FVI digital light intensity module is a digital light intensity sensor integrated circuit used for two-wire serial bus interface. It uses the light intensity data collected by module to adjust the brightness of LCD and keyboard backlight. The module resolution can detect a wide range of light intensity changes.
thumb
Specification
- Diameter 26mm, large diameter 28.5mm, high 26mm (plus light ball)
- Working voltage: DC 5V
- Communication interface: IIC
- Input light range: 1-65535lx
- Spectral sensitivity: typical value of peak sensitivity wavelength: 560nm
- Weak dependency on light source: incandescent, fluorescent, halogen, white LED and fluorescent is available.
Connection Diagram
Sample Code
/* Measurement of illuminance using the BH1750FVI sensor module Connection: Module UNO G <-----> GND V <-----> 5V SDA <-----> A4 SCL <-----> A5 */ #include <Wire.h> #define ADDRESS_BH1750FVI 0x23 //ADDR="L" for this module #define ONE_TIME_H_RESOLUTION_MODE 0x20 //One Time H-Resolution Mode: //Resolution = 1 lux //Measurement time (max.) = 180ms //Power down after each measurement byte highByte = 0; byte lowByte = 0; unsigned int sensorOut = 0; unsigned int illuminance = 0; void setup() { Wire.begin(); Serial.begin(115200); } void loop() { Wire.beginTransmission(ADDRESS_BH1750FVI); //"notify" the matching device Wire.write(ONE_TIME_H_RESOLUTION_MODE); //set operation mode Wire.endTransmission(); delay(180); Wire.requestFrom(ADDRESS_BH1750FVI, 2); //ask Arduino to read back 2 bytes from the sensor highByte = Wire.read(); // get the high byte lowByte = Wire.read(); // get the low byte sensorOut = (highByte<<8)|lowByte; illuminance = sensorOut/1.2; Serial.print(illuminance); Serial.println(" lux"); delay(1000); }
Test Result
According to the light intensity, the value will make a corresponding change. The light is strong, the value is large; otherwise, the value is small. Open the serial monitor and set the baud rate of 115200, as the figure shown below:
Resource
Datasheet:
http://www.keyestudio.com/files/index/download/id/1501555671/
Get libraries of Wire
http://www.keyestudio.com/files/index/download/id/1505114355/