Thalia Kennedy
Published © GPL3+

Lane Tech HS - PCL - Automatic Door Lock

This project makes it so that whenever I shut my front door, it is immediately locked.

BeginnerFull instructions provided3 hours65
Lane Tech HS - PCL - Automatic Door Lock

Things used in this project

Hardware components

SparkFun Audio-Sound Breakout - WTV020SD
SparkFun Audio-Sound Breakout - WTV020SD
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Photon
Particle Photon
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE

Story

Read more

Schematics

Schematics

How to wire up both sensors.

Code

Final Code

C/C++
int soundSensor = 3;
Servo myservo;
int servoPin = 5;

void setup() {
    pinMode(soundSensor, INPUT);
    myservo.attach(servoPin);
}

void loop() {
    int statusSensor = digitalRead(soundSensor);
    
    if(statusSensor == 1){
        delay(1000);
        myservo.write(180);
        delay(1000);
    }
    else{
        myservo.write(0);
    }
}

Credits

Thalia Kennedy

Thalia Kennedy

3 projects • 2 followers

Comments

Add projectSign up / Login