{"id":1942,"date":"2017-05-13T21:48:46","date_gmt":"2017-05-13T21:48:46","guid":{"rendered":"http:\/\/ioarvanit.gr\/?p=1942"},"modified":"2022-05-01T20:24:10","modified_gmt":"2022-05-01T20:24:10","slug":"%ce%b1%ce%ba%ce%bf%ce%bb%ce%bf%cf%85%ce%b8%cf%8e%ce%bd%cf%84%ce%b1%cf%82-%ce%bc%ce%b9%ce%b1-%ce%bc%ce%b1%cf%8d%cf%81%ce%b7-%ce%b3%cf%81%ce%b1%ce%bc%ce%bc%ce%ae-%ce%bc%ce%b5-%ce%b4%ce%b9%ce%b1%cf%86","status":"publish","type":"post","link":"https:\/\/ioarvanit.gr\/en\/archives\/1942","title":{"rendered":"Following a black line"},"content":{"rendered":"\n<p>Two different ways to program a robot to follow a black line were explored during the sessions of the Robotics club of our school in the 2016-2017 season.<\/p>\n\n\n\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/_gYurcc8TPg\" width=\"853\" height=\"480\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<!--more-->\n\n\n\n<p>The first design is with only one light sensor. Yoy can download the LDD file from here : <a href=\"http:\/\/ioarvanit.gr\/wp-content\/uploads\/2017\/05\/Design-with-one-light-sensor.zip\">Design with one light sensor<\/a>.<\/p>\n\n\n\n<p>The robot moves on the edge of the black line executing the following algorithm:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>If the light sensor &#8220;sees&#8221; bright white then it means that the robot is to the right of the black line so it has to turn to the left and forward.<\/li><li>If the light sensor &#8220;sees&#8221; black then it means that the robot is on the black line so it has to turn to the right and forward.<\/li><\/ol>\n\n\n\n<p>You can download this simple program from here: (<a href=\"http:\/\/ioarvanit.gr\/wp-content\/uploads\/2017\/05\/LineFollow1.zip\">LineFollow1<\/a>).<\/p>\n\n\n\n<p>You can also see a simulation of this behaviour in scratch:<\/p>\n\n\n\n<p><iframe loading=\"lazy\" src=\"\/\/scratch.mit.edu\/projects\/embed\/132921973\/?autostart=false\" width=\"485\" height=\"402\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<p>Another way to implement the line follower is with two light sensors, or in our case with one light sensor and a color sensor used as light sensor. We place the two sensors on the robot in a way that the width of the black line can fit between them&nbsp;(<a href=\"http:\/\/ioarvanit.gr\/wp-content\/uploads\/2017\/05\/Design-with-two-light-sensors.zip\">Design with two light sensors<\/a>).<\/p>\n\n\n\n<p>Using this design the algorithm is as follows:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>If both sensors &#8220;see&#8221; white, that means that the black line is between them so the robot goes forward.<\/li><li>If the right sensor &#8220;sees&#8221; black and the left &#8220;sees&#8221; white then the robot turns to the right.<\/li><li>If the left sensor &#8220;sees&#8221; black and the right &#8220;sees&#8221; white then the robot turns to left.<\/li><\/ol>\n\n\n\n<p>You can download the program from here&nbsp;<a href=\"http:\/\/ioarvanit.gr\/wp-content\/uploads\/2017\/05\/LineFollow2Sensors.zip\">LineFollow2Sensors<\/a>&nbsp;and you can see a scratch simulation below.<\/p>\n\n\n\n<p><iframe loading=\"lazy\" src=\"\/\/scratch.mit.edu\/projects\/embed\/132931206\/?autostart=false\" width=\"485\" height=\"402\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0393\u03b9\u03b1 \u03bd\u03b1 \u03c6\u03c4\u03b9\u03ac\u03be\u03bf\u03c5\u03bc\u03b5 \u03ba\u03b1\u03b9 \u03bd\u03b1 \u03c0\u03c1\u03bf\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1\u03c4\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03ad\u03bd\u03b1 \u03c1\u03bf\u03bc\u03c0\u03cc\u03c4 \u03ce\u03c3\u03c4\u03b5 \u03bd\u03b1 \u03ba\u03b9\u03bd\u03b5\u03af\u03c4\u03b1\u03b9 \u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03ce\u03bd\u03c4\u03b1\u03c2 \u03bc\u03b9\u03b1 \u03bc\u03b1\u03cd\u03c1\u03b7 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ae \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c3\u03ba\u03b5\u03c6\u03c4\u03bf\u03cd\u03bc\u03b5 \u03bc\u03b5 \u03b4\u03b9\u03ac\u03c6\u03bf\u03c1\u03bf\u03c5\u03c2 \u03c4\u03c1\u03cc\u03c0\u03bf\u03c5\u03c2. \u03a3\u03c4\u03bf \u03c0\u03bb\u03b1\u03af\u03c3\u03b9\u03bf \u03c4\u03c9\u03bd \u03c3\u03c5\u03bd\u03b1\u03bd\u03c4\u03ae\u03c3\u03b5\u03c9\u03bd \u03c4\u03bf\u03c5 \u03bf\u03bc\u03af\u03bb\u03bf\u03c5 \u03a1\u03bf\u03bc\u03c0\u03bf\u03c4\u03b9\u03ba\u03ae\u03c2 \u03c4\u03bf\u03c5 \u03a0\u03b5\u03b9\u03c1\u03b1\u03bc\u03b1\u03c4\u03b9\u03ba\u03bf\u03cd \u0394\u03b7\u03bc\u03bf\u03c4\u03b9\u03ba\u03bf\u03cd \u03a3\u03c7\u03bf\u03bb\u03b5\u03af\u03bf\u03c5 \u03a6\u03bb\u03ce\u03c1\u03b9\u03bd\u03b1\u03c2 2016-2017, \u03b5\u03be\u03b5\u03c1\u03b5\u03c5\u03bd\u03ae\u03c3\u03b1\u03bc\u03b5 \u03bc\u03b5\u03c1\u03b9\u03ba\u03bf\u03cd\u03c2 \u03b1\u03c0\u03cc \u03b1\u03c5\u03c4\u03bf\u03cd\u03c2.<\/p>\n","protected":false},"author":1,"featured_media":3430,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[85,16],"class_list":["post-1942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lesson-plans","tag-lego-nxt","tag-scratch","has-thumbnail"],"translation":{"provider":"WPGlobus","version":"3.0.0","language":"en","enabled_languages":["el","en"],"languages":{"el":{"title":true,"content":true,"excerpt":false},"en":{"title":true,"content":true,"excerpt":false}}},"_links":{"self":[{"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/posts\/1942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/comments?post=1942"}],"version-history":[{"count":15,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/posts\/1942\/revisions"}],"predecessor-version":[{"id":3439,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/posts\/1942\/revisions\/3439"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/media\/3430"}],"wp:attachment":[{"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/media?parent=1942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/categories?post=1942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/tags?post=1942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}