{"id":136524,"date":"2024-09-24T14:37:27","date_gmt":"2024-09-24T09:07:27","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?page_id=136524"},"modified":"2024-09-24T14:37:28","modified_gmt":"2024-09-24T09:07:28","slug":"light-sensor-bh1750-and-bmp180-barometric-sensor-operations","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/","title":{"rendered":"Light Sensor BH1750 and BMP180 Barometric Sensor Operations"},"content":{"rendered":"\n<p>The BH1750 and BMP180 are popular sensors used to measure light intensity and atmospheric pressure, respectively. By combining these sensors with Arduino, you can create projects that monitor environmental conditions and respond to changes in light and pressure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>BH1750 Light Sensor<\/strong><\/h2>\n\n\n\n<p>The BH1750 is a digital light sensor that provides precise measurements of ambient light intensity. It offers a wide measurement range and high sensitivity, making it suitable for various applications.<\/p>\n\n\n\n<p><strong>Hardware Setup<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Connect the VCC pin of the BH1750 to the 5V pin on the Arduino.<\/li>\n\n\n\n<li>Connect the GND pin of the BH1750 to the ground pin on the Arduino.<\/li>\n\n\n\n<li>Connect the SCL pin of the BH1750 to the SCL pin on the Arduino.<\/li>\n\n\n\n<li>Connect the SDA pin of the BH1750 to the SDA pin on the Arduino.<\/li>\n<\/ul>\n\n\n\n<p><strong>Arduino Code<\/strong><\/p>\n\n\n\n<p>C++<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#<strong>include<\/strong> &lt;Wire.h&gt;\n\n#<strong>define<\/strong> BH1750_ADDRESS 0x23\n\nvoid setup() {\n  Wire.begin();\n}\n\nvoid loop() {\n  Wire.beginTransmission(BH1750_ADDRESS);\n  Wire.write(0x10); \/\/ Power-on mode\n  Wire.endTransmission();\n\n  delay(180);\n\n  Wire.beginTransmission(BH1750_ADDRESS);\n  Wire.write(0x12); \/\/ Read high\/low byte data\n  Wire.endTransmission(false);\n\n  uint16_t data = Wire.read() &lt;&lt; 8 | Wire.read();\n\n  float lux = (data * 1.2) \/ 1.05;\n\n  Serial.print(\"Light intensity: \");\n  Serial.print(lux);\n  Serial.println(\" lux\");\n\n  delay(1000);\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>BMP180 Barometric Sensor<\/strong><\/h2>\n\n\n\n<p>The BMP180 is a digital barometric pressure sensor that provides accurate measurements of atmospheric pressure. It can also be used to calculate altitude and temperature.<\/p>\n\n\n\n<p><strong>Hardware Setup<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Connect the VCC pin of the BMP180 to the 5V pin on the Arduino.<\/li>\n\n\n\n<li>Connect the GND pin of the BMP180 to the ground pin on the Arduino.<\/li>\n\n\n\n<li>Connect the SCL pin of the BMP180 to the SCL pin on the Arduino.<\/li>\n\n\n\n<li>Connect the SDA pin of the BMP180 to the SDA pin on the Arduino.<\/li>\n<\/ul>\n\n\n\n<p><strong>Arduino Code<\/strong><\/p>\n\n\n\n<p>C++<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#<strong>include<\/strong> &lt;Wire.h&gt;\n#<strong>include<\/strong> &lt;Adafruit_BMP085.h&gt;\n\nAdafruit_BMP085 bmp;\n\nvoid setup() {\n  Wire.begin();\n  if (!bmp.begin()) {\n    Serial.println(\"Could not find BMP085 sensor, check wiring.\");\n    while (1);\n  }\n}\n\nvoid loop() {\n  float temperature = bmp.readTemperature();\n  float pressure = bmp.readPressure();\n  float altitude = bmp.readAltitude(SEALEVELPRESSURE_HPA);\n\n  Serial.print(\"Temperature: \");\n  Serial.print(temperature);\n  Serial.println(\" \u00b0C\");\n\n  Serial.print(\"Pressure: \");\n  Serial.print(pressure);\n  Serial.println(\" &nbsp;  Pa\");\n\n  Serial.print(\"Altitude: \");\n  Serial.print(altitude);\n  Serial.println(\" &nbsp;  m\");\n\n  delay(1000);\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The BH1750 and BMP180 are popular sensors used to measure light intensity and atmospheric pressure, respectively. By combining these sensors with Arduino, you can create projects that monitor environmental conditions and respond to changes in light and pressure. BH1750 Light Sensor The BH1750 is a digital light sensor that provides precise measurements of ambient light&#8230;<\/p>\n","protected":false},"author":16,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-136524","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Light Sensor BH1750 and BMP180 Barometric Sensor Operations - Tutorial<\/title>\n<meta name=\"description\" content=\"Discover the operation of the BH1750 light sensor and BMP180 barometric sensor, and learn how to integrate them into your Arduino projects.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Light Sensor BH1750 and BMP180 Barometric Sensor Operations - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Discover the operation of the BH1750 light sensor and BMP180 barometric sensor, and learn how to integrate them into your Arduino projects.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-24T09:07:28+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/\",\"name\":\"Light Sensor BH1750 and BMP180 Barometric Sensor Operations - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2024-09-24T09:07:27+00:00\",\"dateModified\":\"2024-09-24T09:07:28+00:00\",\"description\":\"Discover the operation of the BH1750 light sensor and BMP180 barometric sensor, and learn how to integrate them into your Arduino projects.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Light Sensor BH1750 and BMP180 Barometric Sensor Operations\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Light Sensor BH1750 and BMP180 Barometric Sensor Operations - Tutorial","description":"Discover the operation of the BH1750 light sensor and BMP180 barometric sensor, and learn how to integrate them into your Arduino projects.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/","og_locale":"en_US","og_type":"article","og_title":"Light Sensor BH1750 and BMP180 Barometric Sensor Operations - Tutorial","og_description":"Discover the operation of the BH1750 light sensor and BMP180 barometric sensor, and learn how to integrate them into your Arduino projects.","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-09-24T09:07:28+00:00","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/","name":"Light Sensor BH1750 and BMP180 Barometric Sensor Operations - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2024-09-24T09:07:27+00:00","dateModified":"2024-09-24T09:07:28+00:00","description":"Discover the operation of the BH1750 light sensor and BMP180 barometric sensor, and learn how to integrate them into your Arduino projects.","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/light-sensor-bh1750-and-bmp180-barometric-sensor-operations\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Light Sensor BH1750 and BMP180 Barometric Sensor Operations"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/136524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=136524"}],"version-history":[{"count":1,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/136524\/revisions"}],"predecessor-version":[{"id":136529,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/136524\/revisions\/136529"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=136524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=136524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=136524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}