{"id":436,"date":"2025-09-18T16:50:46","date_gmt":"2025-09-18T14:50:46","guid":{"rendered":"https:\/\/avlos.gr\/wpress\/?p=436"},"modified":"2025-09-18T16:54:05","modified_gmt":"2025-09-18T14:54:05","slug":"%ce%b1%ce%b9%cf%83%ce%b8%ce%b7%cf%84%ce%ae%cf%81%ce%b1%cf%82-%ce%b1%cf%80%cf%8c%cf%83%cf%84%ce%b1%cf%83%ce%b7%cf%82","status":"publish","type":"post","link":"https:\/\/avlos.gr\/wpress\/%ce%b1%ce%b9%cf%83%ce%b8%ce%b7%cf%84%ce%ae%cf%81%ce%b1%cf%82-%ce%b1%cf%80%cf%8c%cf%83%cf%84%ce%b1%cf%83%ce%b7%cf%82\/","title":{"rendered":"\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Ultrasonic Sensor HC-SR04 and Arduino<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03c0\u03ce\u03c2 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03b5\u03af \u03bf \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03c9\u03bd\u00a0<strong>HC-SR04<\/strong>\u00a0\u03ba\u03b1\u03b9 \u03c0\u03ce\u03c2 \u03bd\u03b1 \u03c4\u03bf\u03bd \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b5 \u03c4\u03bf Arduino \u03b3\u03b9\u03b1 \u03bd\u03b1  \u03bc\u03b5\u03c4\u03c1\u03ac\u03bc\u03b5 \u03b1\u03c0\u03bf\u03c3\u03c0\u03ac\u03c3\u03b5\u03b9\u03c2. \u0391\u03c5\u03c4\u03cc\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bf \u03c0\u03b9\u03bf \u03b4\u03b7\u03bc\u03bf\u03c6\u03b9\u03bb\u03ae\u03c2 \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03b3\u03b9\u03b1 \u03bc\u03ad\u03c4\u03c1\u03b7\u03c3\u03b7 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2. \u039c\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c4\u03bf\u03bd \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c3\u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03c1\u03bf\u03bc\u03c0\u03cc\u03c4 \u03b1\u03c0\u03bf\u03c6\u03c5\u03b3\u03ae\u03c2 \u03b5\u03bc\u03c0\u03bf\u03b4\u03af\u03c9\u03bd \u03bc\u03b5 \u03c4\u03bf Arduino, \u03ba\u03b1\u03b9 \u03b1\u03c5\u03c4\u03cc \u03c0\u03b5\u03c1\u03af\u03c0\u03bf\u03c5 \u03b8\u03b1 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03c3\u03c4\u03b7 \u03c3\u03c5\u03bd\u03ad\u03c7\u03b5\u03b9\u03b1.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae \u03c4\u03bf\u03c5 \u03c5\u03bb\u03b9\u03ba\u03bf\u03cd HC-SR04<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u039f HC-SR04 \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03bd\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c3\u03b9\u03c4\u03cc\u03c2 \u03c3\u03c4\u03b7\u03bd \u03c4\u03b9\u03bc\u03ae \u03ba\u03b1\u03b9 \u03b5\u03cd\u03ba\u03bf\u03bb\u03bf\u03c2 \u03c3\u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03bc\u03ad\u03c4\u03c1\u03b7\u03c3\u03b7\u03c2 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2. \u0388\u03c7\u03b5\u03b9 \u03b5\u03cd\u03c1\u03bf\u03c2 \u03b1\u03bd\u03af\u03c7\u03bd\u03b5\u03c5\u03c3\u03b7\u03c2 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03b1\u03c0\u03cc 2 cm \u03ad\u03c9\u03c2 400 cm. \u039f \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03b1\u03c0\u03bf\u03c4\u03b5\u03bb\u03b5\u03af\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03b4\u03cd\u03bf \u03bc\u03b5\u03c4\u03b1\u03c4\u03c1\u03bf\u03c0\u03b5\u03af\u03c2 \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03c9\u03bd. \u039f \u03ad\u03bd\u03b1\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c0\u03bf\u03bc\u03c0\u03cc\u03c2 \u03c0\u03bf\u03c5 \u03b5\u03ba\u03c0\u03ad\u03bc\u03c0\u03b5\u03b9 \u03c5\u03c0\u03b5\u03c1\u03b7\u03c7\u03b7\u03c4\u03b9\u03ba\u03bf\u03cd\u03c2 \u03c0\u03b1\u03bb\u03bc\u03bf\u03cd\u03c2 \u03ae\u03c7\u03bf\u03c5 \u03ba\u03b1\u03b9 \u03bf \u03ac\u03bb\u03bb\u03bf\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03ad\u03ba\u03c4\u03b7\u03c2 \u03c0\u03bf\u03c5 \u03b1\u03ba\u03bf\u03cd\u03b5\u03b9 \u03c4\u03b1 \u03b1\u03bd\u03b1\u03ba\u03bb\u03ce\u03bc\u03b5\u03bd\u03b1 \u03ba\u03cd\u03bc\u03b1\u03c4\u03b1. \u0395\u03af\u03bd\u03b1\u03b9 \u03b2\u03b1\u03c3\u03b9\u03ba\u03ac \u03ad\u03bd\u03b1 SONAR \u03c3\u03b1\u03bd \u03b1\u03c5\u03c4\u03ac \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03bf\u03cd\u03bd \u03c4\u03b1 \u03c5\u03c0\u03bf\u03b2\u03c1\u03cd\u03c7\u03b9\u03b1.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u039f \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03ad\u03c7\u03b5\u03b9 4 \u03b1\u03ba\u03af\u03b4\u03b5\u03c2. \u03a4\u03bf VCC \u03ba\u03b1\u03b9 \u03c4\u03bf GND \u03c0\u03b7\u03b3\u03b1\u03af\u03bd\u03bf\u03c5\u03bd \u03c3\u03c4\u03b9\u03c2 \u03b1\u03ba\u03af\u03b4\u03b5\u03c2 5V \u03ba\u03b1\u03b9 GND \u03c3\u03c4\u03bf Arduino \u03ba\u03b1\u03b9 \u03c4\u03bf Trig \u03ba\u03b1\u03b9 \u03c4\u03bf Echo \u03c0\u03b7\u03b3\u03b1\u03af\u03bd\u03bf\u03c5\u03bd \u03c3\u03b5 \u03bf\u03c0\u03bf\u03b9\u03b1\u03b4\u03ae\u03c0\u03bf\u03c4\u03b5 \u03c8\u03b7\u03c6\u03b9\u03b1\u03ba\u03ae \u03b1\u03ba\u03af\u03b4\u03b1 Arduino. \u03a7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ce\u03bd\u03c4\u03b1\u03c2 \u03c4\u03bf\u03bd \u03b1\u03ba\u03c1\u03bf\u03b4\u03ad\u03ba\u03c4\u03b7 Trig \u03c3\u03c4\u03ad\u03bb\u03bd\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf \u03ba\u03cd\u03bc\u03b1 \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03c9\u03bd \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03bf\u03bc\u03c0\u03cc \u03ba\u03b1\u03b9 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03b1\u03ba\u03c1\u03bf\u03b4\u03ad\u03ba\u03c4\u03b7 Echo \u03bb\u03b1\u03bc\u03b2\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf \u03b1\u03bd\u03b1\u03ba\u03bb\u03ce\u03bc\u03b5\u03bd\u03bf \u03c3\u03ae\u03bc\u03b1.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a3\u03c4\u03bf \u03c3\u03c7\u03ae\u03bc\u03b1 \u03c0\u03bf\u03c5 \u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03b5\u03af \u03b2\u03bb\u03ad\u03c0\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"218\" height=\"216\" src=\"https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2.jpg\" alt=\"\" class=\"wp-image-441\" style=\"width:203px;height:auto\" srcset=\"https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2.jpg 218w, https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2-150x150.jpg 150w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><figcaption class=\"wp-element-caption\">\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 HC-SR04<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u03a0\u03ce\u03c2 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03b5\u03af \u03bf \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03c9\u03bd HC-SR04<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u038c\u03c0\u03c9\u03c2 \u03c6\u03b1\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03c3\u03c4\u03b7\u03bd \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1 \u03c0\u03bf\u03c5 \u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03b5\u03af \u03bf \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03b5\u03ba\u03c0\u03ad\u03bc\u03c0\u03b5\u03b9 \u03ad\u03bd\u03b1\u03bd \u03c5\u03c0\u03ad\u03c1\u03b7\u03c7\u03bf \u03c3\u03c4\u03b1 40 000 Hz \u03c0\u03bf\u03c5 \u03c4\u03b1\u03be\u03b9\u03b4\u03b5\u03cd\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd \u03b1\u03ad\u03c1\u03b1 \u03ba\u03b1\u03b9 \u03b5\u03ac\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf \u03b1\u03bd\u03c4\u03b9\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf \u03ae \u03b5\u03bc\u03c0\u03cc\u03b4\u03b9\u03bf \u03c3\u03c4\u03b7\u03bd \u03c0\u03bf\u03c1\u03b5\u03af\u03b1 \u03c4\u03bf\u03c5, \u03b8\u03b1 \u03b1\u03bd\u03b1\u03ba\u03bb\u03b1\u03c3\u03b8\u03b5\u03af \u03c0\u03af\u03c3\u03c9 \u03c3\u03c4\u03b7 \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1. \u039b\u03b1\u03bc\u03b2\u03ac\u03bd\u03bf\u03bd\u03c4\u03b1\u03c2 \u03c5\u03c0\u03cc\u03c8\u03b7 \u03c4\u03bf\u03bd \u03c7\u03c1\u03cc\u03bd\u03bf \u03c4\u03b1\u03be\u03b9\u03b4\u03b9\u03bf\u03cd \u03ba\u03b1\u03b9 \u03c4\u03b7\u03bd \u03c4\u03b1\u03c7\u03cd\u03c4\u03b7\u03c4\u03b1 \u03c4\u03bf\u03c5 \u03ae\u03c7\u03bf\u03c5 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"359\" height=\"165\" src=\"https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2_2.jpg\" alt=\"\" class=\"wp-image-438\" style=\"width:302px;height:auto\" srcset=\"https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2_2.jpg 359w, https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2_2-300x138.jpg 300w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><figcaption class=\"wp-element-caption\">\u039b\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03c4\u03bf\u03c5 HC-SR04<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0393\u03b9\u03b1 \u03bd\u03b1 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf\u03bd \u03c5\u03c0\u03ad\u03c1\u03b7\u03c7\u03bf \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03ba\u03af\u03b4\u03b1 Trig \u03c3\u03b5 \u03c5\u03c8\u03b7\u03bb\u03ae \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 \u03b3\u03b9\u03b1 10 \u00b5s. \u0391\u03c5\u03c4\u03cc \u03b8\u03b1 \u03c3\u03c4\u03b5\u03af\u03bb\u03b5\u03b9 \u03bc\u03b9\u03b1 \u03bf\u03bc\u03ac\u03b4\u03b1 8 \u03ba\u03cd\u03ba\u03bb\u03c9\u03bd \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03bf\u03c5 \u03c0\u03bf\u03c5 \u03b8\u03b1 \u03c4\u03b1\u03be\u03b9\u03b4\u03ad\u03c8\u03b5\u03b9 \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c4\u03b1\u03c7\u03cd\u03c4\u03b7\u03c4\u03b1 \u03c4\u03bf\u03c5 \u03ae\u03c7\u03bf\u03c5. \u039f\u03b9 \u03b1\u03ba\u03af\u03b4\u03b1 Echo \u03b1\u03bd\u03b5\u03b2\u03b1\u03af\u03bd\u03b5\u03b9 \u03b1\u03bc\u03ad\u03c3\u03c9\u03c2 \u03bc\u03b5\u03c4\u03ac \u03c4\u03b7\u03bd \u03b1\u03c0\u03bf\u03c3\u03c4\u03bf\u03bb\u03ae \u03c4\u03b7\u03c2 \u03bf\u03bc\u03ac\u03b4\u03b1\u03c2 \u03c4\u03c9\u03bd 8 \u03ba\u03cd\u03ba\u03bb\u03c9\u03bd \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03c9\u03bd \u03ba\u03b1\u03b9 \u03b1\u03c1\u03c7\u03af\u03b6\u03b5\u03b9 \u03bd\u03b1 \u03b1\u03ba\u03bf\u03cd\u03b5\u03b9 \u03ae \u03bd\u03b1 \u03c0\u03b5\u03c1\u03b9\u03bc\u03ad\u03bd\u03b5\u03b9 \u03bd\u03b1 \u03b1\u03bd\u03b1\u03ba\u03bb\u03b1\u03c3\u03c4\u03b5\u03af \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ba\u03cd\u03bc\u03b1 \u03b1\u03c0\u03cc \u03ad\u03bd\u03b1 \u03b1\u03bd\u03c4\u03b9\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0395\u03ac\u03bd \u03b4\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03b1\u03bd\u03c4\u03b9\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf \u03ae \u03b1\u03bd\u03b1\u03ba\u03bb\u03ce\u03bc\u03b5\u03bd\u03bf\u03c2 \u03c0\u03b1\u03bb\u03bc\u03cc\u03c2, \u03b7 \u03b1\u03ba\u03af\u03b4\u03b1 Echo \u03b8\u03b1 \u03bb\u03ae\u03be\u03b5\u03b9 \u03bc\u03b5\u03c4\u03ac \u03b1\u03c0\u03cc 38 ms \u03ba\u03b1\u03b9 \u03b8\u03b1 \u03b5\u03c0\u03b1\u03bd\u03ad\u03bb\u03b8\u03b5\u03b9 \u03c3\u03b5 \u03c7\u03b1\u03bc\u03b7\u03bb\u03ae \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0395\u03ac\u03bd \u03bb\u03ac\u03b2\u03bf\u03c5\u03bc\u03b5 \u03ad\u03bd\u03b1\u03bd \u03b1\u03bd\u03b1\u03ba\u03bb\u03ce\u03bc\u03b5\u03bd\u03bf \u03c0\u03b1\u03bb\u03bc\u03cc, \u03b7 \u03b1\u03ba\u03af\u03b4\u03b1 Echo \u03b8\u03b1 \u03c0\u03ad\u03c3\u03b5\u03b9 \u03bd\u03c9\u03c1\u03af\u03c4\u03b5\u03c1\u03b1 \u03b1\u03c0\u03cc \u03b1\u03c5\u03c4\u03ac \u03c4\u03b1 38 ms. \u0391\u03bd\u03ac\u03bb\u03bf\u03b3\u03b1 \u03bc\u03b5 \u03c4\u03bf \u03c7\u03c1\u03cc\u03bd\u03bf \u03c0\u03bf\u03c5 \u03b7 \u03b1\u03ba\u03af\u03b4\u03b1 Echo \u03ae\u03c4\u03b1\u03bd HIGH, \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c0\u03c1\u03bf\u03c3\u03b4\u03b9\u03bf\u03c1\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03c0\u03bf\u03c5 \u03b4\u03b9\u03ad\u03bd\u03c5\u03c3\u03b5 \u03c4\u03bf \u03b7\u03c7\u03b7\u03c4\u03b9\u03ba\u03cc \u03ba\u03cd\u03bc\u03b1, \u03ac\u03c1\u03b1 \u03ba\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1 \u03c3\u03c4\u03bf \u03b1\u03bd\u03c4\u03b9\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a3\u03c4\u03bf \u03c0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9 \u03b4\u03b9\u03ac\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c6\u03b1\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03b7 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03c0\u03bf\u03c5 \u03c0\u03b5\u03c1\u03b9\u03b3\u03c1\u03ac\u03c8\u03b1\u03bc\u03b5.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"378\" height=\"142\" src=\"https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2_3.jpg\" alt=\"\" class=\"wp-image-439\" style=\"width:349px;height:auto\" srcset=\"https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2_3.jpg 378w, https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2_3-300x113.jpg 300w\" sizes=\"auto, (max-width: 378px) 100vw, 378px\" \/><figcaption class=\"wp-element-caption\">\u0394\u03b9\u03ac\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1\u03c2 \u03c4\u03bf\u03c5 HC-SR04<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a3\u03c4\u03b7\u03bd \u03c0\u03c1\u03b1\u03b3\u03bc\u03b1\u03c4\u03b9\u03ba\u03cc\u03c4\u03b7\u03c4\u03b1 \u03b3\u03bd\u03c9\u03c1\u03af\u03b6\u03bf\u03c5\u03bc\u03b5 \u03ba\u03b1\u03b9 \u03c4\u03b9\u03c2 \u03c4\u03b9\u03bc\u03ad\u03c2 \u03c4\u03b1\u03c7\u03cd\u03c4\u03b7\u03c4\u03b1\u03c2 \u03ba\u03b1\u03b9 \u03c7\u03c1\u03cc\u03bd\u03bf\u03c5. \u039f \u03c7\u03c1\u03cc\u03bd\u03bf\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bf \u03c7\u03c1\u03cc\u03bd\u03bf\u03c2 \u03c0\u03bf\u03c5 \u03b7 \u03b1\u03ba\u03af\u03b4\u03b1 Echo \u03ae\u03c4\u03b1\u03bd HIGH \u03ba\u03b1\u03b9 \u03b7 \u03c4\u03b1\u03c7\u03cd\u03c4\u03b7\u03c4\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b7 \u03c4\u03b1\u03c7\u03cd\u03c4\u03b7\u03c4\u03b1 \u03c4\u03bf\u03c5 \u03ae\u03c7\u03bf\u03c5 \u03c0\u03bf\u03c5 \u03b5\u03af\u03bd\u03b1\u03b9 340 m\/s. \u03a5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03ad\u03bd\u03b1 \u03b5\u03c0\u03b9\u03c0\u03bb\u03ad\u03bf\u03bd \u03b2\u03ae\u03bc\u03b1 \u03c0\u03bf\u03c5 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5, \u03ba\u03b1\u03b9 \u03b1\u03c5\u03c4\u03cc \u03b5\u03af\u03bd\u03b1\u03b9 \u03bd\u03b1 \u03b4\u03b9\u03b1\u03b9\u03c1\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf \u03c4\u03b5\u03bb\u03b9\u03ba\u03cc \u03b1\u03c0\u03bf\u03c4\u03ad\u03bb\u03b5\u03c3\u03bc\u03b1 \u03bc\u03b5 \u03c4\u03bf 2. \u0391\u03c5\u03c4\u03cc \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c4\u03bf \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03b5\u03c0\u03b5\u03b9\u03b4\u03ae \u03bc\u03b5\u03c4\u03c1\u03ac\u03bc\u03b5 \u03c4\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b5\u03b9\u03ac\u03b6\u03b5\u03c4\u03b1\u03b9 \u03c4\u03bf \u03b7\u03c7\u03b7\u03c4\u03b9\u03ba\u03cc \u03ba\u03cd\u03bc\u03b1 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03c4\u03b1\u03be\u03b9\u03b4\u03ad\u03c8\u03b5\u03b9 \u03c3\u03c4\u03bf \u03b1\u03bd\u03c4\u03b9\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf \u03ba\u03b1\u03b9 \u03bd\u03b1 \u03b1\u03bd\u03b1\u03ba\u03bb\u03b1\u03c3\u03c4\u03b5\u03af \u03c0\u03af\u03c3\u03c9.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0391\u03c2 \u03c5\u03c0\u03bf\u03b8\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03cc\u03c4\u03b9 \u03b7 \u03b1\u03ba\u03af\u03b4\u03b1 Echo \u03ae\u03c4\u03b1\u03bd HIGH \u03b3\u03b9\u03b1 2 ms. \u0391\u03bd \u03b8\u03ad\u03bb\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf \u03b1\u03c0\u03bf\u03c4\u03ad\u03bb\u03b5\u03c3\u03bc\u03b1 \u03c4\u03b7\u03c2 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03bd\u03b1 \u03c4\u03bf \u03b5\u03ba\u03c6\u03c1\u03ac\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 cm, \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03bc\u03b5\u03c4\u03b1\u03c4\u03c1\u03ad\u03c8\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03c4\u03b9\u03bc\u03ae \u03c4\u03b7\u03c2 \u03c4\u03b1\u03c7\u03cd\u03c4\u03b7\u03c4\u03b1\u03c2 \u03c4\u03bf\u03c5 \u03ae\u03c7\u03bf\u03c5 \u03b1\u03c0\u03cc 340m\/s \u03c3\u03b5 34cm\/ms.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0388\u03c4\u03c3\u03b9, \u03b5\u03ac\u03bd \u03b7 \u03b1\u03ba\u03af\u03b4\u03b1 Echo \u03ae\u03c4\u03b1\u03bd HIGH \u03b3\u03b9\u03b1 2 ms (\u03c4\u03bf \u03bf\u03c0\u03bf\u03af\u03bf \u03bc\u03b5\u03c4\u03c1\u03ac\u03bc\u03b5 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ce\u03bd\u03c4\u03b1\u03c2 \u03c4\u03b7 \u03c3\u03c5\u03bd\u03ac\u03c1\u03c4\u03b7\u03c3\u03b7&nbsp;<strong>pulseIn<\/strong>() \u03b3\u03b9\u03b1 \u03c4\u03bf&nbsp;Arduino, \u03b7 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1 \u03c3\u03c4\u03bf \u03b1\u03bd\u03c4\u03b9\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf \u03b5\u03af\u03bd\u03b1\u03b9 34 cm.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>D<\/em><em>&nbsp;= (<\/em><em>U<\/em><em>&nbsp;x&nbsp;<\/em><em>T<\/em><em>) \/ 2&nbsp;<\/em><strong>= (34cm\/ms x&nbsp;<\/strong><strong>2<\/strong><strong>ms) \/ 2 =&nbsp;<\/strong><strong>34<\/strong><strong>cm.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bd\u03b4\u03ado\u03c5\u03bc\u03b5 \u03c4\u03bf\u03bd \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1 \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03c9\u03bd HC-SR04 \u03c3\u03c4\u03bf Arduino<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0397 \u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03c4\u03bf\u03c5&nbsp;Arduino Uno&nbsp;\u03bc\u03b5 \u03c4\u03bf\u03bd \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03c6\u03b1\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03c3\u03c4\u03bf \u03c3\u03c7\u03ae\u03bc\u03b1 \u03c0\u03bf\u03c5 \u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03b5\u03af. \u039f\u03b9 \u03b1\u03ba\u03c1\u03bf\u03b4\u03ad\u03ba\u03c4\u03b5\u03c2 \u03b3\u03b5\u03af\u03c9\u03c3\u03b7\u03c2&nbsp;GRD&nbsp;\u03ba\u03b1\u03b9 VCC \u03c4\u03b7\u03c2 \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1\u03c2 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03bf\u03cd\u03bd \u03c3\u03c4\u03b7 \u03b3\u03b5\u03af\u03c9\u03c3\u03b7 \u03ba\u03b1\u03b9 \u03c4\u03bf\u03c5\u03c2 \u03b1\u03ba\u03c1\u03bf\u03b4\u03ad\u03ba\u03c4\u03b5\u03c2 5 V \u03c3\u03c4\u03b7\u03bd \u03c0\u03bb\u03b1\u03ba\u03ad\u03c4\u03b1 Arduino \u03b1\u03bd\u03c4\u03af\u03c3\u03c4\u03bf\u03b9\u03c7\u03b1 \u03ba\u03b1\u03b9 \u03bf\u03b9 \u03b1\u03ba\u03c1\u03bf\u03b4\u03ad\u03ba\u03c4\u03b5\u03c2 trig \u03ba\u03b1\u03b9 echo \u03c3\u03b5 \u03bf\u03c0\u03bf\u03b9o\u03b4\u03ae\u03c0\u03bf\u03c4\u03b5 pin Digital I\/O \u03c3\u03c4\u03b7\u03bd \u03c0\u03bb\u03b1\u03ba\u03ad\u03c4\u03b1 Arduino.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"339\" height=\"188\" src=\"https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2_4.jpg\" alt=\"\" class=\"wp-image-440\" style=\"width:332px;height:auto\" srcset=\"https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2_4.jpg 339w, https:\/\/avlos.gr\/wpress\/wp-content\/uploads\/2025\/09\/\u0391\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2_\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2_4-300x166.jpg 300w\" sizes=\"auto, (max-width: 339px) 100vw, 339px\" \/><figcaption class=\"wp-element-caption\">\u03a3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03c4\u03bf\u03c5 HC-SR04<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u039a\u03ce\u03b4\u03b9\u03ba\u03b1\u03c2 Arduino \u03b3\u03b9\u03b1 \u03c4\u03bf\u03bd \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03c9\u03bd HC-SR04<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u039f \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1\u03c2 \u03c0\u03bf\u03c5 \u03c0\u03b1\u03c1\u03b1\u03b8\u03ad\u03c4\u03c9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf\u03c5 Dejan Nedelkovski \u03b1\u03c0\u03cc \u03c4\u03bf site www.HowToMechatronics.com<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>\/\/ defines pins numbers\n\nconst int trigPin = 9;\n\nconst int echoPin = 10;\n\n\/\/ defines variables\n\nlong duration;\n\nint distance;\n\nvoid setup() {\n\npinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\n\npinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\n\nSerial.begin(9600); \/\/ Starts the serial communication\n\n}\n\nvoid loop() {\n\n\/\/ Clears the trigPin\n\ndigitalWrite(trigPin, LOW);\n\ndelayMicroseconds(2);\n\n\/\/ Sets the trigPin on HIGH state for 10 micro seconds\n\ndigitalWrite(trigPin, HIGH);\n\ndelayMicroseconds(10);\n\ndigitalWrite(trigPin, LOW);\n\n\/\/ Reads the echoPin, returns the sound wave travel time in microseconds\n\nduration = pulseIn(echoPin, HIGH);\n\n\/\/ Calculating the distance\n\ndistance = duration * 0.034 \/ 2;\n\n\/\/ Prints the distance on the Serial Monitor\n\nSerial.print(\"Distance: \");\n\nSerial.println(distance);\n\ndelay(500);\n\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u0395\u03c0\u03b5\u03be\u03ae\u03b3\u03b7\u03c3\u03b7 \u03c4\u03bf\u03c5 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a0\u03c1\u03ce\u03c4\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03bf\u03c1\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b9\u03c2 \u03b1\u03ba\u03af\u03b4\u03b5\u03c2 (pin) Trig \u03ba\u03b1\u03b9 Echo. \u03a3\u03b5 \u03b1\u03c5\u03c4\u03ae\u03bd \u03c4\u03b7\u03bd \u03c0\u03b5\u03c1\u03af\u03c0\u03c4\u03c9\u03c3\u03b7 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bf\u03b9 \u03b1\u03ba\u03af\u03b4\u03b5\u03c2 \u03bc\u03b5 \u03b1\u03c1\u03b9\u03b8\u03bc\u03cc 9 \u03ba\u03b1\u03b9 10&nbsp;\u03c3\u03c4\u03b7\u03bd&nbsp;\u03c0\u03bb\u03b1\u03ba\u03ad\u03c4\u03b1 \u03c4\u03bf\u03c5 Arduino \u03ba\u03b1\u03b9 \u03c4\u03b1 \u03bf\u03bd\u03bf\u03bc\u03ac\u03b6\u03bf\u03c5\u03bc\u03b1\u03b9 trigPin \u03ba\u03b1\u03b9 echoPin. \u03a7\u03c1\u03b5\u03b9\u03b1\u03b6\u03cc\u03bc\u03b1\u03c3\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03bc\u03b5\u03c4\u03b1\u03b2\u03bb\u03b7\u03c4\u03ae Long, \u03c0\u03bf\u03c5 \u03bf\u03bd\u03bf\u03bc\u03ac\u03b6\u03b5\u03c4\u03b1\u03b9 &#8220;duration&#8221; \u03b3\u03b9\u03b1 \u03c4\u03bf \u03c7\u03c1\u03cc\u03bd\u03bf \u03c4\u03b1\u03be\u03b9\u03b4\u03b9\u03bf\u03cd \u03c0\u03bf\u03c5 \u03b8\u03b1 \u03bb\u03ac\u03b2\u03bf\u03c5\u03bc\u03b5 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1 \u03ba\u03b1\u03b9 \u03bc\u03b9\u03b1 \u03b1\u03ba\u03ad\u03c1\u03b1\u03b9\u03b1 \u03bc\u03b5\u03c4\u03b1\u03b2\u03bb\u03b7\u03c4\u03ae \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03c4\u03b7\u03bd \u201cdistance\u201d.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>\/\/ defines pins numbers\n\nconst int trigPin = 9;\nconst int echoPin = 10;\n\n\/\/ defines variables\n\nlong duration;\nlong distance;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a3\u03c4o setup \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03bf\u03c1\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf trigPin \u03c9\u03c2 \u03ad\u03be\u03bf\u03b4\u03bf \u03ba\u03b1\u03b9 \u03c4\u03bf echoPin \u03c9\u03c2 \u03b5\u03af\u03c3\u03bf\u03b4\u03bf \u03ba\u03b1\u03b9 \u03b5\u03c0\u03af\u03c3\u03b7\u03c2 \u03bd\u03b1 \u03be\u03b5\u03ba\u03b9\u03bd\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7 \u03c3\u03b5\u03b9\u03c1\u03b9\u03b1\u03ba\u03ae \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03b5\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03c4\u03c9\u03bd \u03b1\u03c0\u03bf\u03c4\u03b5\u03bb\u03b5\u03c3\u03bc\u03ac\u03c4\u03c9\u03bd \u03c3\u03c4\u03b7\u03bd \u03bf\u03b8\u03cc\u03bd\u03b7.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>void setup() {\npinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\npinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\nSerial.begin(9600); \/\/ Starts the serial communication\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a3\u03c4\u03bf\u03bd \u03b2\u03c1\u03cc\u03c7\u03bf \u03c4\u03bf\u03c5&nbsp;loop()&nbsp;\u03c0\u03c1\u03ce\u03c4\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b2\u03b5\u03b2\u03b1\u03b9\u03c9\u03b8\u03bf\u03cd\u03bc\u03b5 \u03cc\u03c4\u03b9 \u03c4\u03bf trigPin \u03b5\u03af\u03bd\u03b1\u03b9 \u03ba\u03b1\u03b8\u03b1\u03c1\u03cc, \u03b5\u03c0\u03bf\u03bc\u03ad\u03bd\u03c9\u03c2 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc\u03bd \u03c4\u03bf\u03bd \u03b1\u03ba\u03c1\u03bf\u03b4\u03ad\u03ba\u03c4\u03b7 \u03c3\u03b5 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 LOW \u03b3\u03b9\u03b1 2 \u03bcs. \u03a4\u03ce\u03c1\u03b1 \u03b3\u03b9\u03b1 \u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03c4\u03bf\u03c5 Ultra \u03b7\u03c7\u03b7\u03c4\u03b9\u03ba\u03bf\u03cd \u03ba\u03cd\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf trigPin \u03c3\u03b5 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7&nbsp;HIGH&nbsp;\u03b3\u03b9\u03b1 10 \u03bcs.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>\/\/ Clears the trigPin\ndigitalWrite(trigPin, LOW);\ndelayMicroseconds(2);\n\n\/\/ Sets the trigPin on HIGH state for 10 micro seconds\ndigitalWrite(trigPin, HIGH);\ndelayMicroseconds(10);\ndigitalWrite(trigPin, LOW);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ce\u03bd\u03c4\u03b1\u03c2 \u03c4\u03b7 \u03c3\u03c5\u03bd\u03ac\u03c1\u03c4\u03b7\u03c3\u03b7 pulseIn() \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf\u03bd \u03c7\u03c1\u03cc\u03bd\u03bf \u03c4\u03b1\u03be\u03b9\u03b4\u03b9\u03bf\u03cd \u03ba\u03b1\u03b9 \u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03b1\u03c5\u03c4\u03ae \u03c4\u03b7\u03bd \u03c4\u03b9\u03bc\u03ae \u03c3\u03c4\u03b7 \u03bc\u03b5\u03c4\u03b1\u03b2\u03bb\u03b7\u03c4\u03ae \u00abduration\u00bb. \u0391\u03c5\u03c4\u03ae \u03b7 \u03c3\u03c5\u03bd\u03ac\u03c1\u03c4\u03b7\u03c3\u03b7 \u03ad\u03c7\u03b5\u03b9 2 \u03c0\u03b1\u03c1\u03b1\u03bc\u03ad\u03c4\u03c1\u03bf\u03c5\u03c2, \u03b7 \u03c0\u03c1\u03ce\u03c4\u03b7 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c4\u03b7\u03c2 \u03b1\u03ba\u03af\u03b4\u03b1\u03c2 Echo \u03ba\u03b1\u03b9 \u03b7 \u03b4\u03b5\u03cd\u03c4\u03b5\u03c1\u03b7 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b7 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 \u03c4\u03bf\u03c5 \u03c0\u03b1\u03bb\u03bc\u03bf\u03cd \u03c0\u03bf\u03c5 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5, \u03b5\u03af\u03c4\u03b5 High \u03b5\u03af\u03c4\u03b5 Low.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>\/\/ Reads the echoPin, returns the sound wave travel time in microseconds<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">duration =&nbsp;pulseIn(echoPin,&nbsp;HIGH);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a3\u03b5 \u03b1\u03c5\u03c4\u03ae\u03bd \u03c4\u03b7\u03bd \u03c0\u03b5\u03c1\u03af\u03c0\u03c4\u03c9\u03c3\u03b7, \u03c7\u03c1\u03b5\u03b9\u03b1\u03b6\u03cc\u03bc\u03b1\u03c3\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03b5\u03c4 \u03c3\u03b5 HIGH, \u03ba\u03b1\u03b8\u03ce\u03c2 \u03bf\u03b9 \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b5\u03c2 HC-SR04 \u03c1\u03c5\u03b8\u03bc\u03af\u03b6\u03bf\u03c5\u03bd \u03c4\u03b7\u03bd \u03b1\u03ba\u03af\u03b4\u03b1 Echo \u03c3\u03b5 High \u03bc\u03b5\u03c4\u03ac \u03c4\u03b7\u03bd \u03b1\u03c0\u03bf\u03c3\u03c4\u03bf\u03bb\u03ae \u03c4\u03b7\u03c2 \u03c1\u03b9\u03c0\u03ae\u03c2 \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03c9\u03bd 8 \u03ba\u03cd\u03ba\u03bb\u03c9\u03bd \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03bf\u03bc\u03c0\u03cc. \u0391\u03c5\u03c4\u03cc \u03bf\u03c5\u03c3\u03b9\u03b1\u03c3\u03c4\u03b9\u03ba\u03ac \u03be\u03b5\u03ba\u03b9\u03bd\u03ac\u03b5\u03b9 \u03c4\u03bf\u03bd \u03c7\u03c1\u03bf\u03bd\u03b9\u03c3\u03bc\u03cc \u03ba\u03b1\u03b9 \u03bc\u03cc\u03bb\u03b9\u03c2 \u03bb\u03ac\u03b2\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf \u03b1\u03bd\u03b1\u03ba\u03bb\u03ce\u03bc\u03b5\u03bd\u03bf \u03b7\u03c7\u03b7\u03c4\u03b9\u03ba\u03cc \u03ba\u03cd\u03bc\u03b1, \u03b7 \u03b1\u03ba\u03af\u03b4\u03b1 Echo \u03b8\u03b1 \u03c0\u03ac\u03b5\u03b9 \u03c3\u03c4\u03bf Low \u03c0\u03bf\u03c5 \u03c3\u03c4\u03b1\u03bc\u03b1\u03c4\u03ac \u03c4\u03bf\u03bd \u03c7\u03c1\u03bf\u03bd\u03b9\u03c3\u03bc\u03cc. \u03a3\u03c4\u03bf \u03c4\u03ad\u03bb\u03bf\u03c2 \u03b7 \u03c3\u03c5\u03bd\u03ac\u03c1\u03c4\u03b7\u03c3\u03b7 \u03b8\u03b1 \u03b5\u03c0\u03b9\u03c3\u03c4\u03c1\u03ad\u03c8\u03b5\u03b9 \u03c4\u03bf \u03bc\u03ae\u03ba\u03bf\u03c2 \u03c4\u03bf\u03c5 \u03c0\u03b1\u03bb\u03bc\u03bf\u03cd \u03c3\u03b5 \u03bc\u03b9\u03ba\u03c1\u03bf\u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0393\u03b9\u03b1 \u03bd\u03b1 \u03c0\u03ac\u03c1\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03b8\u03b1 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03b1\u03c3\u03b9\u03ac\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03b5 0,034 \u03ba\u03b1\u03b9 \u03b8\u03b1 \u03c4\u03b7 \u03b4\u03b9\u03b1\u03b9\u03c1\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b5 \u03c4\u03bf 2 \u03cc\u03c0\u03c9\u03c2 \u03b5\u03be\u03b7\u03b3\u03ae\u03c3\u03b1\u03bc\u03b5 \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03c5\u03bc\u03ad\u03bd\u03c9\u03c2 \u03b1\u03c5\u03c4\u03ae\u03bd \u03c4\u03b7\u03bd \u03b5\u03be\u03af\u03c3\u03c9\u03c3\u03b7.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/\/ Reads the echoPin, returns the sound wave travel time in microseconds<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">duration = pulseIn(echoPin, HIGH);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/\/ Calculating the distance<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">distance = duration * 0.034 \/ 2;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a3\u03c4\u03bf \u03c4\u03ad\u03bb\u03bf\u03c2 \u03b8\u03b1 \u03b5\u03ba\u03c4\u03c5\u03c0\u03ce\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03c4\u03b9\u03bc\u03ae \u03c4\u03b7\u03c2 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03c3\u03c4\u03b7\u03bd \u03bf\u03b8\u03cc\u03bd\u03b7.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u03a4\u03b9\u03c2 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c0\u03bf\u03c5 \u03c0\u03b1\u03c1\u03ad\u03b8\u03b5\u03c3\u03b1 \u03c4\u03b9\u03c2 \u03c0\u03ae\u03c1\u03b1 \u03ba\u03c5\u03c1\u03af\u03c9\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf&nbsp;site<\/p>\n\n\n\n<pre class=\"wp-block-code has-medium-font-size\"><code>https:&#47;&#47;howtomechatronics.com\/tutorials\/arduino\/ultrasonic-sensor-hc-sr04\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ultrasonic Sensor HC-SR04 and Arduino \u03a3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03c0\u03ce\u03c2 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03b5\u03af \u03bf \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03c5\u03c0\u03b5\u03c1\u03ae\u03c7\u03c9\u03bd\u00a0HC-SR04\u00a0\u03ba\u03b1\u03b9 \u03c0\u03ce\u03c2 \u03bd\u03b1 \u03c4\u03bf\u03bd \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b5 \u03c4\u03bf Arduino \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03bc\u03b5\u03c4\u03c1\u03ac\u03bc\u03b5 \u03b1\u03c0\u03bf\u03c3\u03c0\u03ac\u03c3\u03b5\u03b9\u03c2. \u0391\u03c5\u03c4\u03cc\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bf \u03c0\u03b9\u03bf \u03b4\u03b7\u03bc\u03bf\u03c6\u03b9\u03bb\u03ae\u03c2 \u03b1\u03b9\u03c3\u03b8\u03b7\u03c4\u03ae\u03c1\u03b1\u03c2 \u03b3\u03b9\u03b1 \u03bc\u03ad\u03c4\u03c1\u03b7\u03c3\u03b7 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2. \u039c\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c4\u03bf\u03bd \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,12],"tags":[18],"class_list":["post-436","post","type-post","status-publish","format-standard","hentry","category-10","category-12","tag-18"],"_links":{"self":[{"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/posts\/436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/comments?post=436"}],"version-history":[{"count":7,"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/posts\/436\/revisions"}],"predecessor-version":[{"id":448,"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/posts\/436\/revisions\/448"}],"wp:attachment":[{"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/media?parent=436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/categories?post=436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avlos.gr\/wpress\/wp-json\/wp\/v2\/tags?post=436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}