Discussion in "Project Doubts" started by    onyot    Nov 23, 2010.
Tue Nov 23 2010, 06:56 AM
#21
yes you can make it using ordinary push bottons......

see tutorial section of this site it also have a keypad circuit using simple switches and you can also google for it.....
Tue Nov 23 2010, 06:59 AM
#22
yes. Thats the original concept of keypad. Did u see the code that i attached?

Ang also see this video im using ordinary tact switch here.
m.youtube.com/watch?desktop_uri=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DDaB57MMGz_g%26feature%3Dautofb&feature=autofb&v=DaB57MMGz_g&gl=US

where do u having ur ojt onyot?
Tue Nov 23 2010, 07:04 AM
#23
see this schematic this is simple 4*4 matrix keypad using simple switches...

Tue Nov 23 2010, 07:27 AM
#24
what about 8 seven segment? do you have a link that I can use as a reference?
Tue Nov 23 2010, 09:05 AM
#25
hi onyot.josephian
7-seg is an easy task not difficult
ru using 8 pieces of 7 segments
8051 has 4 ports and 1 segment piece need one port if we drive it by one port
it mean u only can attach a 4 segments to 8051 but not
there r multiplexing techniques that we can attach many 7- segments to only one port
Tue Nov 23 2010, 09:34 AM
#26
hi onyot, there is also multiplexing technique in which u can save ports. There is a multiplexing tutorial here and u must read 8. I suggest u to start in one area like 4 example keypad interfacing an etc. Before u go to more complex things. Good luck to u yar!
Wed Nov 24 2010, 03:41 AM
#27
Romel.. about that program you've given to me... what is the sample password? is it 12345?
Wed Nov 24 2010, 05:51 AM
#28
hi onyot.josephian
i think code was 12345
romel can verify it
Wed Nov 24 2010, 05:56 AM
#29
Majoka, in my project what is best to monitor, especially using a keypad? is it high or low? Is it okay to connect my keypad directly to the pins of 8051?


[ Edited Wed Nov 24 2010, 05:58 AM ]
Wed Nov 24 2010, 06:18 AM
#30
#include <REG51.h>
#define display P3
#define KEYPAD P1

sbit doorclose = P1^7;
sbit correct = P3^5;
sbit wrong= P3^4;
sbit key = P3^7;
void DelayMs(unsigned int);
void save (unsigned char);
void compare (void);

unsigned char keypad[4][3]= { '1', '2', '3',
'4', '5', '6',
'7', '8', '9',
'*', '0', '#'};

unsigned char displayb[4][3]= { 1 , 2 , 3 ,
4 , 5 , 6 ,
7 , 8 , 9 ,
0, 0 , 0};

unsigned char code password[5]= "12345";
unsigned char user[30]; //user is allowed to press 30 keys without entering
unsigned char q,a=0,z=0;
char t=1;
bit true;
char d;









void main(void)
{
unsigned char colloc,rowloc;



while(1)
{

do
{
KEYPAD=0xF0;
colloc=KEYPAD & 0xF0;
}
while(colloc ==0xF0); // if any key pressed
DelayMs(1); // some delay
do
{
colloc=KEYPAD;
colloc &=0xF0;
}while(colloc==0xF0); // to verify is really key pressed

KEYPAD=0xFE;
colloc=KEYPAD & 0xF0;
if(colloc !=0xF0)
{
rowloc=0;
goto next;
}

KEYPAD=0xFD;
colloc=KEYPAD & 0xF0;
if(colloc !=0xF0)
{
rowloc=1;
goto next;
}
KEYPAD=0xFB;
colloc=KEYPAD & 0xF0;
if(colloc !=0xF0)
{
rowloc=2;
goto next;
}

KEYPAD=0xF7;
colloc=KEYPAD & 0xF0;
rowloc=3;
goto next;

next:
if (colloc==0xE0)
{
key=0; // verifying that key is pressed
DelayMs(145);
key=1;
display=((display & 0xf0) | (displayb[rowloc][0])); // display to 7 seg
save(keypad[rowloc][0]);
}
else if(colloc==0xD0)
{
key=0; // verifying that key is pressed
DelayMs(145);
key=1;
display=((display & 0xf0) | (displayb[rowloc][1]));
save(keypad[rowloc][1]);
}
else if(colloc==0xb0)
{
key=0; // verifying that key is pressed
DelayMs(145);
key=1;
display=((display & 0xf0) | (displayb[rowloc][2]));
save(keypad[rowloc][2]);
}
DelayMs(100); // here this delay is important if this is less than 100ms then
// controller understand 1 key as press 2 or 3 times becoz that
//is fast as compaer o our pressing if u want to remove delay from here
// then increse the above 1ms to 100 ms
}
}

