0% found this document useful (0 votes)
430 views

Password Protection Using PIC Microcontroller - The Engineering Projects

Uploaded by

Teo Java
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
430 views

Password Protection Using PIC Microcontroller - The Engineering Projects

Uploaded by

Teo Java
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects

Update (Live)
USA

Check Corona Stats from all over the World !!!

Confirmed 2,007,449
Dead 112,469
Recovered 2,007,449
Cases today 1
Deaths today 2
Tests 21,291,677
Critical 16,923
Active 1,133,272
Cases/IM 6067
Deaths/IM 340

Search
LOGIN SIGNUP

Search

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 1/10
25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects

LOGIN SIGNUP

HOME
BLOG
ENGINEERING TOOLS
JLPCB $2 PCBs
FREE PCB
TURN-KEY PCB Assembly
PCBONLINE

Search
LOGIN SIGNUP

HOME
BLOG
ENGINEERING TOOLS
JLPCB $2 PCBs
FREE PCB
TURN-KEY PCB Assembly
PCBONLINE

HOME
BLOG
ENGINEERING TOOLS
JLPCB $2 PCBs

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 2/10
25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects
FREE PCB
TURN-KEY PCB Assembly
PCBONLINE

Password Protection using PIC Microcontroller


Today, I am going to share a new project which is Password Protection using PIC Microcontroller. In
this project I ...
1. Home
2. Blog
3. PIC Projects
4. Password Protection using PIC Microcontroller

Posted at: Tuesday May 10, 2016


Category: PIC Projects
Author: Syed Zain Nasir
15 Comments
Instant Grammar Checker
Ad Trusted by millions of students, faculty, and professionals
worldwide. Try now
Ad
Grammarly

Download

pcbway
pcbway
Schematic Diagram Pic Programmer Keypad Pic App Compilatore Pic

Password protection using PIC Microcontroller, password protection, password protection system, keypad password protectionHello friends, hope you all are fine
and having fun with your lives. Today, I am going to share a new project which is Password Protection using PIC Microcontroller. In this project I am going to use
keypad and LCD and will be designing a system in which I am gonna drive a motor if the correct password is supplied. If you entered the wrong password then the
motor will not move and you will get another chance to enter the correct password. I hope you guys are gonna enjoy this one.

I have used Keypad, LCD and PIC Microcontroller in order to design the simulation in Proteus ISIS software. You should also have a look at Electronic Door Lock
using PIC Microcontroller, which is quite similar with the only difference of keypad. In that previous project, I have used serial monitor for taking inputs but in
today's tutorial, I have used Keypad for taking inputs. I hope you are gonna enjoy this one.

I have used Proteus software for designing the simulation and I have used MikroC Pro for PIC compiler for designing the programming code for PIC
Microcontroller and I have used PIC16F877 Microcontroller for designing this project. The code and simulation is given below for download. If you have any
problem then ask in comments and I will try my best to resolve them. So, let's get started with Password Protection using PIC Microcontroller.

Password Protection using PIC Microcontroller


You can download the complete simulation along with the code by clicking the below button but as I always suggests that you should design it on your own so
that you get most out of it:

Download Project Files

Access to Top US Brands

Ad Get a Free 30 Day Premium Membership Today!


Ad
MyUS.com

Open
So, now let's design this Password Protection using PIC Microcontroller project, so design a circuit as shown in below figure:

Password protection using PIC Microcontroller, password protection, password protection system, keypad password protection

You can see in the above figure that I have used LCD 20x4 along with Keypad, motor and PIC Microcontroller.
I have also used a transistor which is kind of a driver for DC Motor, because DC motor is operated at 12V while PIC Microcontroller signal is of 5V so we
need this transistor in order to drive our motor.

Note:

If you want to use this new stylish LCD in your Proteus simulation then you need to download and install this New LCD Library for Proteus. All instructions
are given in this link for using this LCD.

Next thing we need to do is to design a programming code for this project.


I have designed the code in MikroC Pro for PIC compiler so copy the below code and paste it in your project of MikroC Pro for PIC and compile to get the
hex file:
unsigned short kp;
char actual_password[] = "123123";

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 3/10
25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects
char given_password[] = "000000";
int count;
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;

