Hi All.
I am using a BH1750 sensor with my Weather station, to measure Light Levels in Lux/Lumens. The sensor can read the light level in my study and display a number on the LCD screen. Lets say 9500 lux for an example, the problem i am having is that sensor carries on reading 9500 even when the light is switched of, here is my Sketch. Thanks for looking.
// BH1750 Lux Meter
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <BH1750.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address for a 20 chars and 4 line display
BH1750 lightMeter;
void setup ()
{
lcd.init();
lcd.setBacklight (HIGH);
lcd.begin(20,4);// Initialize LCD
lightMeter.begin();// Initialize the BH1750
}
void loop ()
{
uint16_t lux = lightMeter.readLightLevel();
// Displays the information on the LCD
lcd.setCursor(0,3);
lcd.print("Lux :");
lcd.setCursor(6,3);
lcd.print(lux);
delay (1000);
}