255 [Complete Course Design] Home Anti-theft Alarm Design Based on 51 Single-chip Microcomputer-Photosensitive-Infrared Obstacle Avoidance-GSM

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

51 home anti-theft alarm design-highlight-sound-photosensitive-infrared obstacle avoidance-toggle-GSM-bell

The design is made up of STC89C52 single-chip circuit + highlight LED light circuit + sound sensor module circuit + pyro-infrared sensor circuit + toggle switch circuit + photoresistor module circuit + GSM module SIM800A circuit + power supply circuit.

1. Select the working mode by flipping the switch, dialing up is mode 1, and dialing down is mode 2.

2. Mode 1: When it is dark, there is someone or there is a sound, and the bright LED light turns on for 5s and then goes out. Otherwise the light will not light up

3. Mode 2: Detect whether there are people through pyro-infrared. The sound sensor is used to detect whether there is a sound. If a person is detected and there is a sound, then the GSM SMS module sends a short message "Dangerous!!" to the specific mobile phone, and the buzzer alarm light flashes (the alarm sound and light stop after 5 seconds) . Otherwise, no SMS will be sent and the buzzer will not alarm.

unsigned long times_20ms=0;			  //定时器计数
unsigned int sendLater=0;	//记录是否已经发送了短信
unsigned char i;
unsigned char ledLater = 0;//led处理时间
unsigned char buzLater = 0; //

void Init_Timer0(void);//函数声明
void UART_Init(void);
void SendByte(unsigned char dat);
void SendStr(unsigned char *s,unsigned char length);

void main (void)
{
	Init_Timer0();        //定时器0初始化
	UART_Init();

   	led_gsm=0;		 	//状态led 打开

	for(i=0;i<70;i++)	 		//短暂延时gsm稳定
		{DelayMs(100);}
	SendStr("AT+CMGF=1\r\n",11);	 //设置字符

	led_gsm=1;			//状态led 关闭

 

Guess you like

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