{"id":324,"date":"2017-12-11T22:50:42","date_gmt":"2017-12-11T22:50:42","guid":{"rendered":"http:\/\/ketandesai.co.uk\/?p=324"},"modified":"2026-03-22T17:07:21","modified_gmt":"2026-03-22T17:07:21","slug":"simple-temperature-monitor-esp2866","status":"publish","type":"post","link":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/","title":{"rendered":"Simple Temperature Monitor ESP2866"},"content":{"rendered":"\n<p>This is a simple temperature sensor i am working on based on the <a href=\"http:\/\/amzn.to\/2nS7fiB\">ESP2866<\/a><\/p>\n\n\n\n<p>For some reason i can&#8217;t get the \u00b0 Degree Symbol to work. i assume i have the wrong ASCII character<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#FFFFFF\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/  \n\/\/  Node MCU Simple Temperature Monitor \n\/\/\n\/\/  Author Ketan Desai\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/  Include library \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include &lt;OneWire.h>\n#include &lt;ESP8266WiFi.h>\n#include &lt;DallasTemperature.h>\n#include &lt;SPI.h>\n#include &lt;Wire.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/  Define Data Pins  \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define ONE_WIRE_BUS D3\n#define OLED_RESET LED_BUILTIN  \/\/4\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/  variable definition  \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nString temperatureString;\n\n\/\/Wifi Details\nconst char* ssid = \"Wifi_SSID\";\nconst char* pass = \"PASSWORD\";\n \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/  Declare Objects  \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature DS18B20(&amp;oneWire);\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/  Setup  \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup(void){\n  Serial.begin(115200);\n  Serial.println(\"\");\n  \n  WiFi.begin(ssid, pass);\n  \/\/ Wait for connection\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(100);\n    Serial.print(\".\");\n  }\n  \n  Serial.println(\"\");\n  Serial.print(\"Connected to \");\n  Serial.println(ssid);\n  Serial.print(\"IP address: \");\n  Serial.println(WiFi.localIP());\n\n  DS18B20.begin();\n\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/  Functions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid RequestTemperature() \n  {\n    DS18B20.requestTemperatures();\n    temperatureString = String (DS18B20.getTempCByIndex(0));\n  }\n\nvoid DisplayTemp ()\n  {\n   Serial.println(\"\");\n   Serial.print(temperatureString);\n   Serial.print((char)248);\n   Serial.print(\"C\");\n  }\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/  Main Program Loop \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop()\n  {\n  RequestTemperature();\n  DisplayTemp();\n  \/\/delay(300000);\n  delay(10000);\n  }<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  <\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  Node MCU Simple Temperature Monitor <\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  Author Ketan Desai<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  Include library \/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">#include &lt;OneWire.h&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">#include &lt;ESP8266WiFi.h&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">#include &lt;DallasTemperature.h&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">#include &lt;SPI.h&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">#include &lt;Wire.h&gt;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  Define Data Pins  \/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">#define <\/span><span style=\"color: #001080\">ONE_WIRE_BUS<\/span><span style=\"color: #0000FF\"> D3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">#define <\/span><span style=\"color: #001080\">OLED_RESET<\/span><span style=\"color: #0000FF\"> LED_BUILTIN  <\/span><span style=\"color: #008000\">\/\/4<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  variable definition  \/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">String temperatureString;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/Wifi Details<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">const<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">char<\/span><span style=\"color: #000000\">* <\/span><span style=\"color: #001080\">ssid<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #A31515\">&quot;Wifi_SSID&quot;<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">const<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">char<\/span><span style=\"color: #000000\">* <\/span><span style=\"color: #001080\">pass<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #A31515\">&quot;PASSWORD&quot;<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  Declare Objects  \/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #267F99\">OneWire<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">oneWire<\/span><span style=\"color: #000000\">(ONE_WIRE_BUS);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #267F99\">DallasTemperature<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">DS18B20<\/span><span style=\"color: #000000\">(&amp;oneWire);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  Setup  \/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">void<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">setup<\/span><span style=\"color: #000000\">(void){<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">begin<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #098658\">115200<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">println<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;&quot;<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">WiFi<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">begin<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">ssid<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #001080\">pass<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">  \/\/ Wait for connection<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #AF00DB\">while<\/span><span style=\"color: #000000\"> (<\/span><span style=\"color: #001080\">WiFi<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">status<\/span><span style=\"color: #000000\">() != <\/span><span style=\"color: #001080\">WL_CONNECTED<\/span><span style=\"color: #000000\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #795E26\">delay<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #098658\">100<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">print<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;.&quot;<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">println<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;&quot;<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">print<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;Connected to &quot;<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">println<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">ssid<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">print<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;IP address: &quot;<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">println<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">WiFi<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">localIP<\/span><span style=\"color: #000000\">());<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">DS18B20<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">begin<\/span><span style=\"color: #000000\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  Functions \/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">void<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">RequestTemperature<\/span><span style=\"color: #000000\">() <\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #001080\">DS18B20<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">requestTemperatures<\/span><span style=\"color: #000000\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #001080\">temperatureString<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #795E26\">String<\/span><span style=\"color: #000000\"> (<\/span><span style=\"color: #001080\">DS18B20<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">getTempCByIndex<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">));<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  }<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">void<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">DisplayTemp<\/span><span style=\"color: #000000\"> ()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">   <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">println<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;&quot;<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">   <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">print<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">temperatureString<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">   <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">print<\/span><span style=\"color: #000000\">((<\/span><span style=\"color: #0000FF\">char<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #098658\">248<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">   <\/span><span style=\"color: #001080\">Serial<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">print<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;C&quot;<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  }<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/  Main Program Loop \/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">void<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">loop<\/span><span style=\"color: #000000\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #795E26\">RequestTemperature<\/span><span style=\"color: #000000\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #795E26\">DisplayTemp<\/span><span style=\"color: #000000\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #008000\">  \/\/delay(300000);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #795E26\">delay<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #098658\">10000<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  }<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is a simple temperature sensor i am working on based on the ESP2866 For some reason i can&#8217;t get the \u00b0 Degree Symbol to work. i assume i have the wrong ASCII character<\/p>\n","protected":false},"author":1,"featured_media":1089,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[112,113,50],"tags":[110,111,114],"class_list":["post-324","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microcontroller","category-nodemcu-esp8266","category-projects","tag-ds18b20","tag-esp2866","tag-temperature"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Simple Temperature Monitor ESP2866 - Ketan Desai<\/title>\n<meta name=\"description\" content=\"Simple Temperature Monitor ESP2866\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Simple Temperature Monitor ESP2866 - Ketan Desai\" \/>\n<meta property=\"og:description\" content=\"Simple Temperature Monitor ESP2866\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/\" \/>\n<meta property=\"og:site_name\" content=\"Ketan Desai\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-11T22:50:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-22T17:07:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ketandesai.co.uk\/wp-content\/uploads\/2017\/12\/esp8266.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ketan Desai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ketan Desai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/\"},\"author\":{\"name\":\"Ketan Desai\",\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/#\\\/schema\\\/person\\\/76fbe7aaa79643c166c5c2475fc01424\"},\"headline\":\"Simple Temperature Monitor ESP2866\",\"datePublished\":\"2017-12-11T22:50:42+00:00\",\"dateModified\":\"2026-03-22T17:07:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/\"},\"wordCount\":38,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/#\\\/schema\\\/person\\\/76fbe7aaa79643c166c5c2475fc01424\"},\"image\":{\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ketandesai.co.uk\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/esp8266.png\",\"keywords\":[\"DS18B20\",\"ESP2866\",\"Temperature\"],\"articleSection\":[\"Microcontroller\",\"NodeMCU (ESP8266)\",\"Projects\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/\",\"url\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/\",\"name\":\"Simple Temperature Monitor ESP2866 - Ketan Desai\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ketandesai.co.uk\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/esp8266.png\",\"datePublished\":\"2017-12-11T22:50:42+00:00\",\"dateModified\":\"2026-03-22T17:07:21+00:00\",\"description\":\"Simple Temperature Monitor ESP2866\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ketandesai.co.uk\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/esp8266.png\",\"contentUrl\":\"https:\\\/\\\/ketandesai.co.uk\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/esp8266.png\",\"width\":1024,\"height\":768},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/2017\\\/12\\\/11\\\/simple-temperature-monitor-esp2866\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ketandesai.co.uk\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Simple Temperature Monitor ESP2866\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/#website\",\"url\":\"https:\\\/\\\/ketandesai.co.uk\\\/\",\"name\":\"Ketan Desai\",\"description\":\"Anything IT\",\"publisher\":{\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/#\\\/schema\\\/person\\\/76fbe7aaa79643c166c5c2475fc01424\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ketandesai.co.uk\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/ketandesai.co.uk\\\/#\\\/schema\\\/person\\\/76fbe7aaa79643c166c5c2475fc01424\",\"name\":\"Ketan Desai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6587572e3884edb2f25ce127069b15f15da32278153bc9b4d2568156fcb6ec41?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6587572e3884edb2f25ce127069b15f15da32278153bc9b4d2568156fcb6ec41?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6587572e3884edb2f25ce127069b15f15da32278153bc9b4d2568156fcb6ec41?s=96&d=mm&r=g\",\"caption\":\"Ketan Desai\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6587572e3884edb2f25ce127069b15f15da32278153bc9b4d2568156fcb6ec41?s=96&d=mm&r=g\"},\"sameAs\":[\"http:\\\/\\\/staging.ketandesai.co.uk\"],\"url\":\"https:\\\/\\\/ketandesai.co.uk\\\/index.php\\\/author\\\/ketandesaiadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Simple Temperature Monitor ESP2866 - Ketan Desai","description":"Simple Temperature Monitor ESP2866","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:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/","og_locale":"en_GB","og_type":"article","og_title":"Simple Temperature Monitor ESP2866 - Ketan Desai","og_description":"Simple Temperature Monitor ESP2866","og_url":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/","og_site_name":"Ketan Desai","article_published_time":"2017-12-11T22:50:42+00:00","article_modified_time":"2026-03-22T17:07:21+00:00","og_image":[{"width":1024,"height":768,"url":"https:\/\/ketandesai.co.uk\/wp-content\/uploads\/2017\/12\/esp8266.png","type":"image\/png"}],"author":"Ketan Desai","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ketan Desai","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/#article","isPartOf":{"@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/"},"author":{"name":"Ketan Desai","@id":"https:\/\/ketandesai.co.uk\/#\/schema\/person\/76fbe7aaa79643c166c5c2475fc01424"},"headline":"Simple Temperature Monitor ESP2866","datePublished":"2017-12-11T22:50:42+00:00","dateModified":"2026-03-22T17:07:21+00:00","mainEntityOfPage":{"@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/"},"wordCount":38,"commentCount":0,"publisher":{"@id":"https:\/\/ketandesai.co.uk\/#\/schema\/person\/76fbe7aaa79643c166c5c2475fc01424"},"image":{"@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/#primaryimage"},"thumbnailUrl":"https:\/\/ketandesai.co.uk\/wp-content\/uploads\/2017\/12\/esp8266.png","keywords":["DS18B20","ESP2866","Temperature"],"articleSection":["Microcontroller","NodeMCU (ESP8266)","Projects"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/","url":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/","name":"Simple Temperature Monitor ESP2866 - Ketan Desai","isPartOf":{"@id":"https:\/\/ketandesai.co.uk\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/#primaryimage"},"image":{"@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/#primaryimage"},"thumbnailUrl":"https:\/\/ketandesai.co.uk\/wp-content\/uploads\/2017\/12\/esp8266.png","datePublished":"2017-12-11T22:50:42+00:00","dateModified":"2026-03-22T17:07:21+00:00","description":"Simple Temperature Monitor ESP2866","breadcrumb":{"@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/#primaryimage","url":"https:\/\/ketandesai.co.uk\/wp-content\/uploads\/2017\/12\/esp8266.png","contentUrl":"https:\/\/ketandesai.co.uk\/wp-content\/uploads\/2017\/12\/esp8266.png","width":1024,"height":768},{"@type":"BreadcrumbList","@id":"https:\/\/ketandesai.co.uk\/index.php\/2017\/12\/11\/simple-temperature-monitor-esp2866\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ketandesai.co.uk\/"},{"@type":"ListItem","position":2,"name":"Simple Temperature Monitor ESP2866"}]},{"@type":"WebSite","@id":"https:\/\/ketandesai.co.uk\/#website","url":"https:\/\/ketandesai.co.uk\/","name":"Ketan Desai","description":"Anything IT","publisher":{"@id":"https:\/\/ketandesai.co.uk\/#\/schema\/person\/76fbe7aaa79643c166c5c2475fc01424"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ketandesai.co.uk\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/ketandesai.co.uk\/#\/schema\/person\/76fbe7aaa79643c166c5c2475fc01424","name":"Ketan Desai","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/6587572e3884edb2f25ce127069b15f15da32278153bc9b4d2568156fcb6ec41?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6587572e3884edb2f25ce127069b15f15da32278153bc9b4d2568156fcb6ec41?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6587572e3884edb2f25ce127069b15f15da32278153bc9b4d2568156fcb6ec41?s=96&d=mm&r=g","caption":"Ketan Desai"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/6587572e3884edb2f25ce127069b15f15da32278153bc9b4d2568156fcb6ec41?s=96&d=mm&r=g"},"sameAs":["http:\/\/staging.ketandesai.co.uk"],"url":"https:\/\/ketandesai.co.uk\/index.php\/author\/ketandesaiadmin\/"}]}},"jetpack_featured_media_url":"https:\/\/ketandesai.co.uk\/wp-content\/uploads\/2017\/12\/esp8266.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=324"}],"version-history":[{"count":1,"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/324\/revisions"}],"predecessor-version":[{"id":1090,"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/324\/revisions\/1090"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/media\/1089"}],"wp:attachment":[{"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ketandesai.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}