sbit LCD_RS_Direction at TRISB4_bit;


sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections

// Keypad module connections


char keypadPort at PORTD;
// End Keypad module connections

void Password_prompt(){
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Out(1, 1, "Motor is Off");
Lcd_Out(2,1,"and Locked");
Delay_ms(1000);

Lcd_Cmd(_LCD_CLEAR); // Clear display


Lcd_Out(1, 1, "Enter 6 digit no:");

Lcd_Cmd(_LCD_BLINK_CURSOR_ON); // Cursor off


Lcd_Cmd(_LCD_SECOND_ROW);
}

//Initialization starts here-------------------------------


void Init(){
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1, 1, "Welcome to");
Lcd_Out(2, 1, "Password Lock");
Lcd_Out(3, 2, "www.TheEngineering");
Lcd_Out(4, 5,"Projects.com");

Delay_ms(5000);
Password_prompt();
TRISB=0;

count=0;
Keypad_Init(); // Initialize Keypad
}
//Initilization ends here----------------------------------------

//Password check routine starts here-----------------------------


int Check_password(){

Lcd_Cmd(_LCD_CLEAR);
if(!memcmp(actual_password, given_password, 6)){
Lcd_Out(1, 1, "Password Matched");
Lcd_Out(2,1,"Motor is on");

return 1;
}
else{
Lcd_Out(1, 1, "Incorrect Password");
Lcd_Out(2, 1, "Try Again!");

Delay_ms(2000);
Password_prompt();
return 0;
//Enter_password();
}
count=0;
}
//Password check routine ends here-----------------------------

void main() {
Init();
do {
kp = 0; // Reset key code variable
if(count==6)
{
PORTB.B7=Check_password(); //0/1 according to password check and drives the motor
count=0;
if(PORTB.B7==1){
Delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
//Lcd_Cmd(_LCD_FIRST_ROW);*/
Lcd_Out(1,1,"Press * to Off");
Lcd_Out(2,1,"and Lock again");
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off

do
// kp = Keypad_Key_Press(); // Store key code in kp variable
kp = Keypad_Key_Click(); // Store key code in kp variable
while (kp!=13);
if(kp==13){
PORTB.B7=0;
Password_prompt();
}
}
}
// Wait for key to be pressed and released

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 4/10
25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects
do
// kp = Keypad_Key_Press(); // Store key code in kp variable
kp = Keypad_Key_Click(); // Store key code in kp variable
while (!kp);
switch (kp) {
case 1: kp = 49;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 1 // Uncomment this block for keypad4x4
case 2: kp = 50;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 2
case 3: kp = 51;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 3
case 4: kp = 65;Lcd_Chr_Cp(kp); break; // A
case 5: kp = 52;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 4
case 6: kp = 53;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 5
case 7: kp = 54;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 6
case 8: kp = 66;Lcd_Chr_Cp(kp); break; // B
case 9: kp = 55;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 7
case 10: kp = 56;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 8
case 11: kp = 57;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 9
case 12: kp = 67;Lcd_Chr_Cp(kp); break; // C
case 13: kp = 42;Lcd_Cmd(_LCD_MOVE_CURSOR_LEFT);count--; break; // *
case 14: kp = 48;Lcd_Chr_Cp(kp);given_password[count]=kp;count++; break; // 0
case 15: kp = 35;Lcd_Cmd(_LCD_MOVE_CURSOR_RIGHT);count++; break; // #
case 16: kp = 68;Lcd_Chr_Cp(kp); break; // D

}
} while (1);

SPONSORED SEARCHES
door lock using pic16f877a schematic diagram

keypad lock with pic16f877a pic programmer

This code is used for design the code for this Password Protection using PIC Microcontroller project.
Now after getting the hex file from this code, upload it in your simulation and if everything goes fine then you will get results as shown in below figure.
The first screen will be look like something as shown below:

Password protection using PIC Microcontroller, password protection, password protection system, keypad password protection

So, its saying Welcome to Password Lock and the the link of our blog.
After that it will ask for 6 digit password, as shown in below figure:

Password protection using PIC Microcontroller, password protection, password protection system, keypad password protection

Now the default password for this project is 123123, so if you have given the correct password then the motor will start moving but if you given the wrong
password then it wont move and will ask for password again.
So, let's give it a wrong password at first:

Password protection using PIC Microcontroller, password protection, password protection system, keypad password protection
CONTROLLINO PLC - 100% compatible with
Arduino
Ad
Ad Robust like an industry PLC, exible like an Arduino. This is
CONTROLLINO.
controllino.com

Learn more

Now you can see in the above figure that when I have given the wrong password then it says Incorrect Password and Try again.
The motor will also remain stationary.
Now I am gonna give it a correct password and we will see the motor will start moving as shown in below figure:

Password protection using PIC Microcontroller, password protection, password protection system, keypad password protection

Now when I have given the correct password, the motor started moving and the LCD says, press * to OFF and Lock again.
So, now when you press * then the motor will stop and it will again ask you to enter 6 digit password.
I have design this below video which will give you a better idea of working of this project:

Password Protection using PIC Microcontroller

So, that's all for today, I hope you have understood all about Password Protection using PIC Microcontroller. Will meet you guys in the next tutorial, till then take
care and have fun !!! :)

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 5/10
25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects

