This is a BH1750FVI light intensity sensor module with built-in a 16 bit AD converter generating digital signal. The data from this module is light intensity in lx (lux meter). It communicate with micro-controller board through I2C bus.
Features
- working Voltage: 3.3V~5V
- I2C bus Interface with 2 alternative address (f/s Mode Support)
- Spectral is approximately human eye response
- Wide range and High resolution (1 ~ 65535 lx)
- Light source dependency is little. (ex. Incandescent Lamp. Fluorescent Lamp. Halogen Lamp. White LED. Sun Light)
- Adjustable measurement result for influence of optical window (It is possible to detect min. 0.11 lx, max. 100000 lx by using this function.) (1 ~ 65535 lx)
- The influence of infrared is very small.
- Small measurement variation (+/- 20%)
note to connect the address pin to GND to set the I2C address to 0100011
/* Sample code for the BH1750 Light sensor Connection: VCC-5v GND-GND SCL-SCL(analog pin 5) SDA-SDA(analog pin 4) ADD-NC or GND */ #include Wire.h //BH1750 IIC Mode #include math.h int BH1750address = 0x23; //setting i2c address byte buff[2]; void setup() { Wire.begin(); Serial.begin(57600);//init Serail band rate } void loop() { int i; uint16_t val=0; BH1750_Init(BH1750address); delay(200); if(2==BH1750_Read(BH1750address)) { val=((buff[0]<<8)|buff[1])/1.2; Serial.print(val,DEC); Serial.println("[lx]"); } delay(150); } int BH1750_Read(int address) // { int i=0; Wire.beginTransmission(address); Wire.requestFrom(address, 2); while(Wire.available()) // { buff[i] = Wire.read(); // receive one byte i++; } Wire.endTransmission(); return i; } void BH1750_Init(int address) { Wire.beginTransmission(address); Wire.write(0x10);//1lx reolution 120ms Wire.endTransmission(); }