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
코드 라이브러리 : GitHub , BH1750-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.
|