{"id":659,"date":"2011-03-19T16:27:16","date_gmt":"2011-03-19T21:27:16","guid":{"rendered":"http:\/\/nootropicdesign.com\/projectlab\/?p=659"},"modified":"2018-11-02T09:10:14","modified_gmt":"2018-11-02T14:10:14","slug":"digit-shield-temp-display","status":"publish","type":"post","link":"https:\/\/nootropicdesign.com\/projectlab\/2011\/03\/19\/digit-shield-temp-display\/","title":{"rendered":"Digit Shield Temperature Display"},"content":{"rendered":"<p><strong><em>Difficulty Level = 1<\/em><\/strong>  <a href=\"\/projectlab\/difficulty-levels\/\">[What&#8217;s this?]<\/a><\/p>\n<p>The <a href=\"\/digitshield\/\">Digit Shield<\/a> makes it trivial to add a numeric display to your project.  I&#8217;ve used my simple LM34 temperature sensor in many projects, but this is the simplest.  Here&#8217;s the LM34 sensor connected to analog input pin 0 on the Arduino, with the temperature displayed on the Digit Shield.<\/p>\n<p><a href=\"https:\/\/nootropicdesign.com\/projectlab\/wp-content\/uploads\/2011\/03\/temperatureSensor1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nootropicdesign.com\/projectlab\/wp-content\/uploads\/2011\/03\/temperatureSensor1.jpg\" alt=\"\" title=\"temperatureSensor1\" width=\"640\" height=\"480\" class=\"alignleft size-full wp-image-668\" srcset=\"https:\/\/nootropicdesign.com\/projectlab\/wp-content\/uploads\/2011\/03\/temperatureSensor1.jpg 640w, https:\/\/nootropicdesign.com\/projectlab\/wp-content\/uploads\/2011\/03\/temperatureSensor1-300x225.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><br \/>\n<br clear=\"all\"\/><br \/>\n<a href=\"https:\/\/nootropicdesign.com\/projectlab\/wp-content\/uploads\/2011\/03\/temperatureSensor2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nootropicdesign.com\/projectlab\/wp-content\/uploads\/2011\/03\/temperatureSensor2.jpg\" alt=\"\" title=\"temperatureSensor2\" width=\"640\" height=\"480\" class=\"alignleft size-full wp-image-669\" srcset=\"https:\/\/nootropicdesign.com\/projectlab\/wp-content\/uploads\/2011\/03\/temperatureSensor2.jpg 640w, https:\/\/nootropicdesign.com\/projectlab\/wp-content\/uploads\/2011\/03\/temperatureSensor2-300x225.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><br \/>\n<br clear=\"all\"\/><br \/>\nThe code reads the sensor value, translates to millivolts, and then translates to a temperature (the sensor outputs 10mV per Fahrenheit degree).  The Digit Shield library makes it so easy to display the temperature.  Here&#8217;s the entire Arduino sketch:<\/p>\n<pre class=\"codeblock\">\r\n#include <DigitShield.h>\r\n\r\nfloat AREF = 1.1;\r\n\r\nvoid setup() {\r\n  analogReference(INTERNAL);\r\n  DigitShield.begin();\r\n  DigitShield.setPrecision(1);\r\n}\r\n\r\nvoid loop() {\r\n  delay(500);\r\n  int r = analogRead(0);\r\n  int mv = (((float)r\/1023.0) * AREF) * 1000.0;\r\n  double t = mv \/ 10.0;\r\n  DigitShield.setValue(t);\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Difficulty Level = 1 [What&#8217;s this?] The Digit Shield makes it trivial to add a numeric display to your project. I&#8217;ve used my simple LM34 temperature sensor in many projects, but this is the simplest. Here&#8217;s the LM34 sensor connected to analog input pin 0 on the Arduino, with the temperature displayed on the Digit [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-659","post","type-post","status-publish","format-standard","hentry","category-arduino"],"_links":{"self":[{"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/posts\/659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/comments?post=659"}],"version-history":[{"count":9,"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/posts\/659\/revisions"}],"predecessor-version":[{"id":1957,"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/posts\/659\/revisions\/1957"}],"wp:attachment":[{"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/media?parent=659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/categories?post=659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nootropicdesign.com\/projectlab\/wp-json\/wp\/v2\/tags?post=659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}