raghavdaboss
Published

Arduino Controlled Servo Door Lock

Lock and unlock your door through your smart phone.

BeginnerFull instructions provided7,384
Arduino Controlled Servo Door Lock

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Paper clip
Tape, Double Sided
Tape, Double Sided
Latch

Story

Read more

Schematics

circuit diagram

Code

Arduino Code for the project

C/C++
Connect your Arduino to your laptop or PC and upload the code
// including the servo library  
#include <Servo.h> 
// declaring and defining myservo
Servo myservo; 
// this variable holds the values that the servo will move
int Position ;

void setup() 
{
  // myservo is connected to PWM pin 9
  myservo.attach(9);
//settin up the baud rate for the bluetooth module and mobile to communicate
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available() > 0)
  {
    //if the values recieved are equal to 0 or 90 the sero will move to the respective angl
    Position = Serial.read();
    if (Position == 0 || Position == 90) {
      myservo.write(Position);
    }
  }
}        

Credits

raghavdaboss

raghavdaboss

1 project • 1 follower

Comments