{"id":34,"date":"2015-05-24T18:29:50","date_gmt":"2015-05-24T17:29:50","guid":{"rendered":"http:\/\/www.schmidt-welt.net\/weblog\/?p=34"},"modified":"2016-05-01T10:14:34","modified_gmt":"2016-05-01T09:14:34","slug":"arduino-and-kty81-210","status":"publish","type":"post","link":"https:\/\/www.schmidt-welt.net\/weblog\/arduino-and-kty81-210\/","title":{"rendered":"Arduino and KTY81-210"},"content":{"rendered":"<p>You have a lot of possibilities to measure the temperature with an arduino. One simple solution is the usage of a KTY81 silicon temperature sensors.<br \/>\nArduino describes on the <a href=\"http:\/\/playground.arduino.cc\/Main\/Kty81-110\" target=\"_blank\">playground<\/a> the usage of KTY81-110. If you have an other type, you need to recalculate the temperature. <\/p>\n<p><code><br \/>\n(Vcc 5+)--+-->2.7k--+-->kty81-210-->(GND)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+->100nF--+-----> ADC2 (Analog Port 2)<br \/>\n<\/code><\/p>\n<p>Here is my code to use KTY81-210 with the arduino:<\/p>\n<pre class=\"lang:arduino decode:true \" >\r\n\/\/ resistor value of voltage divider in ohm\r\nfloat resistor = 2700;\r\n\r\nvoid setup() {\r\n  Serial.begin(9600); \r\n}\r\n\r\nvoid loop() {  \r\n  float temp = kty(2); \r\n  Serial.print(\"Temperature: \");\r\n  Serial.println(temp,1); \r\n  delay (5000);  \r\n}\r\n\r\nfloat kty(unsigned int port) {\r\n   float sensorValue = analogRead(port);  \r\n   float resistance = sensorValue \/ (1023-sensorValue) * resistor;\r\n   \/\/ resistor values from kty81-210 data sheet, written as polynomial trend line\r\n   return -1.332e-11 * pow(resistance,4) + 6.621e-8 * pow(resistance,3) - 0.0002 * pow(resistance,2) + 0.2947 * resistance - 230.55;  \r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You have a lot of possibilities to measure the temperature with an arduino. One simple solution is the usage of a KTY81 silicon temperature sensors. Arduino describes on the playground the usage of KTY81-110. If you have an other type, you need to recalculate the temperature. (Vcc 5+)&#8211;+&#8211;>2.7k&#8211;+&#8211;>kty81-210&#8211;>(GND) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+->100nF&#8211;+&#8212;&#8211;> ADC2 (Analog Port 2) Here [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-arduino"],"_links":{"self":[{"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":7,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":47,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/posts\/34\/revisions\/47"}],"wp:attachment":[{"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}