Password controlled sliding door with SMS alert by pic Microcontroller - solucktech

Latest

solucktech

contact us :(+234)07019218599

Friday, September 14, 2018

Password controlled sliding door with SMS alert by pic Microcontroller







In today’s world implementation of any expert system with maximum data and networking security becomes a real necessity in home, academic  as well as in industrial communities. To provide this security here I give my project on “ password controlled sliding door with SMS alert by pic microcontroller ”.By implementing this project, we can secure our entry from gate without lock and key.

PROJECT AIM:
The proposed system is a chamber, which is closed by a sliding door. A Keypad is situated in front of the door. It will receive the 4 digit combination of number samples. If  password is matched which matched by microcontroller. then allows the motor which is drive to open/close the door of the system, will operate the systems. If anyone attempt three time wrong password then system will disable. It will send alert massage to predetermined Mobile Number that “ Some unauthorized person try to enter the room with out the right pass key”.


Password controlled sliding door with SMS alert by pic Microcontroller.

To complete my project password controlled sliding door with SMS alert by pic microcontroller, I used

1>     Keypad.

2>     Microcontroller PIC16F877A

3>     DC Motor

4>     Threaded  pulley ( To drive the open/close of sliding door)

5>     Threaded  Belt

6>     GSM Module

7>     SIM Card

 Sectionalized description

1)      LCD inter facing with PIC 16f877 for that see my previous post at  Displaying text on LCD by interfaced with PIC16F877 microcontroller in 4 bit mode

2)      Keypad interfacing and number scanning for that see my previous post at Keypad scanning and interfacing with PIC16f877 microcontroller

3)      Sending SMS by GSM module and Pic  microcontroller for that see my previous post at Interfacing GSM module with PIC Microcontroller

4)      Implementing logic to password matching

Project Description:
Now we are come to most interesting project description portion. Where I use a DC motor which is attach with a sliding door and feed drive to Open/Close the door. door is operated by pulley belt mechanism. For taking password, I interface keypad with microcontroller PIC16F877 and set password “2108” to open the door. If someone put password 2018 then motor will rotate clock-wise and door will open. After waiting some delay motor will rotate anti clock wise and door will close. If someone put three times wrong password then he will see the massage “Unauthorized” on LCD. In the same time a text massage send to administrator mobile number. After sending SMS, the whole system will disable until administrator reset it.

Now see the logic which I used for matching the password:
Suppose I set password "2018" and it take in four variable a,b,c,d and use logic

if (a==2) {
               if (b==0)
               {
               if (c==1)
               {
              if (d==8)
               { e=0;}}}}
                      
if e=0 then door will open and e!=0 then count wrong password.





I write the C code on Mikcro c Pro for Pic bellow you will see the C-Code

Embedded C Code
// Name : Password controlled sliding door with SMS alert by pic Microcontroller
// Author : engr lucky
// Date : 15-01-18
// Website : www.sltech360.blogspot.com
int kp4;
char keypadPort at PORTD;
char txt[8];
// LCD module connections
sbit LCD_RS at RB2_bit;
sbit LCD_EN at RB3_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;
sbit LCD_RS_Direction at TRISB2_bit;
sbit LCD_EN_Direction at TRISB3_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;
// End LCD module connections
keypad()
{kp4 = 0; // Reset key code variable
do
// Wait for key to be pressed and released
kp4 = Keypad_Key_Click(); // kp = Keypad_Key_Press();
while (!kp4);
switch (kp4) {
case 1: kp4 = 55; break; // 7 // Uncomment this block for keypad4x4
case 2: kp4 = 56; break; // 8
case 3: kp4 = 57; break; // 9
case 5: kp4 = 52; break; // 4
case 6: kp4 = 53; break; // 5
case 7: kp4 = 54; break; // 6
case 9: kp4 = 49; break; // 1
case 10: kp4 = 50; break; // 2
case 11: kp4 = 51; break; // 3
case 14: kp4 = 48; break; // 0
}
}
void main(){
int a,b,c,d,e=1,i,m,n;
trisC=0;
portC=0;
Keypad_Init();
lcd_Init();
Lcd_Cmd(_LCD_CURSOR_OFF);
UART1_Init(9600); // Initialize UART module at 4800 bps
Lcd_Out(1, 1, “Password:”);
i=0;
m=0;
n=0;
while (i!=3) {
i++;
while (m!=4)
{
m++;
keypad() ;
if (n==0)
{
kp4= kp4-48;
a=kp4;
intToStr(kp4, txt);Lcd_Out(2, 1, txt);
}
if(n==1)
{

b=kp4;
intToStr(b, txt);
// Transform counter value to string
Lcd_Out(2, 1, txt);
}
if(n==2)
{

c=kp4;
intToStr(c, txt);
Lcd_Out(2, 1, txt);
}
if(n==3)
{kp4= kp4-48;
d=kp4;
intToStr(d, txt);
Lcd_Out(2, 1, txt);
}

}
if (a==2)
{
if (b==0)
{
if (c==1)
{
if (d==8)
{
e=0;
}
}
}
}
if (e!=0)
{
Lcd_Out(2, 1, “Wrong”);
delay_ms(400);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 1, “Password:”);
m=0;
n=0;
}
if (e == 0)
{
portc=0b00000101;
delay_ms(200);
portc=0b00000000;
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 1, “Opening”);

Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 1, “Closing”);
delay_ms(14000);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 1, “Password:”);
i=0;
m=0;
n=0;
e=1;
}}
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 1, “Unauthorized”);
Lcd_Out(2, 1, “alert”);
Delay_ms(1000);
UART1_Write_Text(“AT+CMGF=1”);
Delay_ms(1000);
UART1_Write(0x0D); // mean Enter
UART1_Write_Text(“AT+CMGS=”);
Delay_ms(1000);
UART1_Write(0x22); //” double qoute
Delay_ms(2000);
UART1_Write_Text(“+2348131106990″); // Your Telephone Number 
UART1_Write_Text(“Alert”); //My Text Test
UART1_Write(0x22); //” double qoute
Delay_ms(2000);
UART1_Write(26); //Ctr +Z
Delay_ms(2000);
 // mean Enter
Delay_ms(2000);
Lcd_Out(2, 1, “successfully”);
}
 


DO LIKE OUR FACEBOOK PAGE FOR UPDATE

No comments:

Post a Comment