{"id":24678,"date":"2006-10-08T18:25:04","date_gmt":"2006-10-08T16:25:04","guid":{"rendered":"https:\/\/www.vcp.de\/pfadfinden\/?p=24678"},"modified":"2022-02-09T19:11:57","modified_gmt":"2022-02-09T18:11:57","slug":"raspberry-pi-temperatur-luftfeuchtigkeit-messen","status":"publish","type":"post","link":"https:\/\/vcp.de\/pfadfinden\/scoutlab\/raspberry-pi-temperatur-luftfeuchtigkeit-messen\/","title":{"rendered":"Raspberry Pi: Temperatur &#038; Luftfeuchtigkeit messen"},"content":{"rendered":"<h3>Zielgruppe:<\/h3>\n<p>Pfadfinderinnen- und Pfadfinderstufe<\/p>\n<h3>Zielsetzung:<\/h3>\n<p>Mit dem Temperatur\/Luftfeuchtigkeits-Sensor messen wir die Werte in der Umgebung und geben das Ergebnis auf dem Monitor aus.<\/p>\n<h2>Dauer:<\/h2>\n<p>ca. 60 Minuten<\/p>\n<h2>Material:<\/h2>\n<ul>\n<li>Raspberry Pi<\/li>\n<li>Breadboard<\/li>\n<li>Temperatur\/Luftfeuchtigkeits-Sensor<\/li>\n<li>Jumper-Kabel<\/li>\n<li>Kabel<\/li>\n<\/ul>\n<h3>Aufbau<\/h3>\n<p>F\u00fcr das Experiment wird ein fertiger Temperatur\/Luftfeuchtigkeits-Sensor verwendet.<\/p>\n<p><a href=\"https:\/\/www.vcp.de\/pfadfinden\/wp-content\/uploads\/2022\/02\/IMG_5666-300x200-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24671 aligncenter\" src=\"https:\/\/www.vcp.de\/pfadfinden\/wp-content\/uploads\/2022\/02\/IMG_5666-300x200-1.jpg\" alt=\"\" width=\"300\" height=\"200\" \/><\/a><\/p>\n<p>F\u00fcr den Versuch ist es\u00a0<strong>wichtig<\/strong>, dass die Anschl\u00fcsse auf dem Temperatur\/Luftfeuchtigkeits-Sensor richtig verdrahtet werden!<\/p>\n<h3>Anschl\u00fcsse Temperatur\/Luftfeuchtigkeits-Sensor<\/h3>\n<p><a href=\"https:\/\/www.vcp.de\/pfadfinden\/wp-content\/uploads\/2022\/02\/IMG_5663_rtempfeuchte_kabel-300x200-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24670 aligncenter\" src=\"https:\/\/www.vcp.de\/pfadfinden\/wp-content\/uploads\/2022\/02\/IMG_5663_rtempfeuchte_kabel-300x200-1.jpg\" alt=\"\" width=\"300\" height=\"200\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>Braun\u00a0\u2013\u00a0Masse (GND)<\/li>\n<li>Rot\u00a0\u2013\u00a0+5 Volt<\/li>\n<li>Neon-Gelb \u2013\u00a0Signal<\/li>\n<\/ul>\n<h3>Vorbereitung<\/h3>\n<p><em><strong>sudo apt-get update<br \/>\nsudo apt-get upgrade<br \/>\nsudo apt-get install build-essential python-dev python-openssl git<br \/>\n<\/strong><\/em><br \/>\nZuerst laden wir die ben\u00f6tigte Bibliothek von\u00a0Adafruit.<\/p>\n<p><strong><em>git clone https:\/\/github.com\/adafruit\/Adafruit_Python_DHT.git &amp;&amp; cd Adafruit_Python_DHT<\/em><\/strong><\/p>\n<p>Dadurch wird eine Python Bibliothek angelegt, die wir einfach in unsere Projekte einbinden k\u00f6nnen.<\/p>\n<p>Mit\u00a0<em><strong>sudo python setup.py install<\/strong><\/em>\u00a0installieren wir die ben\u00f6tigte\u00a0Python Bibliothek.<br \/>\n<a href=\"https:\/\/www.vcp.de\/pfadfinden\/wp-content\/uploads\/2006\/10\/dht11-modul_raspberrypi_Steckplatine-768x541-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-24682 size-full\" src=\"https:\/\/www.vcp.de\/pfadfinden\/wp-content\/uploads\/2006\/10\/dht11-modul_raspberrypi_Steckplatine-768x541-1.png\" alt=\"\" width=\"768\" height=\"541\" srcset=\"https:\/\/vcp.de\/pfadfinden\/wp-content\/uploads\/2006\/10\/dht11-modul_raspberrypi_Steckplatine-768x541-1.png 768w, https:\/\/vcp.de\/pfadfinden\/wp-content\/uploads\/2006\/10\/dht11-modul_raspberrypi_Steckplatine-768x541-1-300x211.png 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/p>\n<p>[php]<br \/>\n#!\/usr\/bin\/python<br \/>\nimport time<br \/>\nimport Adafruit_DHT<\/p>\n<p>sensor = Adafruit_DHT.DHT11<br \/>\npin = 4<\/p>\n<p>while 1:<br \/>\nhumidity, temperature = Adafruit_DHT.read_retry(sensor, pin)<br \/>\nif humidity is not None and temperature is not None:<br \/>\nprint(&#8218;Temp={0:0.1f}*C Feuchtigkeit={1:0.1f}%&#8216;.format(temperature, humidity))<br \/>\nelse:<br \/>\nprint(&#8218;Fehler beim Einlesen der Daten. Starte einen weiteren Versuch!&#8216;)<br \/>\ntime.sleeps(0.50)<br \/>\n[\/php]<\/p>\n<p><strong><a href=\"https:\/\/github.com\/pediehl\/raspberry-pi-temperatur-luftfeuchtigkeit-messen\/archive\/master.zip\" target=\"_blank\" rel=\"noopener\">Arbeitsblatt &amp; Programmcode zum Download<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zielgruppe: Pfadfinderinnen- und Pfadfinderstufe Zielsetzung: Mit dem Temperatur\/Luftfeuchtigkeits-Sensor messen wir die Werte in der Umgebung und geben das Ergebnis auf dem Monitor aus. Dauer: ca. 60 Minuten Material: Raspberry Pi Breadboard Temperatur\/Luftfeuchtigkeits-Sensor Jumper-Kabel Kabel Aufbau F\u00fcr das Experiment wird ein fertiger Temperatur\/Luftfeuchtigkeits-Sensor verwendet. F\u00fcr den Versuch ist es\u00a0wichtig, dass die Anschl\u00fcsse auf dem Temperatur\/Luftfeuchtigkeits-Sensor richtig [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":24679,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[379],"tags":[],"class_list":["post-24678","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scoutlab"],"acf":[],"_links":{"self":[{"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/posts\/24678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/comments?post=24678"}],"version-history":[{"count":0,"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/posts\/24678\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/media\/24679"}],"wp:attachment":[{"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/media?parent=24678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/categories?post=24678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vcp.de\/pfadfinden\/wp-json\/wp\/v2\/tags?post=24678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}