Professional Documents
Culture Documents
OBJECTIVES
* Arduino uno
* 2x 1k OHM resistors
* Servo
* Wires
* Soldering iron
* Soldering paste
* Soldering tin
* Plier
Step 2: Schematic
3 More Images
Solder he connections for the Arduino, kaypad and servo. When you are
soldering the connection for the keypad and the servo try not to have it in a
place where the programing port on the Arduino UNO touches your soldered
places, I did that once and I almost ended up destroying my Arduino because
the 5v and the GND got connected together when they touched the programing
port.
Step 4: Soldering
Solder the LEDs, resistors and the wires for them, than solder the
rest of the wires, try to cut your wires so that they fit nice and
smooth on the PCB like shown in the photos.
Step 5: The Door Lock
I mounted my servo on an aluminum plate with an simple lock. unfortunately I did not
take any photos when making this but hopefully you will understand how to make it
by the photo, its really easy.
6.CODING
#include <Keypad.h>
#include <Servo.h>
Servo servo_Motor;
char* password = "123";
int position = 0;
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = { 8, 7, 6, 9 };
byte colPins[COLS] = { 5, 4, 3, 2 };
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
int redPin = 12;
int greenPin = 13;
void setup()
{
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
servo_Motor.attach(11);
setLocked(true);
}
void loop()
{
char key = keypad.getKey();
if (key == '*' || key == '#')
{
position = 0;
setLocked(true);
}
if (key == password[position])
{
position ++;
}
if (position == 3)
{
setLocked(false);
}
delay(100);
}
void setLocked(int locked)
{
if (locked)
{
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, LOW);
servo_Motor.write(11);
}
else
{
digitalWrite(redPin, LOW);
digitalWrite(greenPin, HIGH);
servo_Motor.write(90);
}
}
ADVANTAGES:
- Pick-proof: Because there is no place for a key with these locks, the prevent
break-ins because burglars are unable to pick or ‘bump’ the lock. Criminals
methods of breaking and entering are improving and the majority of criminals
can pick an ordinary key lock.
– NO MORE KEYS!: You won’t have to carry around a large set of keys and they
will be less likely to be lost or stolen. Also, if you are a landlord, you
don’t have to give residents keys or replace them if they lose them.
– Control: In a company building, you can control and restrict who goes into
what part of the building. Also residents and landlords of apartments and
flat, can control who can enter their room with one PIN code and it reduces
the risk of anything getting stolen. It is incredibly easy to change the PIN
code whenever you like. The combination door locks from The Workplace Depot
have over 8,000 possible code combinations with a simple code change facility.
– Aesthetically Pleasing: Door locks can come in a range of stylish colours
that look smart and professional. At The Workplace Depot, we sell mechanical
digital door locks in a choice of 3 colours, brass, chrome and satin chrome.
– Perfect for the elderly or disabled: The extra investment into a door lock
could bring massive advantages to those who are unable to get to the door
quickly and/or who struggle with keys.
APPLICATIONS: