{"id":287,"date":"2022-10-31T22:53:07","date_gmt":"2022-10-31T21:53:07","guid":{"rendered":"https:\/\/eis.grainscom.de\/?page_id=287"},"modified":"2022-11-02T22:15:17","modified_gmt":"2022-11-02T21:15:17","slug":"raspberry-pi-3-b-als-volt-meter","status":"publish","type":"page","link":"https:\/\/eis.grainscom.de\/?page_id=287","title":{"rendered":"Raspberry Pi 3 B+ als Volt Meter"},"content":{"rendered":"\n<h3 class=\"has-text-align-center wp-block-heading\">Ausf\u00fchrliche Beschreibung fehlt noch. Ist nur Stichpunkt artig bis jetzt<\/h3>\n\n\n\n<p>I2C einschalten:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo raspi-config<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"572\" src=\"https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter001-1024x572.png\" alt=\"\" class=\"wp-image-288\" srcset=\"https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter001-1024x572.png 1024w, https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter001-300x167.png 300w, https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter001-768x429.png 768w, https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter001.png 1288w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"564\" src=\"https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter002-1024x564.png\" alt=\"\" class=\"wp-image-289\" srcset=\"https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter002-1024x564.png 1024w, https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter002-300x165.png 300w, https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter002-768x423.png 768w, https:\/\/eis.grainscom.de\/wp-content\/uploads\/2022\/10\/rasp-voltmeter002.png 1303w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo reboot<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>grainscom@raspberrypi:~ $ sudo nano bustest.py\ngrainscom@raspberrypi:~ $ sudo more bustest.py\n#!\/usr\/bin\/python3\nimport smbus\nimport time\n\nbus = smbus.SMBus(1)\nadd = 0x48\n\nch0=0x00\nch1=0x01\nch2=0x02\nch3=0x03\n\ndef readAD():\n    analog = bus.read_byte(add)\n    return analog\n\ndef writeDA(value):\n    bus.write_byte_data(add, 0x44, value)\n\nwhile(0==0):\n    an0 = readAD()\n    an1 = readAD()\n    an2 = readAD()\n    an3 = readAD()\n    print ('Poti = %3d Licht = %3d Poti? = %3d Volt = %3d' % (an0, an1, an2, an3\n))\n    writeDA(an0)\n    time.sleep(0.5)\n    writeDA(0x00)\n\ngrainscom@raspberrypi:~ $\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>grainscom@raspberrypi:~ $ sudo chmod +x bustest.py\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Werte f\u00fcr Volt<\/h2>\n\n\n\n<p>185 = 11,85 V<br>186 = 11,95 V<br>187 = 12,02 V<br>188 = 12,08 V<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Aktueller Wert f\u00fcr Volt aus Datei lesen<\/h2>\n\n\n\n<iframe src=\"volt.txt\" width=\"90%\"><\/iframe>\n\n\n\n<h2 class=\"wp-block-heading\">Werte f\u00fcr Temperatur?<\/h2>\n\n\n\n<p>236 = am 01.11.2022 &#8211; 13:40 Uhr<br>235 = 21,8 C 01.11.2022 &#8211; 17:03 Uhr<br>238 = 18,2 C 01.11.2022 &#8211; 19:12 Uhr<br>234 = 22,3 C 02.11.2022 &#8211; 21:57 Uhr<br>237 = 20,3 C 02.11.2022 &#8211; 22:15 Uhr<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ausf\u00fchrliche Beschreibung fehlt noch. Ist nur Stichpunkt artig bis jetzt I2C einschalten: Werte f\u00fcr Volt 185 = 11,85 V186 = 11,95 V187 = 12,02 V188 = 12,08 V Aktueller Wert f\u00fcr Volt aus Datei lesen Werte f\u00fcr Temperatur? 236 = am 01.11.2022 &#8211; 13:40 Uhr235 = 21,8 C 01.11.2022 &#8211; 17:03 Uhr238 = 18,2 C&hellip; <br \/> <a class=\"read-more\" href=\"https:\/\/eis.grainscom.de\/?page_id=287\">Weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":56,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-287","page","type-page","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/eis.grainscom.de\/index.php?rest_route=\/wp\/v2\/pages\/287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eis.grainscom.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/eis.grainscom.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/eis.grainscom.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eis.grainscom.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=287"}],"version-history":[{"count":27,"href":"https:\/\/eis.grainscom.de\/index.php?rest_route=\/wp\/v2\/pages\/287\/revisions"}],"predecessor-version":[{"id":355,"href":"https:\/\/eis.grainscom.de\/index.php?rest_route=\/wp\/v2\/pages\/287\/revisions\/355"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eis.grainscom.de\/index.php?rest_route=\/wp\/v2\/media\/56"}],"wp:attachment":[{"href":"https:\/\/eis.grainscom.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}