|
Arduino Nano R3 |
x 1 | |
|
LDR module |
x 1 | |
|
IRF7303TRPBFonsemi
|
x 1 | |
|
LEDINDIFFERENT
|
x 2 | |
![]() |
HY1-12VPanasonic Electric Works
|
x 1 | |
|
Resistors |
x 4 |
![]() |
Soldering Iron Kit |
|
![]() |
arduino IDEArduino
|
Arduino Door Lock with Smartphone Flashlight Login (Li-Fi project)
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.
In this way, even double protection is enabled, once a password has to be entered in the APK application, and then that information is transmitted using the light generated by the smartphone flashlight, and there is no way to enter it directly on the lock.
I got the idea from Himanshu Sharma's Li-Fi project from where I also used the .APK application, and adapted the Arduino code for this particular project.
The device is very simple to make and contains only a few components
- Arduino Nano Microcontroller
- LDR resistor module
- 12V Relay
- Power Mosfet Transistor (IRF730)
- Buzzer
- Two LEDs
- and some resistors
On the occasion of the upcoming Christmas and New Year holiydays visit the PCBWay Christmas Big Sales where you will found discounts of up to 50%, as well as many other prizes and benefits. PCBway is one of the most experienced PCB manufacturing company in China in field of PCB prototype and fabrication. They provide completed PCB assembly service with worldwide free shipping, and ISO9001 quality control system. Also, on their site there is an online gerber viewer where you can upload your gerber and drill files to render your board.
The mosfet transistor can be any one with medium or high power, and the relay is designed for 12V operation. As for the LDR module, it contains a LM393 comparator IC, and when the resistor is illuminated, the output voltage should be 0V, and +5V in the dark.
The key to unlock is actually the mobile phone on which the corresponding application is recorded.
First, let's explain how the device works. The smartphone application contains several predefined passwords, and to activate the flash we must enter one of these passwords, in my case it is "hello". Each password generates a flash activation with an exact preset time in milliseconds. On the other hand, the lock is activated only when we bring light to the LDR resistor with the exact time specified in the Arduino code, which should be identical to the time defined in the smartphone application. This time is very precisely defined, so theoretically it is almost impossible to unlock by manually turning the flashlight on and off.
Now let's see how the device works in real conditions:
When switched on, the red LED lights up, which means that the lock is in standby position and is waiting for an opening signal. First, let's try manually turning the flash on and off. As I mentioned before, it is impossible to open the lock this way. Now we will try with the Application. If we enter some random password, the flash is not activated at all. If we enter one of the previously defined passwords that is not common with the Arduino code, the flash is activated, but does not open the lock. Only if we enter the selected password, the door will open, in our case it is "hello". The green LED lights up and the relay is activated for 2 seconds, during which time we can open the door.
And finally, a short conclusion. This is actually not a real Li-Fi communication, it's just a simple light beam with a certain duration, which duration is related to a given operation performed by the arduino. This is just Proof of concept, and in a more advanced case, some useful signal should be modulated in the light, which would then be demodulated in the receiver. This will be the subject of one of my next projects.
#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); } }

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

Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW
ESP32-S3 4.3inch Capacitive Touch Display Development Board, 800×480, 5-point Touch, 32-bit LX7 Dual-core Processor
BUY NOW
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(0)

- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Mirko Pavleski
-
Arduino Eatrthquake alarm and protection system with D7S seismic Sensor Earthquakes are extremely common events around the world. On average, there are fifty earthquakes a...
-
Review and Comparison of Three Inexpensive Metal Detector Kits A metal detector is a device used to detect the presence of metal objects in the ground or other ma...
-
How to make simple Arduino RGB Led strip VU Meter VU meter or volume unit meter is a device intended for visual presentation of the audio signal. It ...
-
DIY Simple Antistress and Relaxation PEMF Device based on Schumannn resonance frequency 7.83 Hz Schumann resonances are global electromagnetic resonances, generated by lightning discharges in the...
-
DIY Si4825 A10 multiband Radio (MW,SW,FM) Thanks to the production of specialized radio chips, nowadays it is possible to make a quality mult...
-
DIY simple HUNTER Led Game with Arduino Some time ago I presented you a simple to make, but interesting game, a 1D version simulation of "P...
-
Arduino 3D Printed self Balancing Cube Self-balancing devices are electronic devices that use sensors and motors to keep themselves balanc...
-
DIY -Spirit PI- ESP32 + Smartphone Sensitive Metal Detector Pulse Induction (PI) metal detector operates on a principle based on sending short pulses of electr...
-
ESP32 Analog style VU meter with GC9A01 Round Dispalys + Peak Meters A typical VU meter measures audio signals and displays them with a visual indicator. In the classic...
-
Arduino two weel self Balancing Robot Self Balancing Robot is device that can balance itself from falling to the ground. Its function is ...
-
ELECROW CrowPanel ESP32 4.2” E-paper Wi-Fi Info-Dispaly Project An e-paper display (also known as an electronic paper display or E Ink display) is a type of screen...
-
ESP32 Fluid simulation on 16x16 Led Matrix Fluid simulation is a way of replicating the movement and behavior of liquids and gases in differen...
-
Simple GU50 VTTC Tesla Coil with MOT (25+cm Spark) Vacuum Tube Tesla Coils are a common choice for homebuilders for several practical reasons. At Soli...
-
Hourglass ESP8266 Code A hourglass, also known as an sand clock, is a device used to measure the passage of time. It consi...
-
Tug of War Arduino Game on WS2812 Led strip A Tug of War is a classic team-based game where two opposing teams compete to pull a rope in opposi...
-
DIY ESP32 Bioresonance Rife Machine with ZAPPER function Rife machine therapy is an alternative treatment developed by Dr. Royal Raymond Rife in the 1930s. H...
-
Arduino VFO Project with a Large LCD Display A Variable Frequency Oscillator (VFO) is an electronic oscillator whose output frequency can be adj...
-
Exploring the Tesla Coil Driver Board, Full Review & Test Results Some time ago I presented you a video in which I analyzed a super cheap Tesla Coil driver that cost...
-
Arduino Eatrthquake alarm and protection system with D7S seismic Sensor Earthquakes are extremely common events around the world. On average, there are fifty earthquakes a...
-
Review and Comparison of Three Inexpensive Metal Detector Kits A metal detector is a device used to detect the presence of metal objects in the ground or other ma...
-
How to make simple Arduino RGB Led strip VU Meter VU meter or volume unit meter is a device intended for visual presentation of the audio signal. It ...
-
DIY Simple Antistress and Relaxation PEMF Device based on Schumannn resonance frequency 7.83 Hz Schumann resonances are global electromagnetic resonances, generated by lightning discharges in the...
-
DIY Si4825 A10 multiband Radio (MW,SW,FM) Thanks to the production of specialized radio chips, nowadays it is possible to make a quality mult...
-
DIY simple HUNTER Led Game with Arduino Some time ago I presented you a simple to make, but interesting game, a 1D version simulation of "P...
-
Arduino 3D Printed self Balancing Cube Self-balancing devices are electronic devices that use sensors and motors to keep themselves balanc...
-
DIY -Spirit PI- ESP32 + Smartphone Sensitive Metal Detector Pulse Induction (PI) metal detector operates on a principle based on sending short pulses of electr...
-
ESP32 Analog style VU meter with GC9A01 Round Dispalys + Peak Meters A typical VU meter measures audio signals and displays them with a visual indicator. In the classic...
-
Arduino two weel self Balancing Robot Self Balancing Robot is device that can balance itself from falling to the ground. Its function is ...
-
ELECROW CrowPanel ESP32 4.2” E-paper Wi-Fi Info-Dispaly Project An e-paper display (also known as an electronic paper display or E Ink display) is a type of screen...
-
ESP32 Fluid simulation on 16x16 Led Matrix Fluid simulation is a way of replicating the movement and behavior of liquids and gases in differen...
-
Modifying a Hotplate to a Reflow Solder Station
457 0 4 -
MPL3115A2 Barometric Pressure, Altitude, and Temperature Sensor
271 0 1 -
-
Nintendo 64DD Replacement Shell
277 0 1 -
V2 Commodore AMIGA USB-C Power Sink Delivery High Efficiency Supply Triple Output 5V ±12V OLED display ATARI compatible shark 100W
700 4 2 -
How to measure weight with Load Cell and HX711
528 0 3 -
-
Instrumentation Input, high impedance with 16 bit 1MSPS ADC for SPI
607 1 0