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 Objective:
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 parson try to enter the room”.
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?
I think to complete this project we 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:
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 “1234” to open the door. If someone put password 1234 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 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 of my project password controlled sliding door with SMS alert by pic microcontroller.
// Author : Subham Dutta
// Date : 15-01-14
// Website : www.nbcafe.in
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”);
}
8 thoughts on “Password controlled sliding door with SMS alert by pic Microcontroller”
Excillent post
Very nice and helpfull and well describe.
Thanks subham keep posting
Im sure about “U R Great”…Please go ahead & never let it drop…!!
Hello, can you post source code for the KEYPAD 3 X 4 without sms alert?
thank you.
greetings there. your project is so impressive. i was mesmeric by the successful of your project and i would like to ask for your kindness if you can help me. in your circuit, if the password is wrong for three times, the system will send a direct message to the mobile phone by GSM. Could you teach me how i can change that GSM pattern with a buzzer such that if the password is entered wrongly for three times, the buzzer will buzz. Thank you for your help. i need to finish my project as soon as possible and i believe you can help me. thanks again mr genius 🙂
greetings there. your project is so impressive. i was mesmeric by the successful of your project and i would like to ask for your kindness if you can help me. in your circuit, if the password is wrong for three times, the system will send a direct message to the mobile phone by GSM. Could you teach me how i can change that GSM pattern with a buzzer such that if the password is entered wrongly for three times, the buzzer will buzz. Thank you for your help. i need to finish my project as soon as possible and i believe you can help me. thanks again mr genius..
interface buzzer send logic 1 to the pin where you connect the buzzer
Hi, i seen your projects really thay are very good , if want or ask from you some programs , can you make these programs to me ( by mony ) ? if yes i will wait your answer , and thanks for you .
Note; iam use Micro C , Proteus and PIC 16F Microcontroller ( specially PIC 16F628A & PIC16F877A).
Electric engineer idreesmuhamed
Comments are closed.