The GY-30 BH1750FVI is a digital ambient light sensor that provides an accurate measurement of illumination intensity through an I2C interface. This sensor is widely used in applications where light levels need to be measured, such as in smartphones, lighting control systems, and digital cameras to adjust brightness.
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (2.4V to 3.6V) |
2 | GND | Ground |
3 | SCL | Serial Clock Line for I2C communication |
4 | SDA | Serial Data Line for I2C communication |
5 | ADDR | Address pin (floating, VCC or GND) |
0x23
, or VCC for address 0x5C
.#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup() {
Wire.begin();
Serial.begin(9600);
lightMeter.begin(BH1750::CONTINUOUS_HIGH_RES_MODE);
Serial.println(F("BH1750 Test"));
}
void loop() {
float lux = lightMeter.readLightLevel();
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lx");
delay(1000);
}
Q: Can the sensor be used with 5V systems? A: While the sensor operates at 2.4V to 3.6V, a level shifter is recommended for use with 5V systems.
Q: How can I change the I2C address of the sensor? A: The I2C address can be changed by connecting the ADDR pin to GND or VCC.
Q: Is it necessary to calibrate the sensor? A: The sensor comes pre-calibrated, but for precise applications, you may need to calibrate against a known light source.
Q: What is the maximum I2C speed supported by the sensor? A: The sensor supports I2C fast-mode, which can go up to 400 kHz.
Remember to always consult the sensor's datasheet for the most accurate and detailed information.