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 hours132
Lane Tech HS - PCL - Automatic Door Lock

Things used in this project

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