Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Want A door open and close using 8051

Status
Not open for further replies.

friendchooser

Newbie level 5
Joined
Mar 25, 2011
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,341
I want to open a door to be opened with 89c51 as after 90 degree the motor should be of automatically and after A smaalll delay it should close the door
Code:
#include <reg51.h>
void MSDelay(unsigned int);
void main(void)
{


P1=0x55;
MSDelay(15);
P1=0xAA;
MSDelay(15);

}
void MSDelay(unsigned int itime)
{
unsigned int i,j;
for (i=0;i<itime;i++)
for (j=0;j<80;j++);
}



this is the circuit i am using and the motor does not stops :)
plz give an urgent suggestion or ammendments in the code

---------- Post added at 01:26 ---------- Previous post was at 01:25 ----------

The frequency i am giving is through the microcontroller
 

romel_emperado

Advanced Member level 2
Joined
Jul 23, 2009
Messages
606
Helped
45
Reputation
132
Reaction score
65
Trophy points
1,318
Location
philippines
Activity points
6,068
you need to tell us when the door would be open so that we can add a condition in your program.... in short we need little more info about your project
 

friendchooser

Newbie level 5
Joined
Mar 25, 2011
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,341
when the person enters his face will be detected and the door open automatically and after some delay the door will be closed
 

romel_emperado

Advanced Member level 2
Joined
Jul 23, 2009
Messages
606
Helped
45
Reputation
132
Reaction score
65
Trophy points
1,318
Location
philippines
Activity points
6,068
okay...take this example.. you will have basic Idea based in this example..

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void main()
{
   face_detected = 0;
   door_open = 0;
  while(1)
 {
    if(face_detected == 1)
     {
         door_open = 1
         delay_sec(5); 
         face_detected = 0   
     }
     door_close = 1;
 }
}

 

nandhu015

Advanced Member level 5
Joined
Feb 11, 2006
Messages
1,965
Helped
300
Reputation
600
Reaction score
224
Trophy points
1,353
Location
India
Activity points
9,837
It is better to have a sensor at open and close position. Use a limit switch.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top