Dawit Negatu
Published © GPL3+

Lane Tech -PCL- Wifi Door Unlock System Using Particle Cloud

Tedious lock solved using a Particle Photon, L298N driver, and iOS shortcut to allow the user remote access to their door though a phone.

BeginnerFull instructions provided65
Lane Tech -PCL- Wifi Door Unlock System Using Particle Cloud

Things used in this project

Hardware components

L298N Motor Drive Controller Board Module Dual H Bridge DC Stepper For Arduino
×1
25GA-370 DC 12V Micro Motor Speed Reduction Geared Motor for Electronic Lock(30RPM))
×1
6mm to 10mm Plum Flexible Shaft Coupling, Diameter 30mm Length 40mm Aluminium Motor Connector Flexible Spider Coupler for 3D Printer CNC Machine Servo Stepped Motor
×1
Photon
Particle Photon
×1
ALITOVE 12V Power Supply 2A AC Adapter 100-240V 50-60HZ with 10 Tips, 12 Volt 2000mA Replacement Power Cord for LED Strip Light, CCTV Camera, BT Speaker, GPS, Webcam, Router, DC12V Transformer (4.9ft)
×1
5v charger
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Drill, Screwdriver
Drill, Screwdriver

Story

Read more

Code

remotecontrolleddoorlock.ino

C/C++
This is the code needed to run the device. No additional libraries need to be downloaded.
// Include Particle Device OS APIs
#include "Particle.h"


SYSTEM_MODE(AUTOMATIC);

int in1 = 2;
int in2 = 3;
int ena = 4;
//int unlockdoor(String command);
//int lockdoor(String command);

SerialLogHandler logHandler(LOG_LEVEL_INFO);


void setup() {
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(ena, OUTPUT);
  
  //when ios shortcut is clicked to unlock 
  Particle.function("unlock", unlockdoor);
 // when ios shortcut is clicked to lock
  Particle.function("lock", lockdoor);
}


void loop() {
    
}


int lockdoor(String Command){
    digitalWrite(ena,HIGH);
    digitalWrite(in1,HIGH);
    digitalWrite(in2,LOW);
    delay(3000);
    digitalWrite(in1,LOW);
    digitalWrite(ena,LOW);
    
    return 1;
}

int unlockdoor(String Command){
    digitalWrite(ena,HIGH);
    digitalWrite(in1,LOW);
    digitalWrite(in2,HIGH);
    delay(3000);
    digitalWrite(in2,LOW);
    digitalWrite(ena,LOW);
    
    return 1;
    
}

Credits

Dawit Negatu
1 project • 0 followers

Comments