{"id":28,"date":"2022-12-11T11:22:50","date_gmt":"2022-12-11T10:22:50","guid":{"rendered":"http:\/\/129.152.21.86\/?p=28"},"modified":"2022-12-11T11:22:50","modified_gmt":"2022-12-11T10:22:50","slug":"temperatursensor-mit-nrf24l01-und-arduino-nano-clone","status":"publish","type":"post","link":"https:\/\/www.kleinladen.at\/?p=28","title":{"rendered":"Temperatursensor mit NRF24l01 und Arduino Nano (Clone)"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Arduino mit 6x DS18B20 und NRF24L01<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">NRF24L01 &#8211; Board Schematic &amp; Pin-Out<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1055\" height=\"650\" src=\"https:\/\/www.kleinladen.at\/wp-content\/uploads\/2022\/12\/nrf24l01-schematic.png\" alt=\"\" class=\"wp-image-29\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"409\" height=\"365\" src=\"https:\/\/www.kleinladen.at\/wp-content\/uploads\/2022\/12\/nrf24_pinout.jpg\" alt=\"\" class=\"wp-image-30\"\/><\/figure>\n\n\n\n<p>Library http:\/\/tmrh20.github.io\/RF24\/<\/p>\n\n\n\n<p><a href=\"https:\/\/www.kleinladen.at\/wp-content\/uploads\/2017\/01\/nRF24L01_Product_Specification_v2_0.pdf\">nRF24L01_Product_Specification_v2_0<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">DS18B20<\/h2>\n\n\n\n<p>Sensor 01 (Raumtemperatur):<br>0x10, 0xC4, 0x1E, 0x0A, 0x03, 0x08, 0x00, 0xEF<\/p>\n\n\n\n<p>Sensor 02:<br>0x28, 0xFF, 0x0C, 0x0C, 0x86, 0x16, 0x04, 0xEF<\/p>\n\n\n\n<p>Sensor 03:<br>0x28, 0xFF, 0xB2, 0x89, 0x90, 0x16, 0x05, 0x9F<\/p>\n\n\n\n<p>Sensor 04:<br>0x28, 0xFF, 0x46, 0xC5, 0x86, 0x16, 0x05, 0x4F<\/p>\n\n\n\n<p>Sensor 05:<br>0x28, 0xFF, 0x81, 0x93, 0x90, 0x16, 0x05, 0x76<\/p>\n\n\n\n<p>Sensor 06:<br>0x28, 0xFF, 0xC7, 0x2E, 0x91, 0x16, 0x04, 0xFA<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Raspberry Pi 3 mit NRF24L01<\/h1>\n\n\n\n<p>von hier: <a href=\"https:\/\/tutorials-raspberrypi.de\/funkkommunikation-zwischen-raspberry-pis-und-arduinos-2-4-ghz\/\">https:\/\/tutorials-raspberrypi.de\/funkkommunikation-zwischen-raspberry-pis-und-arduinos-2-4-ghz\/<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"496\" src=\"https:\/\/www.kleinladen.at\/wp-content\/uploads\/2022\/12\/Raspberry-Pi-nRF24L01-Steckplatine-600x496-1.png\" alt=\"\" class=\"wp-image-31\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get update\nsudo apt-get upgrade<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">wget http:\/\/tmrh20.github.io\/RF24Installer\/RPi\/install.sh\nchmod +x install.sh\n.\/install.sh\ncd rf24libs\/RF24<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install python-dev libboost-python-dev\nsudo apt-get install python-setuptools\n\nsudo apt-get install librrd-dev \/\/ !!!!<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">RRDTOOL<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">rrdtool create waermepumpe_temps.rrd --step 60 \\\nDS:t01:GAUGE:150:0:100 \\\nDS:t02:GAUGE:150:0:100 \\\nDS:t03:GAUGE:150:0:100 \\\nDS:t04:GAUGE:150:0:100 \\\nDS:t05:GAUGE:150:0:100 \\\nDS:t06:GAUGE:150:0:100 \\\nRRA:AVERAGE:0.5:1:14400 \\\nRRA:AVERAGE:0.5:1440:3600 \\\nRRA:MAX:0.5:1440:3600 \\\nRRA:MIN:0.5:1440:3600<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\/*\n&nbsp;Copyright (C) 2017 Christian Bauer &lt;oe3cjb@qth.at&gt;\n\n&nbsp;This program is free software; you can redistribute it and\/or\n&nbsp;modify it under the terms of the GNU General Public License\n&nbsp;version 2 as published by the Free Software Foundation.\n\n&nbsp;*\/\n\n#include &lt;rrd.h&gt;\n#include &lt;cstdlib&gt;\n#include &lt;iostream&gt;\n#include &lt;sstream&gt;\n#include &lt;string&gt;\n#include &lt;unistd.h&gt;\n#include &lt;RF24\/RF24.h&gt;\n\nusing namespace std;\n\nRF24 radio(22,0);\n\nbool radioNumber = 1;\n\n\/********************************\/\n\n\/\/ Radio pipe addresses for the 2 nodes to communicate.\nconst uint8_t pipes[][6] = {\"Waerm\",\"reuaB\"};\n\n\nint main(int argc, char** argv){\n\n&nbsp; typedef struct {\n&nbsp;&nbsp;&nbsp; long t01;\n&nbsp;&nbsp;&nbsp; long t02;\n&nbsp;&nbsp;&nbsp; long t03;\n&nbsp;&nbsp;&nbsp; long t04;\n&nbsp;&nbsp;&nbsp; long t05;\n&nbsp;&nbsp;&nbsp; long t06;\n&nbsp; } sensoren;\n\n&nbsp; sensoren wp;\n\n&nbsp; int rrd_argc = 3;\n&nbsp; char* rrd_argv[]={\"update\",\"\/home\/pi\/waermepumpe_temps.rrd\",NULL,NULL};\n\n&nbsp; cout &lt;&lt; \"Starte W\u00c3\u00a4rmepumpen-Temperatur-Logger!\" &lt;&lt; endl;\n\n&nbsp; \/\/ Setup and configure rf radio\n&nbsp; radio.begin();\n&nbsp; radio.setDataRate(RF24_250KBPS);\n\n&nbsp; \/\/ optionally, increase the delay between retries &amp; # of retries\n&nbsp; radio.setRetries(15,15);\n\n&nbsp; radio.openWritingPipe(pipes[1]);\n&nbsp; radio.openReadingPipe(1,pipes[0]);\n&nbsp; radio.startListening();\n\n&nbsp; \/\/ forever loop\n&nbsp; while (1)\n&nbsp; {\n&nbsp;&nbsp;&nbsp; \/\/ if there is data ready\n&nbsp;&nbsp;&nbsp; if ( radio.available() )\n&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ Dump the payloads until we've gotten everything\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stringstream workhorse;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string rrd_update_string;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ laenge = radio.getDynamicPayloadSize();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ Fetch the payload, and see if this was the last one.\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(radio.available()){\n&nbsp;&nbsp; &nbsp;\/\/&nbsp;&nbsp; &nbsp;radio.read( &amp;got_time, sizeof(unsigned long) );\n&nbsp;&nbsp; &nbsp;radio.read( &amp;wp, sizeof(wp) );\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ Ausgeben, was empfangen wurde\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/cout &lt;&lt; \"rrdtool update ~\/waermepumpe_temps.rrd N:\" &lt;&lt; ((float) wp.t01)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t02)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t03)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t04)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t05)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t06)\/100 &lt;&lt; endl;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; workhorse &lt;&lt; \"N:\" &lt;&lt; ((float) wp.t01)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t02)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t03)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t04)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t05)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t06)\/100;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/rrd_update_string &lt;&lt; \"N:\" &lt;&lt; ((float) wp.t01)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t02)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t03)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t04)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t05)\/100 &lt;&lt; \":\" &lt;&lt; ((float) wp.t06)\/100;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rrd_update_string = workhorse.str();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char* cstr1 = rrd_update_string.c_str();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; rrd_update_string &lt;&lt; endl;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rrd_argv[2] = (char *) cstr1;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rrd_clear_error();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rrd_update(rrd_argc,rrd_argv);\n&nbsp;&nbsp; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delay(5000); \/\/Delay after payload responded to, minimize RPi CPU time\n\n&nbsp; } \/\/ forever loop\nreturn 0;\n}\n\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">rrdtool graph bild.png \\\n#!\/bin\/sh\nrrdtool graph waermepumpe.png --width 640 --height 480 \\\nDEF:temp01=waermepumpe_temps.rrd:t01:AVERAGE \\\nDEF:temp02=waermepumpe_temps.rrd:t02:AVERAGE \\\nDEF:temp03=waermepumpe_temps.rrd:t03:AVERAGE \\\nDEF:temp04=waermepumpe_temps.rrd:t04:AVERAGE \\\nDEF:temp05=waermepumpe_temps.rrd:t05:AVERAGE \\\nDEF:temp06=waermepumpe_temps.rrd:t06:AVERAGE \\\nLINE2:temp01#00FF00:Zimmer \\\nLINE2:temp02#FFB400:Heizung-IN \\\nLINE2:temp03#FF0000:Heizung-OUT \\\nLINE2:temp05#0000FF:Quelle-IN \\\nLINE2:temp04#00FFFF:Quelle-OUT \\\nLINE2:temp06#990099:Wasserspeicher\n\nUSERNAME=\"wetterkamera\"\nPASSWORD=\"Kj69Ap\"\nSERVER=\"192.168.29.164\"\n\n# local directory to pickup *.tar.gz file\nFILE=\"\/home\/pi\"\n\n# remote server directory to upload backup\nBACKUPDIR=\"\/\"\n\n# login to remote server\nftp -n -i $SERVER &lt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Arduino mit 6x DS18B20 und NRF24L01 NRF24L01 &#8211; Board Schematic &amp; Pin-Out Library http:\/\/tmrh20.github.io\/RF24\/ nRF24L01_Product_Specification_v2_0 DS18B20 Sensor 01 (Raumtemperatur):0x10, 0xC4, 0x1E, 0x0A, 0x03, 0x08, 0x00, 0xEF Sensor 02:0x28, 0xFF, 0x0C, 0x0C, 0x86, 0x16, 0x04, 0xEF Sensor 03:0x28, 0xFF, 0xB2, 0x89, 0x90, 0x16, 0x05, 0x9F Sensor 04:0x28, 0xFF, 0x46, 0xC5, 0x86, 0x16, 0x05, 0x4F Sensor 05:0x28, &hellip; <a href=\"https:\/\/www.kleinladen.at\/?p=28\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Temperatursensor mit NRF24l01 und Arduino Nano (Clone)<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":1,"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":32,"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions\/32"}],"wp:attachment":[{"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kleinladen.at\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}