{"id":7558,"date":"2013-06-23T14:32:19","date_gmt":"2013-06-23T18:32:19","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=7558"},"modified":"2013-07-22T15:44:32","modified_gmt":"2013-07-22T19:44:32","slug":"building-a-simple-digital-light-meter-using-arduino-and-bh1750fvi-sensor","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/building-a-simple-digital-light-meter-using-arduino-and-bh1750fvi-sensor\/","title":{"rendered":"Building a simple digital light meter using Arduino and BH1750FVI sensor"},"content":{"rendered":"<p>A light meter is a device that measures the intensity of light. It finds applications in schools, hospitals, production areas, passageways and more to measure and maintain proper lighting levels. It is often used by photographers to determine the proper exposure for a photograph. Today we are going to build a simple light meter using an Arduino board and a BH1750 digital light sensor. The measured lighting level or intensity is displayed on eight seven segment LED displays, in both Lux and Foot-candle units.<\/p>\n<div id=\"attachment_7566\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterTitle2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7566\" class=\"size-full wp-image-7566\" title=\"DigitalLightMeterTitle2\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterTitle2.jpg\" alt=\"\" width=\"565\" height=\"373\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterTitle2.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterTitle2-550x363.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-7566\" class=\"wp-caption-text\">Digital Light Meter using Arduino and BH1750FVI sensor<\/p><\/div>\n<p><!--more--><\/p>\n<p><strong>Hardware<\/strong><\/p>\n<p>Shawon Shahryiar posted a project article before about <a href=\"http:\/\/embedded-lab.com\/blog\/?p=4330\" target=\"_blank\"><strong>making a lux meter using a simple LDR<\/strong><\/a>. His project used an inexpensive photo sensor to detect the light intensity. In order to convert the measured light intensity into Lux, he needed to calibrate the photo sensor first using an external reference photometer. This project is an improvement over that as it uses the <strong><a href=\"http:\/\/www.elecrow.com\/sensor-c-111\/light-sound-c-111_125\/digital-light-sensor-p-403.html\" target=\"_blank\">BH1750FVI sensor<\/a><\/strong> to measure the ambient lighting level. BH1750FVI is a calibrated digital light sensor IC that measures the incident light intensity and converts it into a 16-bit digital number. It can measure ambient light intensity ranging from 0 to 65535 Lux (L). The Lux is an SI unit for illuminance and is equal to one lumen per square meter. The BH1750FVI sensor directly gives output in Lux. The spectral response function of the sensor is approximately close to that of the human eye. The sensor output can be accessed through an I2C interface. The 7-bit I2C address is 0x23 if the ADDR pin is grounded, or 0x5C if ADDR is tied to VCC. In this project, I am using the <strong><a href=\"http:\/\/www.elecrow.com\/sensor-c-111\/light-sound-c-111_125\/digital-light-sensor-p-403.html\" target=\"_blank\">BH1750FVI sensor module from Elecrow<\/a><\/strong>.<\/p>\n<div id=\"attachment_7568\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/BH1750Sensor.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7568\" class=\"size-full wp-image-7568\" title=\"BH1750Sensor\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/BH1750Sensor.jpg\" alt=\"\" width=\"500\" height=\"410\" \/><\/a><p id=\"caption-attachment-7568\" class=\"wp-caption-text\">BH1750FVI sensor breakout board<\/p><\/div>\n<p>For the display part, I am using the <strong><a href=\"http:\/\/www.elecrow.com\/cooperated-designers-c-127\/embedded-lab-c-127_128\/8-digit-spi-seven-segment-led-display-yellow-p-432.html\" target=\"_blank\">SPI7SEGDISP8.56-1R module<\/a><\/strong>, which is an 8-digit serial seven segment LED display based on the MAX7219 IC. It requires only 3 I\/O pins and provides full control of all the LED segments. The Arduino board used in this project is called <strong><a href=\"http:\/\/www.elecrow.com\/arduino-compatiable-c-109\/micro-controller-c-109_117\/crowduino-with-atmega-328-p-338.html\" target=\"_blank\">Crowduino<\/a><\/strong>, which is 100% compatible with \u00a0Arduino Duemilanove. A tact switch connected to Digital Pin 2 (interrupt 0) of Crowduino is used as &#8216;Mode&#8217; select to toggle between Lux (L) and Foot-candle (Fc) units of display. The following picture shows the connections of the BH1750FVI sensor board, the SPI7SEGDISP8.56-1R display, and the tact switch to the Arduino board.<\/p>\n<div id=\"attachment_7570\" style=\"width: 569px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterCircuit.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7570\" class=\"size-full wp-image-7570\" title=\"DigitalLightMeterCircuit\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterCircuit.jpg\" alt=\"\" width=\"559\" height=\"572\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterCircuit.jpg 559w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterCircuit-550x562.jpg 550w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><\/a><p id=\"caption-attachment-7570\" class=\"wp-caption-text\">Sensor and display connections to Arduino board<\/p><\/div>\n<p>I have soldered the tact switch and the BH1750FVI sensor module on a general purpose prototyping board, which plugs onto the Crowduino board using male headers. An easier way to setup the hardware for this project would be to use an <strong><a href=\"http:\/\/www.elecrow.com\/arduino-compatiable-c-109\/shield-c-109_110\/proto-shield-for-arduino-p-336.html\" target=\"_blank\">Arduino prototyping shield<\/a>.<\/strong>\u00a0Since I didn&#8217;t have a spare proto shield, I made one by myself. The following picture shows the complete hardware setup for this project.<\/p>\n<div id=\"attachment_7564\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterSetup.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7564\" class=\"size-full wp-image-7564\" title=\"DigitalLightMeterSetup\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterSetup.jpg\" alt=\"\" width=\"565\" height=\"372\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterSetup.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterSetup-550x362.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-7564\" class=\"wp-caption-text\">Actual hardware setup of the Light meter<\/p><\/div>\n<p><strong>Software<\/strong><\/p>\n<p>The <strong><a href=\"http:\/\/arduino.cc\/playground\/Main\/LedControl\" target=\"_blank\">LedControl library<\/a><\/strong> allows you to easily interface MAX7219-driven seven segment LED displays to Arduino. Read my <strong><a href=\"http:\/\/embedded-lab.com\/blog\/?p=6862\" target=\"_blank\">tutorial post on MAX7219 and Arduino<\/a><\/strong> for more details on this. The sensor data is read using the <strong><a href=\"http:\/\/arduino.cc\/en\/reference\/wire\" target=\"_blank\">Wire library<\/a><\/strong>. The sensor is configured for a measurement resolution of 1 Lux. Read the <strong><a href=\"http:\/\/www.elechouse.com\/elechouse\/images\/product\/Digital%20light%20Sensor\/bh1750fvi-e.pdf\" target=\"_blank\">datasheet of BH1750FVI<\/a><\/strong> for more details about this sensor. The Mode tact switch operates in interrupt mode. When the power is first turned on, the light meter displays light intensity in Lux (L). The sensor can measure light intensity up to 65535 Lux. Pressing the Mode switch changes the unit of measurement to Foot-candle (Fc). The Mode switch is used to switch back and forth between Lux and Foot-candle units. Here is the complete Arduino sketch for this project. Note that you need to download the\u00a0<strong><a href=\"http:\/\/arduino.cc\/playground\/Main\/LedControl\" target=\"_blank\">LedControl library<\/a><\/strong>\u00a0and link to this project.<\/p>\n\n<div class=\"wp_syntax\"><table><tr><td class=\"code\"><pre class=\"c\" style=\"font-family:monospace;\"><span style=\"color: #808080; font-style: italic;\">\/*\n #######################################################\n Project: Arduino Light Meter\n Description: This project measures ambient light intensity and displays it on seven segment\n              LEDs in Lux or Foot Candel units. The BH1750 sensor is used for\n              measuring light intensity. \n Written by: Raj Bhatt (June 17, 2013)\n www.embedded-lab.com\n #######################################################\n&nbsp;\n BH1750 sensor module connections:\n -- -----------------------------------\n BH1750                        Arduino\n VCC      ---------------&gt;     5V\n SCL      ---------------&gt;     Analog pin 5 (A5)\n SDA      ---------------&gt;     Analog pin 4 (A4)\n ADD      ---------------&gt;     Leave it open\n GND      ---------------&gt;     GND\n #######################################################\n&nbsp;\n MAX7219 based LED display connections\n -------------------------------------\n MAX7219                       Arduino\n VCC      ---------------&gt;     5V\n DIN      ---------------&gt;     Digital Pin 7\n LOAD     ---------------&gt;     Digital Pin 6\n CLK      ---------------&gt;     Digital Pin 5\n GND      ---------------&gt;     GND\n&nbsp;\n This software is licensed under a \n Creative Commons Attribution-ShareAlike 3.0. \n *\/<\/span>\n&nbsp;\n&nbsp;\n<span style=\"color: #339933;\">#include &quot;Wire.h&quot; <\/span>\n<span style=\"color: #339933;\">#include &quot;math.h&quot;<\/span>\n<span style=\"color: #339933;\">#include &quot;LedControl.h&quot;<\/span>\n&nbsp;\n&nbsp;\nLedControl lc<span style=\"color: #339933;\">=<\/span>LedControl<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">7<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">5<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">6<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">1<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ Pin 7 to Data In, 5 to Clk, 6 to LOAD<\/span>\n<span style=\"color: #993333;\">int<\/span> BH1750_Device <span style=\"color: #339933;\">=<\/span> <span style=\"color: #208080;\">0x23<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ I2C address for light sensor<\/span>\n<span style=\"color: #993333;\">int<\/span> iCheck <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ iCheck = 0 for Lux, iCheck = 1 for Foot-Candles<\/span>\n<span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">int<\/span> Lux<span style=\"color: #339933;\">,<\/span> Scaled_FtCd<span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #993333;\">float<\/span> FtCd<span style=\"color: #339933;\">,<\/span> Wattsm2<span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #993333;\">int<\/span> IntPin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ Pin 2<\/span>\n<span style=\"color: #666666; font-style: italic;\">\/\/variables to keep track of the timing of recent interrupts<\/span>\n<span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">long<\/span> button_time <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>  \n<span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">long<\/span> last_button_time <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span> \n&nbsp;\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> setup<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span>\n<span style=\"color: #009900;\">&#123;<\/span>\n  Wire.<span style=\"color: #202020;\">begin<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Serial.<span style=\"color: #202020;\">begin<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">9600<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  lc.<span style=\"color: #202020;\">shutdown<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #666666; font-style: italic;\">\/\/ turn off power saving, enables display<\/span>\n  lc.<span style=\"color: #202020;\">setIntensity<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">12<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #666666; font-style: italic;\">\/\/ sets brightness (0~15 possible values)<\/span>\n  lc.<span style=\"color: #202020;\">clearDisplay<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #666666; font-style: italic;\">\/\/ clear screen<\/span>\n  Configure_BH1750<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  <span style=\"color: #666666; font-style: italic;\">\/\/Attach the interrupt to the input pin and monitor for ANY Change<\/span>\n  attachInterrupt<span style=\"color: #009900;\">&#40;<\/span>IntPin<span style=\"color: #339933;\">,<\/span> stateChange<span style=\"color: #339933;\">,<\/span> FALLING<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  delay<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">300<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> loop<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span>\n<span style=\"color: #009900;\">&#123;<\/span>\n  <span style=\"color: #993333;\">int<\/span> i<span style=\"color: #339933;\">;<\/span>\n  Lux <span style=\"color: #339933;\">=<\/span> BH1750_Read<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  FtCd <span style=\"color: #339933;\">=<\/span> Lux<span style=\"color: #339933;\">\/<\/span><span style=\"color:#800080;\">10.764<\/span><span style=\"color: #339933;\">;<\/span>\n  Wattsm2 <span style=\"color: #339933;\">=<\/span> Lux<span style=\"color: #339933;\">\/<\/span><span style=\"color:#800080;\">683.0<\/span><span style=\"color: #339933;\">;<\/span>\n  Serial.<span style=\"color: #202020;\">print<\/span><span style=\"color: #009900;\">&#40;<\/span>Lux<span style=\"color: #339933;\">,<\/span>DEC<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>     \n  Serial.<span style=\"color: #202020;\">println<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #ff0000;\">&quot;[lx]&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> \n  Serial.<span style=\"color: #202020;\">print<\/span><span style=\"color: #009900;\">&#40;<\/span>FtCd<span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">2<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>     \n  Serial.<span style=\"color: #202020;\">println<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #ff0000;\">&quot;[FC]&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Serial.<span style=\"color: #202020;\">print<\/span><span style=\"color: #009900;\">&#40;<\/span>Wattsm2<span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">4<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>     \n  Serial.<span style=\"color: #202020;\">println<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #ff0000;\">&quot;[Watts\/m^2]&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> \n  delay<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">1000<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Disp_Data<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> \n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">int<\/span> BH1750_Read<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/<\/span>\n<span style=\"color: #009900;\">&#123;<\/span>\n  <span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">int<\/span> i<span style=\"color: #339933;\">=<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>\n  Wire.<span style=\"color: #202020;\">beginTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span>BH1750_Device<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Wire.<span style=\"color: #202020;\">requestFrom<\/span><span style=\"color: #009900;\">&#40;<\/span>BH1750_Device<span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">2<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  <span style=\"color: #b1b100;\">while<\/span><span style=\"color: #009900;\">&#40;<\/span>Wire.<span style=\"color: #202020;\">available<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/<\/span>\n  <span style=\"color: #009900;\">&#123;<\/span>\n    i <span style=\"color: #339933;\">&lt;&lt;=<\/span><span style=\"color: #0000dd;\">8<\/span><span style=\"color: #339933;\">;<\/span>\n    i<span style=\"color: #339933;\">|=<\/span> Wire.<span style=\"color: #202020;\">read<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>  \n  <span style=\"color: #009900;\">&#125;<\/span>\n  Wire.<span style=\"color: #202020;\">endTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>  \n  <span style=\"color: #b1b100;\">return<\/span> i<span style=\"color: #339933;\">\/<\/span><span style=\"color:#800080;\">1.2<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ Convert to Lux<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> Disp_Data<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span>\n  <span style=\"color: #993333;\">int<\/span> ones<span style=\"color: #339933;\">,<\/span> tens<span style=\"color: #339933;\">,<\/span> hundreds<span style=\"color: #339933;\">,<\/span> thousands<span style=\"color: #339933;\">,<\/span> ten_thousands<span style=\"color: #339933;\">;<\/span>\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>iCheck <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span>\n    ones <span style=\"color: #339933;\">=<\/span> Lux<span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    tens <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span>Lux<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">10<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    hundreds <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span>Lux<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">100<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    thousands <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span>Lux<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">1000<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    ten_thousands <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span>Lux<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">10000<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>ten_thousands <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span> lc.<span style=\"color: #202020;\">setChar<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">7<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #ff0000;\">' '<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #b1b100;\">else<\/span> lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">7<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>ten_thousands<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n    <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>ten_thousands <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span> <span style=\"color: #339933;\">&amp;&amp;<\/span> thousands <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span> lc.<span style=\"color: #202020;\">setChar<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">6<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #ff0000;\">' '<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #b1b100;\">else<\/span> lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">6<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>thousands<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n    <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>ten_thousands <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span> <span style=\"color: #339933;\">&amp;&amp;<\/span> thousands <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span> <span style=\"color: #339933;\">&amp;&amp;<\/span> hundreds <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span>\n    lc.<span style=\"color: #202020;\">setChar<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">5<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #ff0000;\">' '<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #b1b100;\">else<\/span> lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">5<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>hundreds<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n    <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>ten_thousands <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span> <span style=\"color: #339933;\">&amp;&amp;<\/span> thousands <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span> <span style=\"color: #339933;\">&amp;&amp;<\/span> hundreds <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span> \n    <span style=\"color: #339933;\">&amp;&amp;<\/span> hundreds <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span> <span style=\"color: #339933;\">&amp;&amp;<\/span> tens<span style=\"color: #339933;\">==<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span> \n    lc.<span style=\"color: #202020;\">setChar<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">4<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #ff0000;\">' '<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #b1b100;\">else<\/span> lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">4<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>tens<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">3<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>ones<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    lc.<span style=\"color: #202020;\">setChar<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #ff0000;\">'L'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    lc.<span style=\"color: #202020;\">setChar<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #ff0000;\">' '<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n <span style=\"color: #009900;\">&#125;<\/span>\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>iCheck <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span>\n&nbsp;\n    Scaled_FtCd <span style=\"color: #339933;\">=<\/span> FtCd<span style=\"color: #339933;\">*<\/span><span style=\"color: #0000dd;\">1000<\/span><span style=\"color: #339933;\">;<\/span>\n    ones <span style=\"color: #339933;\">=<\/span> Scaled_FtCd<span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    tens <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span>Scaled_FtCd<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">10<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    hundreds <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span>Scaled_FtCd<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">100<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    thousands <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span>Scaled_FtCd<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">1000<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    ten_thousands <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span>Scaled_FtCd<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">10000<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>ten_thousands <span style=\"color: #339933;\">==<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span> lc.<span style=\"color: #202020;\">setChar<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">7<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #ff0000;\">' '<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #b1b100;\">else<\/span> lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">7<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>ten_thousands<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n    lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">6<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>thousands<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">true<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">5<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>hundreds<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">4<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>tens<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">3<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span>ones<span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    lc.<span style=\"color: #202020;\">setChar<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #ff0000;\">'F'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    lc.<span style=\"color: #202020;\">setChar<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #ff0000;\">'C'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  <span style=\"color: #009900;\">&#125;<\/span> \n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> stateChange<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span>\n<span style=\"color: #009900;\">&#123;<\/span>\n button_time <span style=\"color: #339933;\">=<\/span> millis<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n <span style=\"color: #b1b100;\">if<\/span> <span style=\"color: #009900;\">&#40;<\/span>button_time <span style=\"color: #339933;\">-<\/span> last_button_time <span style=\"color: #339933;\">&gt;<\/span> <span style=\"color: #0000dd;\">250<\/span><span style=\"color: #009900;\">&#41;<\/span>\n <span style=\"color: #009900;\">&#123;<\/span>\n   iCheck <span style=\"color: #339933;\">=<\/span> <span style=\"color: #339933;\">!<\/span>iCheck<span style=\"color: #339933;\">;<\/span>\n   Disp_Data<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n   last_button_time <span style=\"color: #339933;\">=<\/span> button_time<span style=\"color: #339933;\">;<\/span>\n <span style=\"color: #009900;\">&#125;<\/span> \n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> Configure_BH1750<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span> \n<span style=\"color: #009900;\">&#123;<\/span>\n  Wire.<span style=\"color: #202020;\">beginTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span>BH1750_Device<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Wire.<span style=\"color: #202020;\">write<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x10<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>      <span style=\"color: #666666; font-style: italic;\">\/\/ Set resolution to 1 Lux<\/span>\n  Wire.<span style=\"color: #202020;\">endTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span><\/pre><\/td><\/tr><\/table><\/div>\n\n<p><strong><a href=\"http:\/\/embedded-lab.com\/uploads\/Misc\/BH1750_Based_Light_Meter.zip\">Download Sketch and LedControl library<\/a><\/strong><\/p>\n<p><strong>Output<\/strong><\/p>\n<p>The sensor should be faced directly toward the light source that is to be measured. The measurement and display is refreshed every 1 second. The default unit of display is Lux. Press the Mode switch to toggle between the two units. The following pictures show how the light meter data is displayed in both the units.<\/p>\n<div id=\"attachment_7577\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterOP1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7577\" class=\"size-full wp-image-7577\" title=\"DigitalLightMeterOP1\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterOP1.jpg\" alt=\"\" width=\"565\" height=\"363\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterOP1.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterOP1-550x353.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-7577\" class=\"wp-caption-text\">Light meter displaying light intensity in Foot-candles<\/p><\/div>\n<div id=\"attachment_7578\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterOP2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7578\" class=\"size-full wp-image-7578\" title=\"DigitalLightMeterOP2\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterOP2.jpg\" alt=\"\" width=\"565\" height=\"365\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterOP2.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/06\/DigitalLightMeterOP2-550x355.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-7578\" class=\"wp-caption-text\">Light meter displaying light amount in Lux<\/p><\/div>\n<p>Read this <strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Lux\" target=\"_blank\">Wikipedia page<\/a><\/strong> for some examples of average luminance under various light conditions.<\/p>\n<p><strong>List of parts used in this project<\/strong><br \/>\n1. <a href=\"http:\/\/www.elecrow.com\/arduino-compatiable-c-109\/micro-controller-c-109_117\/crowduino-with-atmega-328-v11-p-338.html\" target=\"_blank\">Crowduino Board <\/a><br \/>\n2. <a href=\"http:\/\/www.elecrow.com\/sensor-c-111\/light-sound-c-111_125\/digital-light-sensor-p-403.html\" target=\"_blank\">BH1750 sensor module<\/a><br \/>\n3. <a href=\"http:\/\/www.elecrow.com\/cooperated-designers-c-127\/embedded-lab-c-127_128\/8-digit-spi-seven-segment-led-display-yellow-p-432.html\" target=\"_blank\">SPI7SEGDISP8.56-1R<\/a> serial seven segment LED display board<br \/>\n4. A Tact switch, resistor, headers, wires, and a prototyping board (preferably proto-shield)  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A light meter is a device that measures the intensity of light. It finds applications in schools, hospitals, production areas, passageways and more to measure and maintain proper lighting levels. It is often used by photographers to determine the proper exposure for a photograph. Today we are going to build a simple light meter using an Arduino board and a BH1750 digital light sensor. The measured lighting level or intensity is displayed on eight seven segment LED displays, in both Lux and Foot-candle units.<\/p>\n","protected":false},"author":1,"featured_media":7561,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[150,245],"tags":[571,570,398],"class_list":["post-7558","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-2","category-embedded-lab-projects","tag-bh1750fvi","tag-light-intensity-meter","tag-lux-meter"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/7558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=7558"}],"version-history":[{"count":20,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/7558\/revisions"}],"predecessor-version":[{"id":7626,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/7558\/revisions\/7626"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/7561"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=7558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=7558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=7558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}