270 [Complete Course Design] Design of Automatic Door Control System Based on 51 Single-chip Microcomputer-Thermal Release-Infrared Obstacle Avoidance-ULN2003

[Resource Download] The download address is as follows:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl

51 Automatic door control system design-heat release-LED-in place-infrared obstacle avoidance-BELL-ULN2003

The design is composed of STC89C52 single-chip circuit + pyro-infrared module circuit + LED indicator circuit + in-position switch detection circuit + infrared obstacle avoidance sensor circuit + buzzer alarm circuit + ULN2003 stepper motor drive circuit + power supply circuit.

1. The pyro-infrared sensor detects whether there is anyone, and the stepper motor stops by default (that is, the door is closed by default). If there is a person, the stepper motor rotates forward (simulating door opening) until the signal is detected by the No. 1 in-position switch (the door is opened to the maximum), the stepper motor stops. If no one is detected again, the stepper motor reverses (simulating door closing), and the stepper motor stops when the signal is detected by the 2H in-position switch (the door is closed). Cycle in turn...

2. When pyro-infrared detects a person, the yellow LED will be on, otherwise the yellow LED will not be on.

3. If the infrared obstacle avoidance sensor detects an obstacle, the buzzer will alarm, otherwise the buzzer will not alarm.

4. If someone is detected during the door closing process, at this time, the stepper motor rotates to open the door.

#define Coil_B1 {A1=0;B1=1;C1=0;D1=0;}//B相通电,其他相断电
#define Coil_C1 {A1=0;B1=0;C1=1;D1=0;}//C相通电,其他相断电
#define Coil_D1 {A1=0;B1=0;C1=0;D1=1;}//D相通电,其他相断电
#define Coil_OFF {A1=0;B1=0;C1=0;D1=0;}//全部断电

unsigned char zfFlag = 0 ;		 //正反转标志
unsigned char guanIng = 1;//关闭过程中
unsigned long time_20ms=0;		   //定时器计数
unsigned char daoweiFlag = 2;//记录当前状态
void Init_Timer0(void);

void main (void)
{     

	Init_Timer0();        //定时器0初始化
	DelayMs(200);          //延时有助于稳定
	while (1)         //主循环
	{

		if(tanTou == 0) buzzer =0 ;//探头检测到报警

 

Guess you like

Origin blog.csdn.net/theroadon/article/details/109261504