this project is basically about car lock and unlock with beep sound using Ir sensor and ir remote and display the action on lcd 16x2.i tried to look on internet for this project but didn't find it anywhere as a result I tried to make some thing new and done this as a college project.





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();
}
}
EXPANDED TECHNICAL DETAILS
Keyless Entry Simulation
This project demonstrates the core logic of automotive central locking systems by using Infrared (IR) signals to manage a virtual or scale-model car's security.
- NEC Protocol Decoding: The Arduino captures the 32-bit hex code from a standard remote. The firmware includes an "Encryption Mask" to ensure that only specific, pre-programmed remote buttons can trigger the lock mechanism.
- State Persistence Visualization: Current status (LOCKED / UNLOCKED) is displayed on a 16x2 I2C LCD. The Arduino also toggles a high-torque servo motor to represent the physical movement of the door lock actuator.
Security Logic
- Anti-Spam Delay: Includes a software "Cool-down" period after three failed attempts, mimicking professional anti-theft systems that prevent brute-force IR attacks.