void save (unsigned char c)
{
if(c=='*')
{
if(a!=0)
a--;
return;
}

if(a==5 && c=='#')
{
a=0;
compare();

if(t==1)
{
if(true==1) // if match ok
{
DelayMs(800);
correct=0;
t=2;
for(d=0; d<7; d++) // on and after 10 sec off nw keypad can't get data
DelayMs(1000); // max delay u can get is DelayMs(65535) otherwise need looping for big delay
correct=1;
z=0;
a=0; // start agian from 0 location of array

}
else if(true==0)
goto error;

}
else if(t==2)
{
DelayMs(800);
doorclose=0;
t=1;
for(d=0; d<5; d++)
DelayMs(1000);
doorclose=1;
}
}

else if((a>5 && c=='#') || (a<5 && c=='#'))
{
error:
for(q=0; q<5; q++)
{
wrong=0;
DelayMs(420);
wrong=1;
DelayMs(420);
a=0;
}
z=z+1;

if(z==4)
{
for(q=0; q<10; q++)
{
wrong=0;
DelayMs(20000);
wrong=1;
z=0;
DelayMs(420);
}
}
a=0;
}
else
{
user[a]=c;
a++;

if(a==30) // if the user press 31 keys without entering it will automatically indicate an error
{
display=((display & 0xf0) | (displayb[3][1])); //brings a zero display on the seven segment
goto error; //redirect to error code
}
}

} //end of save



void compare (void)
{
unsigned char b;
for(b=0;b<5;b++)
{

if(user[b]==password[b])
true=1;
else
{
true=0;
break;
}
}
}


//---------------------------------------
// Delay mS function
//---------------------------------------
void DelayMs(unsigned int count)
{ // mSec Delay 11.0592 Mhz
unsigned int i;
while(count) {
i = 115;
while(i>0) i--;
count--;
}
}

What type of display is it? seven segment or lcd?

Get Social

Information

Powered by e107 Forum System

Conversation

Fri Aug 07 2020, 08:01 AM
Tony Eldredge
{{Are You interested|Interested|Would you be interested} in {advertising|an advertising service} that {costs|charges} less than {$50|$40|$49|$39} {per month|monthly|every month} and {delivers|sends} {hundreds|thousands|tons} of people who are ready to buy directly to your website? {Check out|Visit|Have a look at|For details visit}: http://www.getwebsitevisitors.xyz |{Looking for fresh buyers?|Want more visitors for your website?|Do you want more people to visit your website?} {Get|Receive} {hundreds|thousands|tons} {of people who are ready to buy sent directly to your website|of keyword targeted visitors directly to your site}. {Boost your profits|Boost revenues} {fast|quick|super fast}. Start seeing results in as little as 48 hours. {For more info|To get details|For additional information|To get info} {Check out|Visit|Have a look at}: http://www.getwebsitevisitors.xyz
Thu Jun 11 2020, 06:27 AM
anudee
sir could please send the code for I2C and wifi interfacing with 8051
scena
Tue May 19 2020, 10:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 07:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 01:39 PM
Tajammul
Sir kindly send the code file i2c for 8051
ExperimenterUK
Fri Mar 13 2020, 10:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 12:55 PM
ABEBE
how can get hadwere of this project
Rohitnani
Sat Mar 07 2020, 05:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 04:58 PM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 10:12 AM
Pearl Olin
Hello,

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 98, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123
Forum Activity
liqian Avatar
Posted By liqian
Fri Aug 07 2020, 03:31 AM
I found the part on here https://www.jotrin.com/pr...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 01 2020, 11:07 PM
PS: I am a new learner thats why my question may s...
Mirza123 Avatar
Posted By Mirza123
Wed Jul 01 2020, 02:05 PM
Thanks for the assistance. I have read the data sh...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 01 2020, 10:12 AM
See section 15 (Ports) of the data sheet. ...
wimac Avatar
Posted By wimac
Tue Jun 30 2020, 10:05 AM
How did you know that it is not 8051. Mirza123It i...
Mirza123 Avatar
Posted By Mirza123
Tue Jun 30 2020, 08:39 AM
It seems ports on the AT89LP2052 is not like on th...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jun 30 2020, 08:34 AM
It seems ports on the AT89LP2052 are not like on t...
Mirza123 Avatar
Posted By Mirza123
Thu Jun 25 2020, 04:07 PM
Hello!i am trying to use AT89LP2052 ( AT89LP2052 h...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jun 17 2020, 09:42 PM
It is about capacitor? i should put it between Vcc...
cerouno Avatar
Posted By cerouno
Wed Jun 17 2020, 10:37 AM
Take another look at the power supply to the LCD.A...