Muhammad_Munir
Published © LGPL

Door Lock

How to make IR Door Lock With Arduino and Motor Driver

BeginnerFull instructions provided2,515
Door Lock

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
IR receiver (generic)
×1
TV remote
×1
Car door lock actuator
×1
L298 motor driver
×1
Jumper wires (generic)
×1

Story

Read more

Code

Code

Arduino
#include <IRremote.h>
#define irPin 3

IRrecv irrecv(irPin);
decode_results results;
#define in1 5
#define in2 6
void setup() 
{
    Serial.begin(9600);
    irrecv.enableIRIn();
    
    pinMode(in1, OUTPUT); 
    pinMode(in2, OUTPUT);
}
void loop()
{
   if (irrecv.decode(&results)) 
   {
    Serial.print(results.value, HEX);
    Serial.print(" - ");
    Serial.println(results.value);
      switch (results.value) 
      {
            case 1077989423:
            digitalWrite(in1,HIGH);
            delay(500);
            digitalWrite(in1,LOW);
            delay(250);
            break;
            case 1077964943:
            digitalWrite(in2,HIGH);
            delay(500);
            digitalWrite(in2,LOW);
            delay(250);
            break;
           
           }
 
   irrecv.resume();
   }
}

Credits

Muhammad_Munir
79 projects • 52 followers
I am Arduino programmer, also expertise in ESP32 and 8266 wifi modules.
Contact

Comments

Please log in or sign up to comment.