{"id":2606,"date":"2026-03-21T21:27:20","date_gmt":"2026-03-21T18:27:20","guid":{"rendered":"https:\/\/www.aydiner.gen.tr\/?p=2606"},"modified":"2026-03-21T21:27:20","modified_gmt":"2026-03-21T18:27:20","slug":"akilli-guvenlik-ve-aydinlatma-sistemi","status":"publish","type":"post","link":"https:\/\/www.aydiner.gen.tr\/index.php\/2026\/03\/21\/akilli-guvenlik-ve-aydinlatma-sistemi\/","title":{"rendered":"Ak\u0131ll\u0131 G\u00fcvenlik ve Ayd\u0131nlatma Sistemi"},"content":{"rendered":"<p>Bu senaryoda:<\/p>\n<p>LDR: Hava karard\u0131\u011f\u0131nda (\u0131\u015f\u0131k azald\u0131\u011f\u0131nda) LCD&#8217;de &#8220;Iyi Geceler&#8221; yazacak.<\/p>\n<p>PIR: Hareket alg\u0131lad\u0131\u011f\u0131nda Servo motoru (kap\u0131y\u0131) 90 derece a\u00e7acak ve LCD&#8217;de &#8220;HOSGELDINIZ&#8221; yazacak.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n#include &lt;Wire.h&gt; \r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\n#include &lt;Servo.h&gt;\r\n\r\n\/\/ Tan\u0131mlamalar\r\nLiquidCrystal_I2C lcd(0x27, 16, 2); \r\nServo kap\u0131Servosu;\r\nint pirPin = 2;    \/\/ Dijital Pin\r\nint ldrPin = A0;   \/\/ Analog Pin\r\nint hareketDurumu = 0;\r\nint isikDegeri = 0;\r\n\r\nvoid setup() {\r\n  lcd.init();                      \/\/ LCD&#039;yi ba\u015flat\r\n  lcd.backlight();                 \/\/ Arka \u0131\u015f\u0131\u011f\u0131 a\u00e7\r\n  kap\u0131Servosu.attach(9);           \/\/ Servoyu 9. pine ba\u011fla\r\n  pinMode(pirPin, INPUT);          \/\/ PIR giri\u015f olarak ayarland\u0131\r\n  kap\u0131Servosu.write(0);            \/\/ Ba\u015flang\u0131\u00e7ta kap\u0131 kapal\u0131 (0 derece)\r\n}\r\n\r\nvoid loop() {\r\n  hareketDurumu = digitalRead(pirPin);\r\n  isikDegeri = analogRead(ldrPin);\r\n\r\n  lcd.clear(); \/\/ Ekran\u0131 her d\u00f6ng\u00fcde temizle (veya de\u011fi\u015fim oldu\u011funda)\r\n\r\n  \/\/ 1. Durum: Hareket Alg\u0131lanmas\u0131\r\n  if (hareketDurumu == HIGH) {\r\n    kap\u0131Servosu.write(90);         \/\/ Kap\u0131y\u0131 a\u00e7\r\n    lcd.setCursor(0, 0);\r\n    lcd.print(&quot;HOSGELDINIZ&quot;);\r\n    delay(2000);                   \/\/ 2 saniye bekle\r\n  } else {\r\n    kap\u0131Servosu.write(0);          \/\/ Kap\u0131y\u0131 kapat\r\n  }\r\n\r\n  \/\/ 2. Durum: I\u015f\u0131k Seviyesi Kontrol\u00fc (LDR)\r\n  lcd.setCursor(0, 1);\r\n  if (isikDegeri &lt; 400) {          \/\/ E\u015fik de\u011feri (karanl\u0131k)\r\n    lcd.print(&quot;Gece Modu: ACIK&quot;);\r\n  } else {\r\n    lcd.print(&quot;Gunduz Modu&quot;);\r\n  }\r\n\r\n  delay(500); \/\/ Sens\u00f6r okumas\u0131 i\u00e7in k\u0131sa bekleme\r\n}\r\n\r\n\r\n<\/pre>\n<p>LDR De\u011feri: &#8220;LDR 500&#8217;den k\u00fc\u00e7\u00fckse&#8221; gibi bir \u015fart varsa, if (isikDegeri < 500) k\u0131sm\u0131n\u0131 ona g\u00f6re g\u00fcncellemelisin.\n\nLCD Adresi: E\u011fer kod \u00e7al\u0131\u015fmazsa s\u0131n\u0131ftaki LCD'nin adresi 0x27 yerine 0x3F olabilir.\n\nServo K\u00fct\u00fcphanesi: kod yazarken #include <Servo.h> sat\u0131r\u0131n\u0131 unutmak en s\u0131k yap\u0131lan hatad\u0131r.<\/p>\n<p>I2C Pinleri: LCD&#8217;nin SDA ve SCL pinlerini Arduino&#8217;da do\u011fru yerlere (genelde A4 ve A5) takman gerekti\u011fini hat\u0131rla.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bu senaryoda: LDR: Hava karard\u0131\u011f\u0131nda (\u0131\u015f\u0131k azald\u0131\u011f\u0131nda) LCD&#8217;de &#8220;Iyi Geceler&#8221; yazacak. PIR: Hareket alg\u0131lad\u0131\u011f\u0131nda Servo motoru (kap\u0131y\u0131) 90 derece a\u00e7acak [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2518,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[250],"class_list":["post-2606","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ino","tag-akilli-guvenlik-ve-aydinlatma-sistemi"],"_links":{"self":[{"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/posts\/2606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/comments?post=2606"}],"version-history":[{"count":1,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/posts\/2606\/revisions"}],"predecessor-version":[{"id":2607,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/posts\/2606\/revisions\/2607"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/media\/2518"}],"wp:attachment":[{"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/media?parent=2606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/categories?post=2606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/tags?post=2606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}