-->
Notification texts go here Contact Us pelacakan

Arduino Door Lock with Smartphone Flashlight Login (Li-Fi project)

 Arduino Door Lock with Smartphone Flashlight Login (Li-Fi project)


This time I will describe to you a simple project where access is made possible in a very unusual way with the help of a flashlight from a smartphone.


There are many different arduino door lock projects, where the access method is using a keyboard, RFID card, biometric device, WiFi, Bluetooth, etc... This time I will describe to you a project where access is made possible in a very unusual way with the help of a flashlight from a smartphone. 


Materials:

4pin Photoresistor, LDR Module

Arduino Nano

Relay SPDT, 12 Volts

RGB led diode

Power MOSFET IRF740


Circuit:

code arduino : 


#define Solenoid 12

#define ldr 8

int Buzzer = 4;

int GreenLed = 6;

int RedLed = 11;

int val;

int val2;

String duration;


void setup() {

  // put your setup code here, to run once:

  Serial.begin(9600);

  pinMode(ldr, INPUT_PULLUP);

  pinMode(Solenoid, OUTPUT);

  pinMode(GreenLed, OUTPUT);

  pinMode(RedLed, OUTPUT);

  digitalWrite(RedLed, HIGH);

}


  void OpenDoor(){             //Lock opening function open for 3s

 

  digitalWrite(Solenoid,HIGH);

  tone(Buzzer, 500);

  digitalWrite(RedLed, LOW);

  digitalWrite(GreenLed, HIGH);

  

  delay(3000);

  digitalWrite(Solenoid,LOW);

  noTone(Buzzer);

  digitalWrite(RedLed, HIGH);

  digitalWrite(GreenLed, LOW);

}


void loop() {

  // put your main code here, to run repeatedly:

  int val = digitalRead(ldr);

  while(val == 0)

  {

    int val2 = digitalRead(ldr);

    duration += val2;

 

    if(duration == "0001")

    {


      OpenDoor();

    }

  

    if(val2 == 1)

    {

      duration = "";

      break;

    }



    delay(200);

  }


}

إرسال تعليق

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.