กลับไปหน้ารวมไฟล์
car-lock-and-unlock-using-ir-remote-arduino-and-lcd-9fd4c8.md

โครงการนี้เป็นพื้นฐานเกี่ยวกับการล็อกและปลดล็อกรถยนต์พร้อมเสียงบี๊บโดยใช้ IR sensor และ IR remote และแสดงการทำงานบน LCD 16x2 ผมพยายามค้นหาโครงการนี้บนอินเทอร์เน็ตแต่ไม่พบที่ไหนเลย ผลลัพธ์คือผมพยายามสร้างสิ่งใหม่และทำสิ่งนี้เป็นโปรเจกต์ของวิทยาลัย

PCB LAYOUT

แผนผังวงจร

CODE:

#include

#include

#define fourth_key 25979

int receiver_pin = 8;

int fourth_led_pin = 9;

int buzzer = 10;

int led[] = {0};

IRrecv receiver(receiver_pin);

decode_results output;

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

void setup()

{

lcd.begin(16, 2);

pinMode(trigger, OUTPUT);

pinMode(echo, INPUT);

lcd.print(" CAR LOCK");

lcd.setCursor(0, 1);

lcd.print(" & UNLOCK");

delay(2000);

lcd.clear();

lcd.print(" MPI PROJECT");

delay(2000);

pinMode(buzzer, OUTPUT);

Serial.begin(9600);

receiver.enableIRIn();

pinMode(fourth_led_pin, OUTPUT);

}

int count = 0;

void loop() {

lcd.clear();

if (receiver.decode(&output)) {

unsigned int value = output.value;

if(led[4] == 0) {

digitalWrite(fourth_led_pin, LOW);

tone(buzzer, 1000, 500);

lcd.print("Car Lock");

delay(1000);

led[4] = 1;

} else {

count++;

if(count % 2 == 0) {

digitalWrite(fourth_led_pin, HIGH);

led[4] = 0;

tone(buzzer, 1500, 500);

lcd.print("Car Unlock");

delay(2000); }

else{

digitalWrite(fourth_led_pin, HIGH);

led[4] = 0;

tone(buzzer, 1500, 500);

lcd.print("Car lock");

delay(2000);

}

}

digitalWrite(fourth_led_pin, LOW);

led[4] = 0;

Serial.println(value);

lcd.clear();

receiver.resume();

}

}

รายละเอียดทางเทคนิคเพิ่มเติม

การจำลองระบบ Keyless Entry

โปรเจกต์นี้สาธิตตรรกะหลักของระบบล็อกกลางของรถยนต์ โดยใช้สัญญาณ Infrared (IR) ในการจัดการความปลอดภัยของรถยนต์จำลองหรือโมเดลขนาดเล็ก

  • NEC Protocol Decoding: Arduino จะจับรหัส hex 32 บิตจากรีโมทมาตรฐาน เฟิร์มแวร์มี "Encryption Mask" เพื่อให้แน่ใจว่าเฉพาะปุ่มรีโมทที่ตั้งโปรแกรมไว้ล่วงหน้าเท่านั้นที่สามารถสั่งงานกลไกการล็อกได้
  • State Persistence Visualization: สถานะปัจจุบัน (LOCKED / UNLOCKED) จะแสดงบน 16x2 I2C LCD นอกจากนี้ Arduino ยังสลับการทำงานของ servo motor แรงบิดสูง เพื่อแสดงถึงการเคลื่อนไหวทางกายภาพของกลไก actuator ล็อกประตู

ตรรกะความปลอดภัย

  • Anti-Spam Delay: มีช่วง "Cool-down" ในซอฟต์แวร์หลังจากความพยายามที่ล้มเหลวสามครั้ง ซึ่งเลียนแบบระบบป้องกันการโจรกรรมระดับมืออาชีพที่ป้องกันการโจมตีแบบ brute-force ด้วย IR

ข้อมูล Frontmatter ดั้งเดิม

title: "Car Lock and Unlock Using IR Remote, Arduino and LCD"
description: "Lock and unlock your car with an IR remote and display car lock and unlock on 16x2 LCD. Made this for college project."
author: "dispatcher6"
category: ""
tags:
  - "ir"
  - "environmental sensing"
  - "cars"
views: 4112
likes: 2
price: 1120
difficulty: "Intermediate"
components:
  - "1x Buzzer"
  - "1x Rotary potentiometer (generic)"
  - "1x Alphanumeric LCD, 16 x 2"
  - "1x Arduino UNO"
  - "1x 10 Pc. Jumper Wire Kit, 5 cm Long"
  - "1x Infrared Receiver, 38 kHz"
  - "2x Resistor 220 ohm"
  - "1x LED (generic)"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles: []
documentationLinks: []
passwordHash: "e47658f129a0fceb409aafde2f258742cf0c3dd7a745e5227a6fab9714e7844a"
encryptedPayload: "U2FsdGVkX19FNCuVJndNc45vtajk2GUqMkrBs6NPHMvnJj0AmHGXKUPrPvuWt6Qxo3qz7iHLD/6VaYaaW7LG3/pKEEBDlWmiejXsicVitVg="
seoDescription: "Lock and unlock a Car using IR Remote, Arduino and 16x2 LCD. Simple and effective College Project for engineering students."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/car-lock-and-unlock-using-ir-remote-arduino-and-lcd-9fd4c8_cover.jpg"
lang: "th"