{"id":5506,"date":"2023-02-04T13:13:47","date_gmt":"2023-02-04T13:13:47","guid":{"rendered":"https:\/\/www.andrewhope.co.uk\/Blog\/?p=5506"},"modified":"2023-02-04T13:18:36","modified_gmt":"2023-02-04T13:18:36","slug":"bh1750-lightmeter-for-home-weather-station","status":"publish","type":"post","link":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/","title":{"rendered":"BH1750 Lightmeter for Home Weather Station"},"content":{"rendered":"<div>\n<p>Another sensor to add to the collection for my Home Weather Station project. I&#8217;m adding a Lux level sensor so that I can record the Lux levels thorughout the day. Not sure what for yet, perhaps for some automated sensors, or just to add to it. The more sensors the merrier I say. The better the readings and the more data you can log<\/p>\n<h2>What code am I using?<\/h2>\n<p>This is the code I&#8217;m using on my ESP8266 mini. I&#8217;m switching because my Arduino Nano doesn&#8217;t have built in WiFi and this device is more powerful and supports Arduino<\/p>\n<p>&nbsp;<\/p>\n<p>#include &lt;BH1750.h&gt;<\/p><\/div>\n<div>#include &lt;Wire.h&gt;<\/div>\n<div>BH1750 lightMeter;<\/div>\n<div>void setup() {<\/div>\n<div>\u00a0 Serial.begin(115200);<\/div>\n<div>\u00a0 \/\/ Initialize the I2C bus (BH1750 library doesn&#8217;t do this automatically)<\/div>\n<div>\u00a0 Wire.begin();<\/div>\n<div>\u00a0 \/\/ On esp8266 you can select SCL and SDA pins using Wire.begin(D4, D3);<\/div>\n<div>\u00a0 \/\/ For Wemos \/ Lolin D1 Mini Pro and the Ambient Light shield use<\/div>\n<div>\u00a0 \/\/ Wire.begin(D2, D1);<\/div>\n<div>\u00a0 lightMeter.begin();<\/div>\n<div>\u00a0 Serial.println(F(&#8220;BH1750 Test begin&#8221;));<\/div>\n<div>}<\/div>\n<div>void loop() {<\/div>\n<div>\u00a0 float lux = lightMeter.readLightLevel();<\/div>\n<div>\u00a0 Serial.print(&#8220;Light: &#8220;);<\/div>\n<div>\u00a0 Serial.print(lux);<\/div>\n<div>\u00a0 Serial.println(&#8221; lx&#8221;);<\/div>\n<div>\u00a0 delay(500);<\/div>\n<div>}<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Another sensor to add to the collection for my Home Weather Station project. I&#8217;m adding a Lux level sensor so [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":"","_links_to":"","_links_to_target":""},"categories":[928,1256],"tags":[1801,1799,1800],"class_list":["post-5506","post","type-post","status-publish","format-standard","hentry","category-projects","category-science-and-technology","tag-bh1750-sensor","tag-home-weather-station","tag-weather-station-sensors"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Another sensor to add to the collection for my Home Weather Station project. I&#039;m adding a Lux level sensor so that I can record the Lux levels thorughout the day. Not sure what for yet, perhaps for some automated sensors, or just to add to it. The more sensors the merrier I say. The better\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"admin\"\/>\n\t<meta name=\"msvalidate.01\" content=\"95C2F67592576EDF87B6C4B9774D0014\" \/>\n\t<meta name=\"keywords\" content=\"bh1750 sensor,home weather station,weather station sensors,projects,science and technology\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/bh1750-lightmeter-for-home-weather-station\\\/#article\",\"name\":\"BH1750 Lightmeter for Home Weather Station | Andrew Hope\",\"headline\":\"BH1750 Lightmeter for Home Weather Station\",\"author\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#person\"},\"datePublished\":\"2023-02-04T13:13:47+00:00\",\"dateModified\":\"2023-02-04T13:18:36+00:00\",\"inLanguage\":\"en-GB\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/bh1750-lightmeter-for-home-weather-station\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/bh1750-lightmeter-for-home-weather-station\\\/#webpage\"},\"articleSection\":\"Projects, Science and Technology, bh1750 sensor, home weather station, weather station sensors\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/bh1750-lightmeter-for-home-weather-station\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/category\\\/projects\\\/#listItem\",\"name\":\"Projects\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/category\\\/projects\\\/#listItem\",\"position\":2,\"name\":\"Projects\",\"item\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/category\\\/projects\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/bh1750-lightmeter-for-home-weather-station\\\/#listItem\",\"name\":\"BH1750 Lightmeter for Home Weather Station\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/bh1750-lightmeter-for-home-weather-station\\\/#listItem\",\"position\":3,\"name\":\"BH1750 Lightmeter for Home Weather Station\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/category\\\/projects\\\/#listItem\",\"name\":\"Projects\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#person\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/\",\"name\":\"admin\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/bh1750-lightmeter-for-home-weather-station\\\/#webpage\",\"url\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/bh1750-lightmeter-for-home-weather-station\\\/\",\"name\":\"BH1750 Lightmeter for Home Weather Station | Andrew Hope\",\"description\":\"Another sensor to add to the collection for my Home Weather Station project. I'm adding a Lux level sensor so that I can record the Lux levels thorughout the day. Not sure what for yet, perhaps for some automated sensors, or just to add to it. The more sensors the merrier I say. The better\",\"inLanguage\":\"en-GB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/bh1750-lightmeter-for-home-weather-station\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2023-02-04T13:13:47+00:00\",\"dateModified\":\"2023-02-04T13:18:36+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#website\",\"url\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/\",\"name\":\"Andrew Hope\",\"description\":\"DIY, Gaming, Automotive Chat and Invention\",\"inLanguage\":\"en-GB\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"BH1750 Lightmeter for Home Weather Station | Andrew Hope","description":"Another sensor to add to the collection for my Home Weather Station project. I'm adding a Lux level sensor so that I can record the Lux levels thorughout the day. Not sure what for yet, perhaps for some automated sensors, or just to add to it. The more sensors the merrier I say. The better","canonical_url":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/","robots":"max-image-preview:large","keywords":"bh1750 sensor,home weather station,weather station sensors,projects,science and technology","webmasterTools":{"msvalidate.01":"95C2F67592576EDF87B6C4B9774D0014","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/#article","name":"BH1750 Lightmeter for Home Weather Station | Andrew Hope","headline":"BH1750 Lightmeter for Home Weather Station","author":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#person"},"datePublished":"2023-02-04T13:13:47+00:00","dateModified":"2023-02-04T13:18:36+00:00","inLanguage":"en-GB","mainEntityOfPage":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/#webpage"},"isPartOf":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/#webpage"},"articleSection":"Projects, Science and Technology, bh1750 sensor, home weather station, weather station sensors"},{"@type":"BreadcrumbList","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog#listItem","position":1,"name":"Home","item":"https:\/\/www.andrewhope.co.uk\/Blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/projects\/#listItem","name":"Projects"}},{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/projects\/#listItem","position":2,"name":"Projects","item":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/projects\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/#listItem","name":"BH1750 Lightmeter for Home Weather Station"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/#listItem","position":3,"name":"BH1750 Lightmeter for Home Weather Station","previousItem":{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/projects\/#listItem","name":"Projects"}}]},{"@type":"Person","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#person"},{"@type":"Person","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/#author","url":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/","name":"admin"},{"@type":"WebPage","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/#webpage","url":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/","name":"BH1750 Lightmeter for Home Weather Station | Andrew Hope","description":"Another sensor to add to the collection for my Home Weather Station project. I'm adding a Lux level sensor so that I can record the Lux levels thorughout the day. Not sure what for yet, perhaps for some automated sensors, or just to add to it. The more sensors the merrier I say. The better","inLanguage":"en-GB","isPartOf":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/#breadcrumblist"},"author":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/#author"},"datePublished":"2023-02-04T13:13:47+00:00","dateModified":"2023-02-04T13:18:36+00:00"},{"@type":"WebSite","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#website","url":"https:\/\/www.andrewhope.co.uk\/Blog\/","name":"Andrew Hope","description":"DIY, Gaming, Automotive Chat and Invention","inLanguage":"en-GB","publisher":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#person"}}]}},"aioseo_meta_data":{"post_id":"5506","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-02-04 13:12:38","updated":"2025-06-05 00:38:24","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.andrewhope.co.uk\/Blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.andrewhope.co.uk\/Blog\/category\/projects\/\" title=\"Projects\">Projects<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tBH1750 Lightmeter for Home Weather Station\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.andrewhope.co.uk\/Blog"},{"label":"Projects","link":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/projects\/"},{"label":"BH1750 Lightmeter for Home Weather Station","link":"https:\/\/www.andrewhope.co.uk\/Blog\/bh1750-lightmeter-for-home-weather-station\/"}],"views":69,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/posts\/5506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/comments?post=5506"}],"version-history":[{"count":0,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/posts\/5506\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/media?parent=5506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/categories?post=5506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/tags?post=5506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}