{"id":372,"date":"2017-06-14T06:48:08","date_gmt":"2017-06-14T13:48:08","guid":{"rendered":"http:\/\/www.kenwalger.com\/blog\/?p=372"},"modified":"2017-06-12T22:25:36","modified_gmt":"2017-06-13T05:25:36","slug":"micropython-temperature-sensor","status":"publish","type":"post","link":"https:\/\/www.kenwalger.com\/blog\/iot\/micropython\/micropython-temperature-sensor\/","title":{"rendered":"MicroPython Temperature Sensor"},"content":{"rendered":"<p>I&#8217;ve shown an example of the &#8220;Hello World&#8221; in IoT, a blinking light, in this <a href=\"http:\/\/www.kenwalger.com\/blog\/iot\/micropython-and-nodemcu-esp8266\/\">post<\/a>. Blinking lights are great and make for a nice visual experience, but what if we want to do something with an IoT device, such as a <a href=\"https:\/\/www.amazon.com\/gp\/product\/B01N0B48NI\/ref=as_li_tl?ie=UTF8&amp;amp;tag=kenwalgersite-20&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;linkCode=as2&amp;amp;creativeASIN=B01N0B48NI&amp;amp;linkId=dc1e9f82e2beb42bca36616a22b8820d\" target=\"_blank\" rel=\"noopener\">NodeMCU ESP8266<\/a>\u00a0that goes beyond the visual? Let&#8217;s take our NodeMCU and add a temperature sensor. Then, with <a href=\"http:\/\/www.micropython.org\" target=\"_blank\" rel=\"noopener\">MicroPython<\/a>, we&#8217;ll get our readings.<\/p>\n<h3>Needed Equipment<\/h3>\n<p>To get started on this project you&#8217;ll need the following equipment:<\/p>\n<ul>\n<li>NodeMCU ESP8266<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/gp\/product\/B011NEQ7J4\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B011NEQ7J4&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=c8ee5dcc279985c2897c08b0ef5a504f\" target=\"_blank\" rel=\"noopener\">TMP36 Analog<\/a><img loading=\"lazy\" decoding=\"async\" style=\"border: none !important; margin: 0px !important;\" src=\"\/\/ir-na.amazon-adsystem.com\/e\/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B011NEQ7J4\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/> Temperature Sensor<\/li>\n<li>Mini <a href=\"https:\/\/www.amazon.com\/gp\/product\/B0135IQ0ZC\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B0135IQ0ZC&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=bbc58c90bb19ac2c27c2637e36945ee1\" target=\"_blank\" rel=\"noopener\">Breadboard 5.5\u00d78.2\u00d70.85cm<\/a><img loading=\"lazy\" decoding=\"async\" style=\"border: none !important; margin: 0px !important;\" src=\"\/\/ir-na.amazon-adsystem.com\/e\/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B0135IQ0ZC\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/><\/li>\n<li><a href=\"https:\/\/www.amazon.com\/gp\/product\/B005TZJ0AM\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B005TZJ0AM&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=92661e6db23b8ee403829d8aa5dfb7ba\" target=\"_blank\" rel=\"noopener\">Male to Male Jumper Wires<\/a><img loading=\"lazy\" decoding=\"async\" style=\"border: none !important; margin: 0px !important;\" src=\"\/\/ir-na.amazon-adsystem.com\/e\/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B005TZJ0AM\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/><\/li>\n<\/ul>\n<p>I have found <a href=\"https:\/\/www.amazon.com\/gp\/product\/B01IH4VJRI\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B01IH4VJRI&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=3326e2a9ffcc5d2da8294511c4512f95\" target=\"_blank\" rel=\"noopener\">this kit<\/a><img loading=\"lazy\" decoding=\"async\" style=\"border: none !important; margin: 0px !important;\" src=\"\/\/ir-na.amazon-adsystem.com\/e\/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B01IH4VJRI\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/> of basic electronic components to be pretty good for starting one&#8217;s IoT device journey. It doesn&#8217;t include things like the TMP36 temperature sensor, but it has a wide variety of other pieces that are ultimately useful.<\/p>\n<h5>TMP36 Specs<\/h5>\n<p>Since this project will be using the TMP36, let&#8217;s discuss it briefly.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/TMP36-e1497222851900.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"375\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/iot\/micropython\/micropython-temperature-sensor\/attachment\/tmp36\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/TMP36-e1497222851900.jpg?fit=200%2C200&amp;ssl=1\" data-orig-size=\"200,200\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"TMP36\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/TMP36-e1497222851900.jpg?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/TMP36-e1497222851900.jpg?fit=200%2C200&amp;ssl=1\" class=\"size-full wp-image-375 aligncenter\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/TMP36-e1497222851900.jpg?resize=200%2C200\" alt=\"TMP36 Temperature Sensor\" width=\"200\" height=\"200\" \/><\/a><\/p>\n<p>This temperature sensor is a low voltage sensor, requiring 2.7 V to 5.5 VDC input. It returns a Celsius temperature reading from the Vout pin in an operating range of -40\u00b0C to +125\u00b0C. It is reasonably accurate, especially for hobby\/demo situations with a \u00b12\u00b0C accuracy. You can download the specs for the TMP36 <a href=\"http:\/\/kenwalger.com\/documents\/TMP35_36_37.pdf\">here<\/a>.<\/p>\n<h3>Temperature Sensor Project<\/h3>\n<h5>Hardware Configuration<\/h5>\n<p><span style=\"color: #ff0000;\">Make sure the NodeMCU is disconnected from USB when making connections.<\/span><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp-sensor-schematic.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"379\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/iot\/micropython\/micropython-temperature-sensor\/attachment\/temp-sensor-schematic\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp-sensor-schematic.png?fit=960%2C636&amp;ssl=1\" data-orig-size=\"960,636\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"temp-sensor-schematic\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp-sensor-schematic.png?fit=300%2C199&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp-sensor-schematic.png?fit=840%2C557&amp;ssl=1\" class=\"alignnone size-full wp-image-379\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp-sensor-schematic.png?resize=840%2C557\" alt=\"Temperature Sensor schematic\" width=\"840\" height=\"557\" srcset=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp-sensor-schematic.png?w=960&amp;ssl=1 960w, https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp-sensor-schematic.png?resize=300%2C199&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp-sensor-schematic.png?resize=768%2C509&amp;ssl=1 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<ol>\n<li>To add the TMP36 sensor to the NodeMCU we need to make sure that it is properly oriented. The flat side of the temperature sensor should be facing the bottom of the board.<\/li>\n<li>Connect the rightmost lead, in position a8 to the negative rail on the board.<\/li>\n<li>The negative rail then is connected to the GND pin (pin a29)on the NodeMCU.<\/li>\n<li>Connect the leftmost lead (a10) of the TMP36 to the positive rail.<\/li>\n<li>Connect the 3v3 pin (a30) on the NodeMCU to the positive rail.<\/li>\n<li>Finally, connect a jumper wire from the center lead (c9) to the A0 pin on the NodecMCU (j16).<\/li>\n<\/ol>\n<p><a href=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/bread_board.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"383\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/iot\/micropython\/micropython-temperature-sensor\/attachment\/bread_board\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/bread_board.png?fit=600%2C341&amp;ssl=1\" data-orig-size=\"600,341\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"bread_board\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/bread_board.png?fit=300%2C171&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/bread_board.png?fit=600%2C341&amp;ssl=1\" class=\"alignnone size-full wp-image-383\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/bread_board.png?resize=600%2C341\" alt=\"Temperature Sensor bread board\" width=\"600\" height=\"341\" srcset=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/bread_board.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/bread_board.png?resize=300%2C171&amp;ssl=1 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>The A0 pin on the NodeMCU is the analog-to-digital conversion (ADC) pin.<\/p>\n<h5>Code<\/h5>\n<p>With the hardware side of things built, let&#8217;s see what we can do in MicroPython to get a temperature! Fortunately, MicroPython&#8217;s <code>machine<\/code> library makes this pretty simple for us.<\/p>\n<p>I&#8217;ll be working in the console REPL. \u00a0The code should work the same, however, if you are working in the <a href=\"http:\/\/www.kenwalger.com\/blog\/iot\/micropython-webrepl-esp8266\/\">WebREPL<\/a> environment.<\/p>\n<p>Our first step is to handle our imports<\/p>\n<pre><code>from machine import ADC<\/code><\/pre>\n<p>That brings in our necessary ADC connections, and we can assign a variable to <code>pin 0<\/code> for that<\/p>\n<pre><code>adc = ADC(0)<\/code><\/pre>\n<p>We can print out the value from the TMP36 now with <code>adc.read()<\/code> which returns the Celsius temperature, well almost. The value it returns is ten times the temperature. Let&#8217;s write a function that will handle that conversion for us.<\/p>\n<pre><code>def temp(value):\n    return value\/10\n<\/code><\/pre>\n<p>While we&#8217;re at it, let&#8217;s write a function to convert to Fahrenheit as well.<\/p>\n<pre><code>def fahrenheit(celsius):\n    return (celsius * (9\/5)) + 32\n<\/code><\/pre>\n<p>With those in place, we can get, and display our readings.<\/p>\n<pre><code>reading = adc.read()\n\ncelsius_temp = temp(reading)\n\nfahrenheit_temp = fahrenheit(celsius_temp)\n\nprint(\"TMP36 reading {}\\nDegrees Celsius {}\\nDegrees Fahrenheit {}\".format(reading, celsius_temp, fahrenheit_temp))<\/code><\/pre>\n<p>After executing our print statement we should get back our readings. MicroPython certainly has made things easy for us with the ADC methods.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp_sensor_code.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"385\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/iot\/micropython\/micropython-temperature-sensor\/attachment\/temp_sensor_code\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp_sensor_code.png?fit=600%2C293&amp;ssl=1\" data-orig-size=\"600,293\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"temp_sensor_code\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp_sensor_code.png?fit=300%2C147&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp_sensor_code.png?fit=600%2C293&amp;ssl=1\" class=\"alignnone size-full wp-image-385\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp_sensor_code.png?resize=600%2C293\" alt=\"Temperature Sensor REPL\" width=\"600\" height=\"293\" srcset=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp_sensor_code.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/temp_sensor_code.png?resize=300%2C147&amp;ssl=1 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>For your convenience I have included the <a href=\"https:\/\/gist.github.com\/kenwalger\/f94dc82a2e797da372dcbae46fe78ddc\" target=\"_blank\" rel=\"noopener\">code is available<\/a> as a Gist on GitHub as well.<\/p>\n<h3>Wrap Up<\/h3>\n<p>In this post, I have shown how to get temperature readings from an analog temperature sensor, such as the TMP36. In just a few lines of MicroPython code, we are able to get quite a bit of functionality.\u00a0This is one of the many great things about MicroPython, the direct access to hardware is generally pretty easy.<\/p>\n<p>I think the next step in exploring MicroPython and the NodeMCU will be to take these temperature readings and see if we can connect them to a service such as <a href=\"https:\/\/www.losant.com\" target=\"_blank\" rel=\"noopener\">Losant<\/a> and generate some visualizations of our temperatures.<\/p>\n<hr \/>\n<p>Follow me on Twitter <a href=\"https:\/\/www.twitter.com\/kenwalger\" target=\"_blank\" rel=\"noopener\">@kenwalger<\/a> to get the latest updates on my postings on MicroPython and IoT and let me know what you are building with MicroPython.<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F372&#038;t=MicroPython%20Temperature%20Sensor&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F372&#038;p&#091;images&#093;&#091;0&#093;=https%3A%2F%2Fi0.wp.com%2Fwww.kenwalger.com%2Fblog%2Fwp-content%2Fuploads%2F2017%2F06%2Fmicropython-temp-sensor.png%3Ffit%3D125%252C125%26ssl%3D1&#038;p&#091;title&#093;=MicroPython%20Temperature%20Sensor\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/facebook.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F372&#038;text=Hey%20check%20this%20out\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/twitter.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-reddit nolightbox\" data-provider=\"reddit\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Reddit\" href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F372&#038;title=MicroPython%20Temperature%20Sensor\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"reddit\" title=\"Share on Reddit\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/reddit.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F372&#038;title=MicroPython%20Temperature%20Sensor\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/linkedin.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=MicroPython%20Temperature%20Sensor&#038;body=Hey%20check%20this%20out:%20https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F372\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/mail.png?resize=48%2C48&#038;ssl=1\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve shown an example of the &#8220;Hello World&#8221; in IoT, a blinking light, in this post. Blinking lights are great and make for a nice visual experience, but what if we want to do something with an IoT device, such as a NodeMCU ESP8266\u00a0that goes beyond the visual? Let&#8217;s take our NodeMCU and add a &hellip; <a href=\"https:\/\/www.kenwalger.com\/blog\/iot\/micropython\/micropython-temperature-sensor\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MicroPython Temperature Sensor&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":373,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28],"tags":[36,35,64],"yst_prominent_words":[463,467,457,466,255,397,257,465,248,239,1068,464,1347,468,460,458,461,455,1067,459],"class_list":["post-372","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-micropython","tag-esp8266","tag-nodemcu","tag-temperature-readings","pmpro-has-access"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/micropython-temp-sensor.png?fit=125%2C125&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8lx70-60","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/comments?post=372"}],"version-history":[{"count":6,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/372\/revisions"}],"predecessor-version":[{"id":386,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/372\/revisions\/386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media\/373"}],"wp:attachment":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media?parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/categories?post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/tags?post=372"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}