BH1750 датчик внешней освещенности на плате  имеет 16-разрядный A2D встроенный конвертер, который может напрямую выводить цифровой сигнал. Датчик выдает значение в люксах (Лк) и не требует сложных расчетов в эскизе. Работа с BH1750 происходит с помощью протокола I2C.
Подключение
Начните с подключения радиол
 
| Сенсор | Arduino | Коментарий | 
| GND | GND | Черный | 
| VCC | VCC (3.3-5V) | Красный | 
| ADDR | GND | Черный | 
| SCL | A5(аналоговый вход) | Синий | 
| SDA | A4(аналоговый вход) | Зеленый | 
Пример
В этом примере используется внешняя библиотека BH1750. Пожалуйста, установите его и перезапустите среду разработки Arduino перед тем, как компилировать.
| 
					 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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87  | 
						/**  * The MySensors Arduino library handles the wireless radio link and protocol  * between your home built sensors/actuators and HA controller of choice.  * The sensors forms a self healing radio network with optional repeaters. Each  * repeater and gateway builds a routing tables in EEPROM which keeps track of the  * network topology allowing messages to be routed to nodes.  *  * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>  * Copyright (C) 2013-2015 Sensnology AB  * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors  *  * Documentation: http://www.mysensors.org  * Support Forum: http://forum.mysensors.org  *  * This program is free software; you can redistribute it and/or  * modify it under the terms of the GNU General Public License  * version 2 as published by the Free Software Foundation.  *  *******************************  *  * REVISION HISTORY  * Version 1.0 - idefix  *   * DESCRIPTION  * Arduino BH1750FVI Light sensor  * communicate using I2C Protocol  * this library enable 2 slave device addresses  * Main address  0x23  * secondary address 0x5C  * connect the sensor as follows :  *  *   VCC  >>> 5V  *   Gnd  >>> Gnd  *   ADDR >>> NC or GND    *   SCL  >>> A5  *   SDA  >>> A4  * https://www.mysensors.org/build/light-bh1750  */ // Enable debug prints to serial monitor #define MY_DEBUG  // Enable and select radio type attached #define MY_RADIO_RF24 //#define MY_RADIO_RFM69 #include <MySensors.h>   #include <BH1750.h> #include <Wire.h> #define CHILD_ID_LIGHT 0 unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds) BH1750 lightSensor; // V_LIGHT_LEVEL should only be used for uncalibrated light level 0-100%. // If your controller supports the new V_LEVEL variable, use this instead for // transmitting LUX light level. MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL); // MyMessage msg(CHILD_ID_LIGHT, V_LEVEL);   uint16_t lastlux; void setup()   {    lightSensor.begin(); } void presentation()  {   // Send the sketch version information to the gateway and Controller   sendSketchInfo("Light Lux Sensor", "1.0");   // Register all sensors to gateway (they will be created as child devices)   present(CHILD_ID_LIGHT, S_LIGHT_LEVEL); } void loop()       {        uint16_t lux = lightSensor.readLightLevel();// Get Lux value   Serial.println(lux);   if (lux != lastlux) {       send(msg.set(lux));       lastlux = lux;   }   sleep(SLEEP_TIME); }  | 
					
Документация
Перевёл Антон Вотчицев