{"id":3529,"date":"2021-08-02T13:15:15","date_gmt":"2021-08-02T13:15:15","guid":{"rendered":"https:\/\/ioarvanit.gr\/?p=3529"},"modified":"2022-07-15T19:47:06","modified_gmt":"2022-07-15T19:47:06","slug":"%cf%83%cf%85%ce%bd%ce%b1%ce%b3%ce%b5%cf%81%ce%bc%cf%8c%cf%82-laser-%ce%bc%ce%b5-arduino","status":"publish","type":"post","link":"https:\/\/ioarvanit.gr\/en\/archives\/3529","title":{"rendered":"Laser alarm with Arduino"},"content":{"rendered":"\n<p>An introductory activity for creating and programming circuits with Arduino. The objective is to build a simple door alarm using a laser beam. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"http:\/\/ioarvanit.gr\/wp-content\/uploads\/2021\/08\/image823.png\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"480\" src=\"http:\/\/ioarvanit.gr\/wp-content\/uploads\/2021\/08\/image823.png\" alt=\"\" class=\"wp-image-3531\" srcset=\"https:\/\/ioarvanit.gr\/wp-content\/uploads\/2021\/08\/image823.png 900w, https:\/\/ioarvanit.gr\/wp-content\/uploads\/2021\/08\/image823-300x160.png 300w, https:\/\/ioarvanit.gr\/wp-content\/uploads\/2021\/08\/image823-768x410.png 768w, https:\/\/ioarvanit.gr\/wp-content\/uploads\/2021\/08\/image823-400x213.png 400w, https:\/\/ioarvanit.gr\/wp-content\/uploads\/2021\/08\/image823-800x427.png 800w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/a><figcaption>Plan for the door alarm<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">What do we need?<\/h2>\n\n\n\n<p>Every student team will have:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>One Arduino Uno or compatible board with a USB cable for connection with PC<\/li><li>One light sensor with digital output<\/li><li>One buzzer<\/li><li>One laser module<\/li><li>One breadboard<\/li><li>Jumper wires<\/li><li>A PC or laptop with Arduino IDE installed<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Connecting the wires<\/h2>\n\n\n\n<p>Before proceeding to the actual connections, every student team completes the following worksheet, drawing the connections using markers, according to the instructions.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-8064e7bc-1ca1-4846-afb2-22be4bdf80c2\" href=\"https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/\u03a6\u03cd\u03bb\u03bb\u03bf-\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2-\u03c3\u03c7\u03b7\u03bc\u03b1\u03c4\u03b9\u03ba\u03cc-\u03a3\u03c5\u03bd\u03b1\u03b3\u03b5\u03c1\u03bc\u03bf\u03cd-\u039b\u03cd\u03c3\u03b7-EN.pdf\" class=\"mtli_attachment mtli_pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Worksheet &#8211; connections<\/a><a href=\"https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/\u03a6\u03cd\u03bb\u03bb\u03bf-\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2-\u03c3\u03c7\u03b7\u03bc\u03b1\u03c4\u03b9\u03ba\u03cc-\u03a3\u03c5\u03bd\u03b1\u03b3\u03b5\u03c1\u03bc\u03bf\u03cd-\u039b\u03cd\u03c3\u03b7-EN.pdf\" class=\"mtli_attachment mtli_pdf\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-8064e7bc-1ca1-4846-afb2-22be4bdf80c2\">\u039b\u03ae\u03c8\u03b7<\/a><\/div>\n\n\n\n<p>When each team completes the schematic, we proceed by giving them the modules and wires to construct the circuit following their design.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/Screenshot_6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"973\" height=\"687\" src=\"https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/Screenshot_6.png\" alt=\"\" class=\"wp-image-3755\" srcset=\"https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/Screenshot_6.png 973w, https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/Screenshot_6-300x212.png 300w, https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/Screenshot_6-768x542.png 768w, https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/Screenshot_6-400x282.png 400w, https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/Screenshot_6-800x565.png 800w\" sizes=\"auto, (max-width: 973px) 100vw, 973px\" \/><\/a><figcaption>A way of solving the schematic<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Programming and testing<\/h2>\n\n\n\n<p>We proceed in a similar way to program the system. Instead of explaining in detail and step by step the structure of an Arduino program, we give each group a worksheet that includes a half-baked program and ask them to fill in the missing elements first with a pencil on paper.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-c6f790ac-41d3-4c61-a288-055a9f482461\" href=\"https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/\u03a6\u03cd\u03bb\u03bb\u03bf-\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2-\u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1-\u03c3\u03c5\u03bd\u03b1\u03b3\u03b5\u03c1\u03bc\u03bf\u03cd-EN.pdf\" class=\"mtli_attachment mtli_pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Worksheet &#8211; Program<\/a><a href=\"https:\/\/ioarvanit.gr\/wp-content\/uploads\/2022\/07\/\u03a6\u03cd\u03bb\u03bb\u03bf-\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2-\u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1-\u03c3\u03c5\u03bd\u03b1\u03b3\u03b5\u03c1\u03bc\u03bf\u03cd-EN.pdf\" class=\"mtli_attachment mtli_pdf\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-c6f790ac-41d3-4c61-a288-055a9f482461\">\u039b\u03ae\u03c8\u03b7<\/a><\/div>\n\n\n\n<p>We explain and help each team when they have questions, but in general, we try not to give them ready answers and let them solve the puzzle of the program. After completing the program on paper they can type it on their computer, upload it to the Arduino and test it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void setup() {\r\n  pinMode(8,OUTPUT);  \/\/Laser pin\r\n  pinMode(9,INPUT);   \/\/Light sensor pin\r\n  pinMode(10,OUTPUT); \/\/Buzzer pin\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ Turn on the laser that points at the light sensor\r\n  digitalWrite(8,HIGH);\r\n\r\n  \/\/Check the light sensor\r\n  \/\/If there is no light that means that the resistance is low\r\n  \/\/and the current is high\r\n  if (digitalRead(9) == HIGH) {\r\n    digitalWrite(10,HIGH);  \/\/Turn on the buzzer\r\n    delay(500);            \/\/for half a seconf\r\n    digitalWrite(10,LOW);  \/\/Turn off the buzzer\r\n    delay(500);            \/\/for half a second\r\n  } \r\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>An introductory activity for creating and programming circuits with Arduino. The objective is to build a simple door alarm using a laser beam. What do we need? Every student team will have: One Arduino Uno or compatible board with a USB cable for connection with PC One light sensor with digital output One buzzer One [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3608,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[44],"class_list":["post-3529","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lesson-plans","tag-arduino","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\/3529","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=3529"}],"version-history":[{"count":11,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/posts\/3529\/revisions"}],"predecessor-version":[{"id":3757,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/posts\/3529\/revisions\/3757"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/media\/3608"}],"wp:attachment":[{"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/media?parent=3529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/categories?post=3529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioarvanit.gr\/en\/wp-json\/wp\/v2\/tags?post=3529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}