{"id":19853,"date":"2022-04-20T11:25:16","date_gmt":"2022-04-20T09:25:16","guid":{"rendered":"https:\/\/www.wjst.de\/blog\/?p=19853"},"modified":"2022-07-15T07:07:11","modified_gmt":"2022-07-15T05:07:11","slug":"ein-fahrrad-abstandswarner","status":"publish","type":"post","link":"https:\/\/www.wjst.de\/blog\/sciencesurf\/2022\/04\/ein-fahrrad-abstandswarner\/","title":{"rendered":"Ein Fahrrad Abstandswarner"},"content":{"rendered":"<p>Nach <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2022\/01\/wechselrichter-und-stromzahler-mit-fritzbox-verbinden\/\">Stromz\u00e4hler<\/a> und <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2022\/03\/apropos-gasboykott-wie-hoch-ist-eigentlich-mein-gasverbrauch\/\">Gasuhr<\/a> kommt hier nun mein drittes Raspberry Pi Zero Projekt: ein Abstandswarner f\u00fcr vorbeifahrende Fahrzeuge. Das erste Mal habe ich davon in einem <a href=\"https:\/\/www.sciencedirect.com\/science\/article\/abs\/pii\/S0001457506001540\">wissenschaftlichen Artikel gelesen<\/a>, dann gab es den <a href=\"https:\/\/interaktiv.tagesspiegel.de\/radmesser\/kapitel5.html\">Radmesser in Berlin<\/a> (das Projekt war toll aber die Kiste dann doch etwas sperrig).<\/p>\n<p>Auch auf <a href=\"https:\/\/www.kickstarter.com\/projects\/benray\/surelight-the-safest-bike-light\/description\">Kickstarter<\/a> stand mal was und dann gibt es auch noch den 200\u20ac Varia Radar von <a href=\"https:\/\/newatlas.com\/bicycles\/garmin-varia-radar-smartphones\/?itm_source=newatlas&amp;itm_medium=article-body\">Garmin <\/a>&#8211; allerdings hatte keines der bisherigen Projekte eine Kamera eingebaut.<\/p>\n<p>Laser und ToF hatte es mir <a href=\"https:\/\/pubmed.ncbi.nlm.nih.gov\/23824849\/\">immer schon angetan<\/a>, dann probieren wir das auch mal hier.<\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/v8BYS-LokaE\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<p>Hier ist die fertig montierte Platine mit praktischen Steckverbindungen des Sparkfun QWIIC Baukasten der auf dem<a href=\"https:\/\/de.wikipedia.org\/wiki\/I%C2%B2C\"> I2C Bus<\/a> beruht.<\/p>\n<figure id=\"attachment_19855\" aria-describedby=\"caption-attachment-19855\" style=\"width: 620px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v1.jpg\" data-rel=\"key-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-19855 size-medium\" src=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v1-620x450.jpg\" alt=\"\" width=\"620\" height=\"450\" srcset=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v1-620x450.jpg 620w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v1-688x500.jpg 688w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v1-768x558.jpg 768w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v1.jpg 1525w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><figcaption id=\"caption-attachment-19855\" class=\"wp-caption-text\">Pi Zero, dar\u00fcber Breakout Board, links der Lidar und rechts die Kamera. Die Bauteile sind in 10 Minuten zusammengesteckt<\/figcaption><\/figure>\n<p>St\u00fcckliste: Pi Zero WH (15\u20ac),\u00a0 32 Gb Karte (8\u20ac), SparkFun Qwiic HAT (6\u20ac), Pi Camera v2 (24\u20ac), SparkFun Qwiic Sensor Breakout VL53L1X (22\u20ac), alte Powerbank, alte GoPro Halterung, der Deckel einer L\u00f6sungsmitteldose,\u00a0 Befestigungsmaterial und irgendwann gibt es noch ein <a href=\"https:\/\/www.thingiverse.com\/thing:1165227\">3D gedrucktes Geh\u00e4use<\/a> daf\u00fcr, UPS und GPS breakout.<\/p>\n<p><a href=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v2.jpg\" data-rel=\"key-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-19856\" src=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v2-620x534.jpg\" alt=\"\" width=\"620\" height=\"534\" srcset=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v2-620x534.jpg 620w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v2-580x500.jpg 580w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v2-768x662.jpg 768w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2022\/04\/v2.jpg 1271w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Erste Versuche zeigen, dass der Sensor millimetergenau misst (field of view liegt bei 25 Grad). Die Kamera braucht aber zu lange zum starten, damit ist das \u00fcberholende Fahrzeug schon l\u00e4ngst vorbei. Also zu n\u00e4chst habe ich nun auf <a href=\"https:\/\/picamera.readthedocs.io\/en\/release-1.13\/recipes1.html\">permanenten Videostream<\/a> mit 50 fps umgestellt, von dem die Videodaten nur dann gesichert werden, wenn ein Objekt unter 1500 mm Abstand erkannt wird.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nimport io\r\nimport random\r\nimport picamera\r\ndef proximity_detected():\r\n    return True\r\ncamera = picamera.PiCamera()\r\nstream = picamera.PiCameraCircularIO(camera, seconds=5)\r\ncamera.start_recording(stream, format='h264')\r\ntry:\r\n    while True:\r\n        if proximity_detected():\r\n            camera.wait_recording(2)\r\n            stream.copy_to('proximity.h264')\r\nfinally:\r\n    camera.stop_recording()\r\n<\/pre>\n<p>Als Overlay wird noch Uhrzeit und Abstand eingeblendet um zu sehen ob die Reichweite outdoor auch gut genug ist. Frage ist auch ob die Farbe des Autos die Messung beeinflu\u00dft.<\/p>\n<p>TBC<\/p>\n<p>&nbsp;<\/p>\n\n<p>&nbsp;<\/p>\n<div class=\"bottom-note\">\n  <span class=\"mod1\">CC-BY-NC Science Surf , accessed 26.04.2026<\/span>\n <\/div>","protected":false},"excerpt":{"rendered":"<p>Nach Stromz\u00e4hler und Gasuhr kommt hier nun mein drittes Raspberry Pi Zero Projekt: ein Abstandswarner f\u00fcr vorbeifahrende Fahrzeuge. Das erste Mal habe ich davon in einem wissenschaftlichen Artikel gelesen, dann gab es den Radmesser in Berlin (das Projekt war toll aber die Kiste dann doch etwas sperrig). Auch auf Kickstarter stand mal was und dann &hellip; <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2022\/04\/ein-fahrrad-abstandswarner\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Ein Fahrrad Abstandswarner<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,3774,2993],"tags":[3198,3772,3729,2729,3836],"class_list":["post-19853","post","type-post","status-publish","format-standard","hentry","category-computer-software","category-tech","category-video","tag-munchen","tag-raspberry-pi","tag-sensor","tag-bike","tag-camera"],"_links":{"self":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/19853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/comments?post=19853"}],"version-history":[{"count":13,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/19853\/revisions"}],"predecessor-version":[{"id":19924,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/19853\/revisions\/19924"}],"wp:attachment":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/media?parent=19853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/categories?post=19853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/tags?post=19853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}