작은항해자의 항해

Light Intensity Sensor - BH1750FVI, GY-30 본문

IT 이야기/IOT 센서

Light Intensity Sensor - BH1750FVI, GY-30

작은항해자 2019. 1. 24. 09:55

Light Intensity Sensor - BH1750FVI, GY-30



BH1750FVI 조도센서 모듈

16Bit ADC 내장. 

센서의 조도 출력 값은 Lux로 출력이 되며, 마이크로컨트롤러와 I2C 인터페이스를 이용하여 측정된 조도값을 사용.

주소를 변경할 수 있다.

3.3V와 5V 시스템에서 사용 가능.

Light Range : 0 ~ 65535lx



Doc

 DataSheet : BH1750FVI.pdf

코드 라이브러리 : GitHubBH1750-master.zip

 메카솔루션 자료 : https://blog.naver.com/roboholic84/220581641047




Connections:

  • VCC -> 3V3 or 5V
  • GND -> GND
  • SCL -> SCL (A5 on Arduino Nano, Uno, Leonardo, etc or 21 on Mega and Due, on esp8266 free selectable)
  • SDA -> SDA (A4 on Arduino Nano, Uno, Leonardo, etc or 20 on Mega and Due, on esp8266 free selectable)
  • ADD -> NC/GND or VCC (see below)


Code

Upload the BH1750 test code to your Arduino.

#include <Wire.h>
#include <BH1750.h>

BH1750 lightMeter;

void setup(){

  Serial.begin(9600);

  // Initialize the I2C bus (BH1750 library doesn't do this automatically)
  // On esp8266 devices you can select SCL and SDA pins using Wire.begin(D4, D3);
  Wire.begin();

  lightMeter.begin();
  Serial.println(F("BH1750 Test"));

}

void loop() {

  float lux = lightMeter.readLightLevel();
  Serial.print("Light: ");
  Serial.print(lux);
  Serial.println(" lx");
  delay(1000);
 

} 


Output

Moving the sensor to face more light results in the lux measurements increasing.

BH1750 Test
Light: 70.0 lx
Light: 70.0 lx
Light: 59.0 lx
Light: 328.0 lx
Light: 333.0 lx
Light: 335.0 lx 





'IT 이야기 > IOT 센서' 카테고리의 다른 글

co2 농도의 영향도  (0) 2019.02.03
HS1101 습도센서  (0) 2019.01.24
8 Digit 7-Segment Display Module - MAX7219  (0) 2019.01.23
MH-Z14A CO2 Sensor  (0) 2019.01.21
MH-Z19 CO2 Sensor  (4) 2019.01.21