{"id":780,"date":"2016-01-04T15:43:03","date_gmt":"2016-01-04T13:43:03","guid":{"rendered":"http:\/\/dety.net.ua\/?p=780"},"modified":"2016-01-04T15:43:03","modified_gmt":"2016-01-04T13:43:03","slug":"serial-port-temperature-sensors-windows","status":"publish","type":"post","link":"https:\/\/dety.net.ua\/?p=780","title":{"rendered":"Serial Port Temperature Sensors + Windows"},"content":{"rendered":"<p>Copy-pasted from here: <a href=\"http:\/\/martybugs.net\/electronics\/tempsensor\/software2.cgi\" target=\"_blank\">http:\/\/martybugs.net\/electronics\/tempsensor\/software2.cgi<\/a><\/p>\n<p><span class=\"subheading\">Overview<\/span><br \/>\nOn linux, the <a href=\"http:\/\/martybugs.net\/electronics\/tempsensor\/software.cgi\"><b>digitemp<\/b><\/a> application is required to query the temperature sensor.<\/p>\n<p>There are various software applications that allow DS18S20 temperature sensors to be queried in Windows, but the easiest is the Windows port of <b>digitemp<\/b>.<\/p>\n<p><span class=\"subheading\">Installing digitemp<\/span><\/p>\n<p>Download <a href=\"http:\/\/www.digitemp.com\/software\/windows\/dtreg17.zip\">digitemp for Windows<\/a>, and extract <span class=\"code\">digitemp.exe<\/span> from the zip file.<\/p>\n<p>Note that you&#8217;ll need the version suitable for the DS9097 serial port adapter (ie, digitemp 1.x), as the <a href=\"http:\/\/martybugs.net\/electronics\/tempsensor\/hardware.cgi\">serial port interface circuit<\/a> described previously is equivalent to the DS9097U 1-wire serial port adapter.<\/p>\n<p><span class=\"subheading\">Configuring digitemp<\/span><\/p>\n<p><b>Initialise digitemp<\/b><br \/>\nFirst we need to configure the interface by telling digitemp the serial port that the interface is connected to.<br \/>\nBy default, digitemp will look for a configuration file (<span class=\"code\">digitemp.cfg<\/span>) in the current working directory, so we&#8217;ll explicitly specify the location of the configuration file.<\/p>\n<p>Assuming the interface is connected to COM1:<\/p>\n<pre class=\"codeblock\">  digitemp -i -s1 -q -cc:\\temp\\digitemp.cfg\r\n<\/pre>\n<p>You should see output similar to this:<\/p>\n<pre class=\"codeblock\">  Turning off all DS2409 Couplers\r\n  .\r\n  Searching the 1-Wire LAN\r\n  100486B60008009E : DS1820\/DS18S20\/DS1920 Temperature Sensor\r\n  ROM #0 : 100486B60008009E\r\n<\/pre>\n<p>This will create a file <span class=\"code\">c:\\temp\\digitemp.cfg<\/span> containing the configuration information for digitemp.<\/p>\n<p><b>Adjust Read Delay<\/b><br \/>\nNote that the DS18S20 temperature sensor has a slightly slower response time (to convert its reading to a temperature) than the original DS1820 sensor The DS18S20 sensor takes approx 750ms to do the temperature conversion, and digitemp defaults to a 1000ms read delay.<\/p>\n<p>If you are occasionally getting temperature readings of 85 degrees Celsius (which is the sensor&#8217;s error code), you&#8217;ll need to slow down the read delay performed by digitemp from the default 1000ms.<\/p>\n<p>To set the read delay to 2000ms and store this configuration in <span class=\"code\">c:\\temp\\digitemp.cfg<\/span>, run the following:<\/p>\n<pre class=\"codeblock\">  digitemp -i -q <b>-r2000<\/b> -cc:\\temp\\digitemp.cfg\r\n<\/pre>\n<p>With relatively short wire runs between the sensor and the serial interface circuit, I&#8217;ve found that the default read delay of 1000ms provides reliable temperature readings.<\/p>\n<p><span class=\"subheading\">Reading Temperatures<\/span><\/p>\n<p><b>Query Temperature<\/b><br \/>\nThe sensor can now be queried for the current temperature (the &#8220;<span class=\"code\">-a<\/span>&#8221; tells digitemp to read all connected sensors):<\/p>\n<pre class=\"codeblock\">  digitemp <b>-a<\/b> -q -cc:\\temp\\digitemp.cfg\r\n<\/pre>\n<p>and output similar to this should be displayed:<\/p>\n<pre class=\"codeblock\">  Apr 17 23:09:56 Sensor 0 C: 26.69 F: 80.04\r\n<\/pre>\n<p><b>Handling Errors<\/b><br \/>\nNote that occasionally the DS18S20 temperature sensor will return an error code, returning a value of 85 degrees Celsius, instead of a valid temperature reading. If this occurs, re-reading the temperature will normally return the correct value.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Copy-pasted from here: http:\/\/martybugs.net\/electronics\/tempsensor\/software2.cgi Overview On linux, the digitemp application is required to query the temperature sensor. There are various software applications that allow DS18S20 temperature sensors to be queried in Windows, but the easiest is the Windows port of digitemp. Installing digitemp Download digitemp for Windows, and extract digitemp.exe from the zip file. Note [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,12],"tags":[],"class_list":["post-780","post","type-post","status-publish","format-standard","hentry","category-novosti","category-windows"],"_links":{"self":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=780"}],"version-history":[{"count":1,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/780\/revisions"}],"predecessor-version":[{"id":781,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/780\/revisions\/781"}],"wp:attachment":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}