{"id":2129,"date":"2025-04-15T06:11:08","date_gmt":"2025-04-15T06:11:08","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=2129"},"modified":"2025-06-10T10:35:07","modified_gmt":"2025-06-10T10:35:07","slug":"example-temperature-readout-with-limits-with-oblcd","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/","title":{"rendered":"Example: Temperature readout with limits with OBLCD"},"content":{"rendered":"\n<p>In this example we will do a complete sample application, a fermentation vessel temperature monitor with high and low limits.<\/p>\n\n\n\n<p>The temperature sensor is a 10K thermistor probe connected to the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o364\">MMi99<\/a>\u00a0analog input c configured for temperature measurement (thermistor temperature measurement with SPLat is documented\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-thermistor-temperature-measurement\/\">elsewhere<\/a>). The thermistor drive voltage is generated by analog output i.<\/p>\n\n\n\n<p>Using an Excel spreadsheet we have determined the following parameters:<\/p>\n\n\n\n<p>Operating temperature range: 25\u00b0C &#8211; 45\u00b0C<\/p>\n\n\n\n<p>Measurement resolution: approx 0.2\u00b0C<\/p>\n\n\n\n<p>Optimum analog out count to thermistor driver voltage generator: 125 (=9.80V)<\/p>\n\n\n\n<p>Equation for thermistor linearization:<\/p>\n\n\n\n<p>T = -1.617807E-06x^3 + 1.275737E-03x^2 &#8211; 5.141065E-01x + 9.905215E+01<\/p>\n\n\n\n<p>where x = raw analog input reading, T = temperature in \u00b0C and the ^ operator means &#8220;raised to the power of&#8221;<\/p>\n\n\n\n<p>The optimum fermentation temperature is 35\u00b0C. Above 37\u00b0C we must display an over temperature warning and below 32\u00b0C we must display an under temperature warning. We will do an update every 100mS, using timer 4.<\/p>\n\n\n\n<p>Display layout plan:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">0123456789012345\nVat temp: 33.3\u00b0C\n     Normal\n   Under temp!\n   OVER TEMP!!<\/pre>\n\n\n\n<p>Our program must:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Initialize the thermistor circuit by setting analog output i<\/li>\n\n\n\n<li>Initialize the LCD<\/li>\n\n\n\n<li>Wait for a 100mS time tick<\/li>\n\n\n\n<li>Take an analog reading and Convert to \u00b0C<\/li>\n\n\n\n<li>Display temperature<\/li>\n\n\n\n<li>Evaluate temperature and show status<\/li>\n\n\n\n<li>Go to 3<\/li>\n<\/ol>\n\n\n\n<p>Here&#8217;s the program<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">;Temperature monitor program with hi\/lo limits\nTemperature        mEQU      0      ;4 bytes for temperature value\n\n      LoadX        125\n      AnOutI                 ;Init thermistor circuit\n      OBLCD_Type   2         ;Init LCD\n;                   0123456789012345\n      OBLCD_Text   \"Temperature\"  ;\"splash\" screen\n      OBLCD_SetCur 1,0\n      OBLCD_Text   \"Monitor V1.0\"\n      Pause        500       ;Delay 5s to let thermistor drive settle\n\nMainLoop\n      Test         4\n      GoIfT        MainLoop  ;Wait for time tick\n      SetTimer     4,10      ;Restart the timer\n      GoSub        ReadTemp  ;Get and update temperature in memory\n      GoSub        DispTemp  ;Display temperature\n      GoSub        Evaluate  ;Check limits and display\n      GoTo         MainLoop\n\n;Subroutine to evaluate the temperature reading\n;and display a message. Because the fCompareR instruction\n;can yield a Result code in the R-register for indeterminate\n;results, I've included a corresponding Branch address\n;\"OhDear\". It does nothing.\nEvaluate\n      OBLCD_SetCur   1,0     ;Get that done first\n      fRecallW       Temperature\n      fLoadQ         37      ;Upper limit\n      fCompareR\n      BranchR\n      Target         TempOK   ; W=Q\n      Target         TempHot  ; W&gt;Q\n      Target         TestCold ; W&lt;Q\n      Target         OhDear   ; ????\n\nTestCold\n      fLoadQ         32       ;Low limit\n      fCompareR\n      BranchR\n      Target         TempOK   ; W=Q\n      Target         TempOK   ; W&gt;Q\n      Target         TempCold ; W&lt;Q\n      Target         OhDear   ; ????\n\nTempCold\n                     ;0123456789012345\n      OBLCD_Text     \"   Under temp!  \"\n      Return\n\nTempHot\n                     ;0123456789012345\n      OBLCD_Text     \"   OVER TEMP!!  \"\n      Return\n\nTempOK\n                     ;0123456789012345\n      OBLCD_Text     \"     Normal     \"\nOhDear\n      Return\n\n;Subroutine to display temperature\nDispTemp\n      OBLCD_SetCur   0,0\t\n      OBLCD_Text     \"Vat temp: \"\n      fRecallW       Temperature\n      OBLCD_fDispW   4,1\n      OBLCD_Text     223,\"C\"      ;223 = degree sign\n      Return\n\n;Subroutine to take one thermistor reading and convert to \u00b0C\n;in floating point memory location Temperature.\nReadTemp\n      AnInC                          ;Read thermistor\n      Float\n      fStore       Temperature\n      fLoadQ       -1.617807E-06      ;&lt;&lt; <a href=\"https:\/\/www.splatco.com\/skb\/352.htm#o3808\">X<\/a>^3 coefficient\n      fMul\n      fLoadQ       +1.275737E-03      ;&lt;&lt; X^2 coefficient\n      fAdd\n      fRecallQ     Temperature\n      fMul\n      fLoadQ       -5.141065E-01     ;&lt;&lt; X^1 coefficient\n      fAdd\n      fRecallQ     Temperature\n      fMul\n      fLoadQ       +9.905215E+01      ;&lt;&lt; X^0 coefficient\n      fAdd\n      fStore       Temperature\n      Return<\/pre>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>In this example we will do a complete sample application, a fermentation vessel temperature monitor with high and low limits. The temperature sensor is a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2126,"menu_order":3,"template":"","class_list":["post-2129","spl_knowledgebase","type-spl_knowledgebase","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Example: Temperature readout with limits with OBLCD - SPLat Controls<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Example: Temperature readout with limits with OBLCD - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"In this example we will do a complete sample application, a fermentation vessel temperature monitor with high and low limits. The temperature sensor is a...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T10:35:07+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/\",\"name\":\"Example: Temperature readout with limits with OBLCD - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-15T06:11:08+00:00\",\"dateModified\":\"2025-06-10T10:35:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Product documentation\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Product documentation: Onboard peripherals\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Onboard LCD\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"OBLCD: Programming\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"OBLCD: Examples\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/\"},{\"@type\":\"ListItem\",\"position\":7,\"name\":\"Example: Temperature readout with limits with OBLCD\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"name\":\"SPLat Controls\",\"description\":\"OEM Embedded Machine Controllers\",\"publisher\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\",\"name\":\"SPLat Controls\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"caption\":\"SPLat Controls\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Example: Temperature readout with limits with OBLCD - SPLat Controls","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Example: Temperature readout with limits with OBLCD - SPLat Controls","og_description":"In this example we will do a complete sample application, a fermentation vessel temperature monitor with high and low limits. The temperature sensor is a...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T10:35:07+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/","name":"Example: Temperature readout with limits with OBLCD - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-15T06:11:08+00:00","dateModified":"2025-06-10T10:35:07+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-temperature-readout-with-limits-with-oblcd\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Product documentation","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/"},{"@type":"ListItem","position":3,"name":"Product documentation: Onboard peripherals","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/"},{"@type":"ListItem","position":4,"name":"Onboard LCD","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/"},{"@type":"ListItem","position":5,"name":"OBLCD: Programming","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/"},{"@type":"ListItem","position":6,"name":"OBLCD: Examples","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/"},{"@type":"ListItem","position":7,"name":"Example: Temperature readout with limits with OBLCD"}]},{"@type":"WebSite","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","name":"SPLat Controls","description":"OEM Embedded Machine Controllers","publisher":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization","name":"SPLat Controls","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","caption":"SPLat Controls"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/2129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/spl_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"up":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/2126"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=2129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}