The BH1750 IC is a digital Ambient light sensor IC that drives on i2c / IIC bus interface. It is possible to detect wide range at high resolution rated to 1 – 65535 LUX. Mostly used in Mobile Phone, LCD TV, PC, Portable game machine, Digital Camera, Video Camera, PDA, LCD Display, Other Device that detect lights.
Required Components
- Arduino, Teensy, STM Microcontrollers
- BH1752 16Bit i2C Sensor
- HC06 Bluetooth Module or Similar
- Android Application
- Solder Less Bread Board
- Jumper Wire / DuPont Wire
Wiring Guide
(UUID – 00001101-0000-1000-8000-00805F9B34FB)
Android App
https://play.google.com/store/apps/details?id=com.a14core.luxmeter
Sketch Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
#include <Wire.h> int lxAddr = 0x23; byte buff[2]; void setup() { Wire.begin(); BH750_Init(lxAddr); Serial.begin(9600); delay(200); } void loop() { light(); } void light(){ float valf=0; if (BH1750_Read(lxAddr)==2){ valf=((buff[0]<<8)|buff[1])/1.2; if (valf<0)Serial.println("65535"); else Serial.println((int)valf,DEC); } delay(500); } void BH750_Init(int address){ Wire.beginTransmission(address); Wire.write(0x10); Wire.endTransmission(); } byte BH1750_Read(int address){ byte i=0; Wire.beginTransmission(address); Wire.requestFrom(address, 2); while(Wire.available()){ buff[i] = Wire.read(); i++; } Wire.endTransmission(); return i; } |
Downloads
- Download the BH1750 Datasheet | Pdf
Android LUX Meter with HC06 Bluetooth Module & Microcontroller