{"id":3758,"date":"2025-05-30T11:15:08","date_gmt":"2025-05-30T11:15:08","guid":{"rendered":"https:\/\/iotthinghub.com\/?p=3758"},"modified":"2025-05-30T11:40:58","modified_gmt":"2025-05-30T11:40:58","slug":"esp01-bme280-sensor-data-update-google-sheet-live","status":"publish","type":"post","link":"https:\/\/iotthinghub.com\/?p=3758","title":{"rendered":"ESP01 BME280 Sensor Data Update: Google Sheet Live"},"content":{"rendered":"\n<p class=\"has-text-color has-link-color wp-elements-1 wp-block-paragraph\" style=\"color:#5c5c5c\">In our previous article we already show BME280 data on ThingSpeak Cloud. In this article we change some parameter to display data in Google Sheet along with OLED display. Google Sheets is a free, web-based spreadsheet application developed by Google, part of the Google Workspace suite (formerly G Suite). Launched in 2006, it has become a popular alternative to traditional spreadsheet programs like Microsoft Excel due to its accessibility, collaboration features, and integration capabilities.Key Features of Google Sheets:<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-2 wp-block-paragraph\" style=\"color:#5c5c5c\">Real-Time Collaboration: Multiple users can work on the same spreadsheet simultaneously, seeing each other&#8217;s changes instantly. This feature makes it ideal for teamwork, remote collaboration, and classroom projects.<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-3 wp-block-paragraph\" style=\"color:#5c5c5c\">Cloud Storage and Accessibility: Since Google Sheets operates in the cloud; all your spreadsheets are saved automatically to Google Drive. You can access your files from any device with an internet connection, whether it&#8217;s a computer, tablet, or smartphone.<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-4 wp-block-paragraph\" style=\"color:#5c5c5c\">Compatibility and Integration: Google Sheets seamlessly integrates with other Google services such as Google Forms, Google Docs, and Gmail. It also supports importing and exporting Excel files (.xls, .xlsx), making it easy to switch between platforms.<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-5 wp-block-paragraph\" style=\"color:#5c5c5c\">Powerful Functions and Formulas: Google Sheets offers a wide range of built-in functions for data analysis, including mathematical, statistical, financial, and logical operations. Users can create complex formulas to analyze data efficiently.<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-6 wp-block-paragraph\" style=\"color:#5c5c5c\">Add-ons and Extensions: Users can enhance functionality by installing add-ons from the Google Workspace Marketplace, such as data visualization tools, advanced formulas, or automation scripts.<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-7 wp-block-paragraph\" style=\"color:#5c5c5c\">Automation with Google Apps Script: For advanced users, Google Apps Script enables automation and customization of spreadsheets through JavaScript-based scripting.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"798\" height=\"487\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/BMP280-IC.jpg\" alt=\"\" class=\"wp-image-3735\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/BMP280-IC.jpg 798w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/BMP280-IC-300x183.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/BMP280-IC-768x469.jpg 768w\" sizes=\"(max-width: 798px) 100vw, 798px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"673\" height=\"348\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/BMP280-pin.jpg\" alt=\"\" class=\"wp-image-3736\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/BMP280-pin.jpg 673w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/BMP280-pin-300x155.jpg 300w\" sizes=\"(max-width: 673px) 100vw, 673px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-8 wp-block-paragraph\" style=\"color:#5c5c5c\">Now it times to download some driver for our project. Let\u2019s begin with some settings-&nbsp;<\/p>\n\n\n\n<ul style=\"color:#252525\" class=\"wp-block-list has-text-color has-link-color wp-elements-9\">\n<li>Install the latest version of Arduino : <a href=\"https:\/\/www.arduino.cc\/en\/software\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.arduino.cc\/en\/software\/<\/a><\/li>\n\n\n\n<li>In Arduino: File>Preferences>Setting : <a href=\"http:\/\/arduino.esp8266.com\/stable\/package_esp8266com_index.json\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/arduino.esp8266.com\/stable\/package_esp8266com_index.json<\/a><\/li>\n\n\n\n<li>In Arduino Install: Tools>Board>esp8266<\/li>\n\n\n\n<li>In Arduino: Tools>Board>esp8266>Generic ESP8266 Module<\/li>\n<\/ul>\n\n\n\n<ul style=\"color:#252525\" class=\"wp-block-list has-text-color has-link-color wp-elements-10\">\n<li>In Arduino Install: Library Manager\n<ul class=\"wp-block-list\">\n<li>Adafruit SSD1306<\/li>\n\n\n\n<li><span style=\"color: initial;\">Adafruit GFX Library<\/span><\/li>\n\n\n\n<li><span style=\"color: initial;\">Adafruit BusIO<\/span><\/li>\n\n\n\n<li>Adafruit BME280<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-11 wp-block-paragraph\" style=\"color:#5c5c5c\">Deploying a Google Sheet involves preparing, sharing, and managing access to ensure the spreadsheet is effectively used by intended users. The process can vary depending on the purpose\u2014whether for collaboration, embedding, or automation. For full process please see my YouTube video. Google Script Program-<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\nfunction doGet(e) {\n  var sheet = SpreadsheetApp.openById(&quot;Sheet_ID&quot;).getActiveSheet();\n  var temp = e.parameter.temp ;\n  var hum = e.parameter.hum ;\n  var press = e.parameter.press ;\n  var alt = e.parameter.alt ;\n  var heatIndex = e.parameter.hi ;\n  var Curr_Date = Utilities.formatDate(new Date(), &quot;GMT+6&quot;, &quot;yyyy-MM-dd&quot;);\n  var Curr_Time = Utilities.formatDate(new Date(), &quot;Asia\/Dhaka&quot;, &#039;HH:mm:ss&#039;); \/\/ Time in column B\n  sheet.appendRow(&#x5B;Curr_Date, Curr_Time,temp, hum, press, alt, heatIndex]);\n  return ContentService.createTextOutput(&quot;Success&quot;);\n}\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"951\" height=\"567\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/ESP8266-Project-3.jpg\" alt=\"\" class=\"wp-image-3750\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/ESP8266-Project-3.jpg 951w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/ESP8266-Project-3-300x179.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/05\/ESP8266-Project-3-768x458.jpg 768w\" sizes=\"(max-width: 951px) 100vw, 951px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-12 wp-block-paragraph\" style=\"color:#5c5c5c\">I live in Bangladesh so my Geographical Date &amp; Time is &#8211; &#8220;Asia\/Dhaka&#8221; &amp; &#8220;GMT+6&#8221;. Change according to your Geographical Date &amp; Time. In our entire previous articles we communicate through pipe line port:80 with HTTP protocol. But Google Sheets communicates over HTTPS (port 443), ensuring encrypted, secure data transfer. The platform employs SSL\/TLS certificates issued by trusted CAs to authenticate its servers and encrypt data. That\u2019s why Google Sheets can\u2019t operate in AT command mode. If you want to communicate Google Sheet in AT command mode with different microcontroller it will not work.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: arduino; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n#include &lt;ESP8266WiFi.h&gt;\n#include &lt;WiFiClientSecure.h&gt;\n\/\/ WiFi &amp; ThingSpeak\nconst char* ssid = &quot;Your_WiFi_Name&quot;;           \/\/ provide your WiFi Name\nconst char* password = &quot;Your_WiFi_Password&quot;;   \/\/ provide your WiFi Password\nconst char* host = &quot;script.google.com&quot;;        \/\/ URL\nconst int httpsPort = 443;                     \/\/ SSL Port\n\/\/ Change according to gogle script\nconst char* scriptPath = &quot;AKfycbyJUFW5Y-yGb5vgTeRG63zie2hreilg0GNRLha52TVwJNBJfX_yiI3gqOgzjVgj4CQ3&quot;;\n\/\/ Value to send Google sheet\n  WiFiClientSecure client;\n  client.setInsecure();  \/\/ Disable SSL certificate validation (easier for testing)\n  Serial.print(&quot;Connecting to &quot;);\n  Serial.println(host);\n  \/\/ Connecting to script.google.com with port 443\n  if (!client.connect(host, httpsPort)) {\n    Serial.println(&quot;Connection failed&quot;);\n    delay(10000);\n    return;\n  }\n String url = &quot;\/macros\/s\/&quot;+ String(scriptPath) + &quot;\/exec?temp=&quot; + tStr +\n               &quot;&amp;hum=&quot; + hStr +\n               &quot;&amp;press=&quot; + pStr +\n               &quot;&amp;alt=&quot; + aStr +\n               &quot;&amp;hi=&quot; + hiStr;\n\n  Serial.print(&quot;Requesting URL: &quot;);\n  Serial.println(url);\n\n  client.print(String(&quot;GET &quot;) + url + &quot; HTTP\/1.1\\r\\n&quot; +\n               &quot;Host: &quot; + host + &quot;\\r\\n&quot; +\n               &quot;Connection: close\\r\\n\\r\\n&quot;);\n\n  while (client.connected()) {\n    String line = client.readStringUntil(&#039;\\n&#039;);\n    Serial.println(line);\n    if (line == &quot;\\r&quot;) break;\n  }\n\n  String response = client.readString();\n  Serial.println(&quot;Response:&quot;);\n  Serial.println(response);\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-13 wp-block-paragraph\" style=\"color:#5c5c5c\">Other parameter such as BME280 reading &amp; OLED display is same as my previous article.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"\ud83c\udf10ESP-01( 8 pin MCU): BME280 Sensor Data Update on Google Sheet Live  \ud83d\udcf1 OLED Display\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/pWLJzGE9mVk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our previous article we already show BME280 data on ThingSpeak Cloud. In this article we change some parameter to display data in Google Sheet along with OLED display. Google Sheets is a free, web-based spreadsheet application developed by Google, part of the Google Workspace suite (formerly G Suite). Launched in 2006, it has become [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-3758","post","type-post","status-publish","format-standard","hentry","category-esp01esp8266"],"_links":{"self":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3758"}],"version-history":[{"count":9,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3758\/revisions"}],"predecessor-version":[{"id":3772,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3758\/revisions\/3772"}],"wp:attachment":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}