In today’s world implementation of any expert system with maximum data and networking security becomes a real necessity in home, academic organizations 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”.

Project Objective:

The proposed system is a chamber, which is closed by a sliding door. A Keypad is situated in front of the door, 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 and it will send alert massage to predetermined Mobile Number that “ Some unauthorized parson try to enter the room”. 

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 PIC16F877

3>     DC Motor

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

5>     Threated Belt

6>     GSM Module

7>     SIM Card

 Now question is how to complete this project?

To complete this project you need to divide the  project in small parts

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:

In my project I use a DC motor which is attach with a sliding door and feed drive to Open/Close the door be pulley belt mechanism. And for taking password I interface keypad with microcontroller PIC16F877 and set password “1234” to open the door. If someone put password 1234 then motor will rotate clock-wise and door will open and after waiting some delay motor will rotate anti clock wise and door will close. If someone put three times wrong password then he see the massage “Unauthorized” on LCD. In the same time a text massage send to administrator mobile number and the whole system will disable until administrator reset it.

Now see the logic which I used for matching the password:

Suppose I set password 1234 and it take in four variable a,b,c,d and use logic

if (a==1)
               {
               if (b==2)
               {
               if (c==3)
               {
               if (d==4)
               {
                        e=0;
                        }
                        }
                        }
                        }

if e=0 then door will open and e!=0 then count wrong password.

See the Complete Embedded C Code

Embedded C Code
// Name : Password controlled sliding door with SMS alert by pic Microcontroller
// Author : Subham Dutta
// Date : 15-01-14
// Website : www.nbcafe.in
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)
{
kp4= kp4-48;
b=kp4;
intToStr(b, txt);
// Transform counter value to string
Lcd_Out(2, 1, txt);
}
if(n==2)
{
kp4= kp4-48;
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);
}
n++ ;
}
if (a==1)
{
if (b==2)
{
if (c==3)
{
if (d==4)
{
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”);
delay_ms(6000);
Lcd_Out(2, 1, “Enter”);
delay_ms(8000);
portc=0b00000110;
delay_ms(200);
portc=0b00000000;
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 1, “Closeing”);
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(“9800220107″); // Your Telephone Number cd_chr_cp(uart_rd);
UART1_Write(0x22); //” double qoute
UART1_Write(0x0D); // mean Enter
Delay_ms(2000);
UART1_Write(0x22);
UART1_Write_Text(“Alert”); //My Text Test
UART1_Write(0x22); //” double qoute
Delay_ms(2000);
UART1_Write(26); //Ctr +Z
Delay_ms(2000);
UART1_Write(0x0D); // mean Enter
Delay_ms(2000);
Lcd_Out(2, 1, “successfully”);
}

 See the Video simulation of my project must see