{"id":335,"date":"2014-10-21T19:06:48","date_gmt":"2014-10-21T17:06:48","guid":{"rendered":"http:\/\/heppg.de\/ikg\/wordpress\/?p=335"},"modified":"2015-12-28T20:58:14","modified_gmt":"2015-12-28T19:58:14","slug":"new-environmental-sensors-for-scratchclient","status":"publish","type":"post","link":"https:\/\/heppg.de\/ikg\/wordpress\/?p=335","title":{"rendered":"Environmental Sensors for scratchClient"},"content":{"rendered":"<p>The recent months have been busy with preparing new experiments for my<br \/>\nschool project, especially one experiment measuring temperatures with TMP36. See <a href=\"http:\/\/www.heppg.de\/ikg\/box\/adapter\/adapterplatine_complete.html#adapterplatine.sensor.analog.temperatur\">\u2192<br \/>\nlink<\/a><\/p>\n<p>When looking in detail to the datasheet of TMP36, there is an accuracy of max<br \/>\n+- 4K (G-Grade device) and +- 3K (F-Grade device). This is not bad for -40 to 125 \u00b0C. At 25\u00b0C, accuracy is\u00a0 +- 3K (G-Grade device) and +- 2K (F-Grade device).<br \/>\nUnfortunately the ADC on my adapter board, the MCP3202, uses the<br \/>\nvcc-voltage as reference, which gives additional error for the measurement.<br \/>\nWith patch cables, there is also some noise. I twisted signal and ground<br \/>\nline, added some capacity close to the TMP36 power pins and a low pass<br \/>\nfilter in the adapter logic. Which reduced, but did not remove the problems.<\/p>\n<p>So I started to look for more precise alternatives. LM35 in combination<br \/>\nwith an adc ads1015 and internal precision reference voltage gives better results.<br \/>\nLM35A specs give +-1K over -40 to 110 \u00b0C, around 25\u00b0C +- 0.5K.<\/p>\n<p>When starting to look for integrated solutions, complex devices like SHT15<br \/>\ncome around. Main purpose is to measure humidity, but temperature<br \/>\nmeasurement is included. +-0.3K around 25\u00b0C and +-1.5K in -40 to 90\u00b0C are<br \/>\nquite good. I2C is not supported, but a two-wire GPIO protocol is<br \/>\navailable. Disadvantage is the high price.<\/p>\n<p>BMP085 is a digital pressure sensor with temperature sensing included. +-2K<br \/>\naccuracy in 0 to 65\u00b0C. I2C, internal calibration data in registers, needs<br \/>\nsome calculations to correct the raw values.<\/p>\n<p>MAX31855K is used with k-type thermocouples and extends temperature range<br \/>\nto -200 to 1350\u00b0C. Note that K thermocouples have about \u00b12\u00b0C to \u00b16\u00b0C<br \/>\naccuracy. SPI interface is easy to use.<\/p>\n<p>And for curiosity, I added a luminosity sensor BH1750 to this collection of<br \/>\ndevices.<\/p>\n<p>Scratch integration is &#8216;as usual&#8217; with adapters, where configuration is<br \/>\ndone by xml files.<\/p>\n<p>Hardware interface to the devices (to be more precise: the breakout boards<br \/>\nwith the devices, is by I2C, SPI or plain GPIO. For the SHT15, I added a<br \/>\nserial resistor of 1kOhm for the data line to protect against<br \/>\ninput-output-mismatches during debug phase of code. For the clock line, this<br \/>\nis not needed, but in general a good idea to a serial resistor there too.<br \/>\nToo expensive this device, to take the risk of burning it away.<\/p>\n<p>These sensors will not be part of the school workshop documentation. Setup<br \/>\nis described in the scratchClient handbook \u2192 <a title=\"scratchClient Download\" href=\"http:\/\/heppg.de\/ikg\/wordpress\/?page_id=6\">link<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The recent months have been busy with preparing new experiments for my school project, especially one experiment measuring temperatures with TMP36. See \u2192 link When looking in detail to the datasheet of TMP36, there is an accuracy of max +- 4K (G-Grade device) and +- 3K (F-Grade device). This is not bad for -40 to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,9,3],"tags":[],"class_list":["post-335","post","type-post","status-publish","format-standard","hentry","category-adc","category-analog-digital-wandler","category-scratchclient"],"_links":{"self":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=335"}],"version-history":[{"count":6,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions"}],"predecessor-version":[{"id":341,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions\/341"}],"wp:attachment":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}