JLCPCB – Prototype 10 PCBs for $2 (For Any Color)


China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

MyUS Delivers Top US PIC Microcontroller CONTROLLINO - PLC Electronic Door Locks
Brands Projects compatible with Arduino using PIC Microcontroller

Ad MyUS.com theengineeringprojects.com Ad controllino.com theengineeringprojects.com

CorelDraw Suite 2020 Complete Guide on Interfacing of Keypad Interfacing of LCD with
Proteus ISIS & ARES with PIC Microcontroller 8051 Microcontroller in
Proteus ISIS
Ad CorelDRAW Graphics Suite theengineeringprojects.com theengineeringprojects.com theengineeringprojects.com

LabView Projects Previous


PLC Projects Next
-Website Author

Syed Zain Nasir


@syedzainnasir

I am Syed Zain Nasir, the founder of The Engineering Projects (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I
am sharing my knowledge through this platform. I also work as a freelancer and did many projects related to programming and electrical circuitry. My Google
Profile+

Follow

Get Connected

Leave a Reply

Leave a Reply

You must be logged in to post a comment.

Comments on ‘’Password Protection using PIC Microcontroller‘’ ( 15 )

1. uwem ibanga says:


May 12, 2016 at 6:52 am

This is a very nice projet. my qustion is 1. how can i change the defualt code of the project. 2. how can two or more motors control using the same project.
kindly help. I am new in microcontoller programming.

Log in to Reply

1. Syed Zain Nasir says:


May 12, 2016 at 7:42 am

Hi,

Add me on Skype and we will discuss it in detail. My Skype id is theenggprojects.

Thanks.

Log in to Reply

1. Eugenia says:
March 2, 2017 at 8:44 pm

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 6/10
25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects
Hello. Thank you for sharing your knowledge. I have a project and I really would like to try this. But I am required to use the PIC16F1829 and
use assembly or C language. Do you think it would work? Can you give me some tips on how to do it? I am an electrical engineer junior student.

2. Sumon Ahmed says:


November 21, 2017 at 5:08 pm

Dear sir, . I need to multiple password system door lock. 2 or 3 different types of password. Like main password, guests password & public
password to open the door & closed the door. Please can you help me… Mail [email protected]

2. ahmed alhazemi says:


January 8, 2018 at 8:27 pm

How inter password original through user (123123)

Log in to Reply

3. Yahia says:
April 1, 2018 at 7:39 am

Plz help
Iam using pic18f4550 with keypad and lcd .
When i realised my project in real. The keypad dont wonna play correct .
Random nbr write in the lcd without any press key .

Log in to Reply

1. Syed Zain Nasir says:


April 1, 2018 at 1:47 pm

Hi,

I think the LCD issue is because of noise. If there’s noise in the data pins of LCD then it shows random noisy characters. As the keypad is concerned, its
quite easy you just need to connect all pins of keypad with any port of PIC so I think issue’s in programming. I would suggest you to work on them one
by one and debug it a lot. You will get good results.

Thanks.

Log in to Reply

2. Abdoulaye Mariko says:


May 4, 2019 at 12:29 am

I face the same problem, did you solve yours? How pls?

Log in to Reply

4. hamza says:
May 30, 2018 at 10:34 pm

bro there is some issue in downloading the files can you kindly send me to gmail.

Log in to Reply

5. Prudence Apejoye says:


July 16, 2018 at 10:08 pm

Thanks so much but i will like to learn more from 6ou am a beginner blinking led

Log in to Reply

6. RABAH BOURETT says:


September 16, 2018 at 3:02 pm

hi
your project is clear more clear than we ewpect

Log in to Reply

7. Anish says:
December 5, 2018 at 5:17 am

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 7/10
25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects
Nice Work Mr. Nasir. i am learning PIC18f microcontroller and i interfaced 16×2 LCD and 4×4 keypad with it and now i am trying to use enter key and
backspace key of keypad, just like our keyboard…
can you please help me about this topic. If u know any logic a
or library about this plz tell me..
if you want to send something …my email id – [email protected]

Log in to Reply

8. A kumar says:
December 26, 2018 at 6:56 pm

Hello Sir,
Thank for shearing this project, i am try to write code for a code lock system according to you, but sir i facing problem in keypad program, can you please
shear your keypad_key_click() code.
thank you

Log in to Reply

9. Abdoulaye Mariko says:


March 15, 2019 at 8:18 am

Hi I am very interrested in your program, I tried to implement it but I got error since I am compiling it through mikro c.
Error: 62 324 Undeclared identifier ‘memcmp’ in expression MyProject.c

Log in to Reply

10. Anis says:


April 8, 2019 at 11:08 pm

HI,i am a student and your tutoriel helped me a lot for my Project but can any one help me telling me how to change defaut password plz ?

Log in to Reply

Top PCB Design Service

JLCPCB PCB Online

Subscribe Now !!!

Learn Free Pro Tricks


RSS YT FB TW
Receive Quality Tutorials Straight in your
Inbox by submitting your Email ID below.
enter your email here... SUBMIT

Join Us !!!

TEP Facebook Page TEP Twitter Page TEP YouTube Channel TEP LinkedIn Page TEP FeedBurner Page TEP Pinterest Page TEP Instagram Page
TEP YouTube Page TEP Google+ Page

Join Our Fb Groups !!!

ARDUINO 2K+
PROTEUS 3K+

Categories
01

Arduino Projects

100 02

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 8/10
25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects
Proteus Projects

10 03

PIC Projects

10 04

Visual Studio Projects

10 05

8051 Projects

10 06

555 Timer Projects

10 07

MATLAB Projects

10 08

LabView Projects

10 09

PLC Projects

10 10

Electronics Projects

10 11

C# Tutorials

10 12

Embeded Systems

10 13

SEO Tutorials

10

Engineering Books

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 9/10
25/11/2020 Password Protection using PIC Microcontroller - The Engineering Projects
THE ENGINEERING PROJECTS

“A platform for engineers & technical professionals to share their engineering projects, solutions & experience with TEP Community & support open source.”

Newsletter

Get weekly notification of engineering articles, straight to your inbox ...


Your email address

Recent Post

LM2576 Buck Converter Datasheet, Pinout, Features & Applications Oct 5,2020

1n4734 Zener Diode Datasheet, Pinout, Features & Applications Oct 5,2020

Top 10 Professional PCB Design Software Oct 5,2020

The Best Technologies for Catching Security Flaws in 2020 Oct 5,2020

7 Most Commonly used Types of PCB (Printed Circuit Board) Oct 5,2020

Popular Tutorials Series

Arduino
PLC
PIC Microcontroller
8051 Microcontroller
Embedded Systems
C#
LabView
Proteus
555 Timer
MATLAB
SEO Tutorials

Contact Us
Skype
theengineeringprojects
Email
[email protected] [email protected] [email protected]
Follow us
Follow us on social media
TERMS & CONDITIONS PRIVACY & POLICY DISCLAMIER CONTACT US

TERMS & CONDITIONS PRIVACY & POLICY DISCLAMIER CONTACT US


Copyright © 2020 TheEngineeringProjects.com. All rights reserved.

https://www.theengineeringprojects.com/2016/05/password-protection-using-pic-microcontroller.html 10/10

You might also like