这两年开始毕业设计和毕业答辩的要求和难度不断提升,传统的毕设题目缺少创新和亮点,往往达不到毕业答辩的要求,这两年不断有学弟学妹告诉学长自己做的项目系统达不到老师的要求。
为了大家能够顺利以及最少的精力通过毕设,学长分享优质毕业设计项目,今天要分享的是
毕业设计 stm32火灾监控报警系统(源码+硬件+论文)
学长这里给一个题目综合评分(每项满分5分)
项目分享:
https://gitee.com/sinonfin/sharing
实现功能:
关键代码
showbegin();//开机动画
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
if(HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_7) == 0 || HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_0) == 0|| HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_1) == 1)//进入警报模式
{
jingbao =1;//警报开启
if(HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_7) == 0)//火灾警报
{
huo = 22;//火焰状态着火
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_6,GPIO_PIN_SET);
OLED_Clear();
OLED_ShowCHinese(47,0,10);
OLED_ShowCHinese(64,0,11);
OLED_ShowCHinese(0,2,21);
OLED_ShowCHinese(17,2,22);//
OLED_ShowCHinese(34,2,23);//
showhuo();//显示火灾图片
}
else//火焰状态正常
{
huo = 11;
}
if(HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_0) == 0)//煤气报警
{
mei = 22;
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_6,GPIO_PIN_SET);
OLED_Clear();
OLED_ShowCHinese(24,0,10);//显示文字
OLED_ShowCHinese(41,0,11);
OLED_ShowCHinese(0,2,49);
OLED_ShowCHinese(17,2,50);//
OLED_ShowCHinese(34,2,51);//
OLED_ShowCHinese(51,2,52);//
showmei();//显示泄漏图片
}
else
{
mei = 11;
}
if(HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_1) == 1)//防盗警报
{
ren =22;
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_6,GPIO_PIN_SET);
OLED_Clear();
OLED_ShowCHinese(24,0,10);
OLED_ShowCHinese(41,0,11);//显示汉字
OLED_ShowCHinese(0,2,12);
OLED_ShowCHinese(17,2,13);//
OLED_ShowCHinese(34,2,14);//
OLED_ShowCHinese(51,2,15);//
showman();//显示防盗图片
}
else
{
ren =11;
}
}
else//正常模式
{
huo = 11;
mei = 11;
ren = 11;
if(jingbao == 1)
{
OLED_Clear();
jingbao = 0;//警报解除
}
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_6,GPIO_PIN_RESET);
rt = dht11_read(buf);
OLED_ShowCHinese(0,6,7);//显示温度汉字
OLED_ShowCHinese(15,6,8);
OLED_ShowChar(28,6,':');
OLED_ShowCHinese(68,6,9);//显示湿度汉字
OLED_ShowCHinese(83,6,8);
OLED_ShowChar(96,6,':');
OLED_ShowNum(35,6,buf[2],2,16);//显示温度数值
OLED_ShowCHinese(50,6,48);
OLED_ShowChar(57,6,'C');
OLED_ShowNum(104,6,buf[0],2,16);//显示湿度数值
OLED_ShowChar(121,6,'%');
showtime();
}
if(rxok==1)//读取时间完毕
{
strjw = strtok(rxdata,"-");//分割数组
strjw = strtok(NULL,"-");
times[0] = atoi(strjw);
strjw = strtok(NULL,"-");
times[1] = atoi(strjw);
strjw = strtok(NULL,"-");
times[2] = atoi(strjw);
strjw = strtok(NULL,"-");
times[3] = atoi(strjw);
strjw = strtok(NULL,"-");
times[4] = atoi(strjw);
switch(times[0])//设置月
{
// case 0 : time_buf[2]=0x00;break;
case 1 : time_buf[2]=0x01;break;
case 2 : time_buf[2]=0x02;break;
case 3 : time_buf[2]=0x03;break;
case 4 : time_buf[2]=0x04;break;
case 5 : time_buf[2]=0x05;break;
case 6 : time_buf[2]=0x06;break;
case 7 : time_buf[2]=0x07;break;
case 8 : time_buf[2]=0x08;break;
case 9 : time_buf[2]=0x09;break;
case 10 : time_buf[2]=0x10;break;
case 11 : time_buf[2]=0x11;break;
case 12 : time_buf[2]=0x12;break;
default : time_buf[2]=0x01;
}
switch(times[1])//设置日
{
//case 0 : time_buf[3]=0x00;break;
case 1 : time_buf[3]=0x01;break;
case 2 : time_buf[3]=0x02;break;
case 3 : time_buf[3]=0x03;break;
case 4 : time_buf[3]=0x04;break;
case 5 : time_buf[3]=0x05;break;
case 6 : time_buf[3]=0x06;break;
case 7 : time_buf[3]=0x07;break;
case 8 : time_buf[3]=0x08;break;
case 9 : time_buf[3]=0x09;break;
case 10 : time_buf[3]=0x10;break;
case 11 : time_buf[3]=0x11;break;
case 12 : time_buf[3]=0x12;break;
case 13 : time_buf[3]=0x13;break;
case 14 : time_buf[3]=0x14;break;
case 15 : time_buf[3]=0x15;break;
case 16 : time_buf[3]=0x16;break;
case 17 : time_buf[3]=0x17;break;
case 18 : time_buf[3]=0x18;break;
case 19 : time_buf[3]=0x19;break;
case 20 : time_buf[3]=0x20;break;
case 21 : time_buf[3]=0x21;break;
case 22 : time_buf[3]=0x22;break;
case 23 : time_buf[3]=0x23;break;
case 24 : time_buf[3]=0x24;break;
case 25 : time_buf[3]=0x25;break;
case 26 : time_buf[3]=0x26;break;
case 27 : time_buf[3]=0x27;break;
case 28 : time_buf[3]=0x28;break;
case 29 : time_buf[3]=0x29;break;
case 30 : time_buf[3]=0x30;break;
case 31 : time_buf[3]=0x31;break;
default : time_buf[3]=0x01;
}
switch(times[2])//设置时
{
case 0 : time_buf[4]=0x00;break;
case 1 : time_buf[4]=0x01;break;
case 2 : time_buf[4]=0x02;break;
case 3 : time_buf[4]=0x03;break;
case 4 : time_buf[4]=0x04;break;
case 5 : time_buf[4]=0x05;break;
case 6 : time_buf[4]=0x06;break;
case 7 : time_buf[4]=0x07;break;
case 8 : time_buf[4]=0x08;break;
case 9 : time_buf[4]=0x09;break;
case 10 : time_buf[4]=0x10;break;
case 11 : time_buf[4]=0x11;break;
case 12 : time_buf[4]=0x12;break;
case 13 : time_buf[4]=0x13;break;
case 14 : time_buf[4]=0x14;break;
case 15 : time_buf[4]=0x15;break;
case 16 : time_buf[4]=0x16;break;
case 17 : time_buf[4]=0x17;break;
case 18 : time_buf[4]=0x18;break;
case 19 : time_buf[4]=0x19;break;
case 20 : time_buf[4]=0x20;break;
case 21 : time_buf[4]=0x21;break;
case 22 : time_buf[4]=0x22;break;
case 23 : time_buf[4]=0x23;break;
default : time_buf[4]=0x01;
}
switch(times[3])//设置分
{
case 0 : time_buf[5]=0x00;break;
case 1 : time_buf[5]=0x01;break;
case 2 : time_buf[5]=0x02;break;
case 3 : time_buf[5]=0x03;break;
case 4 : time_buf[5]=0x04;break;
case 5 : time_buf[5]=0x05;break;
case 6 : time_buf[5]=0x06;break;
case 7 : time_buf[5]=0x07;break;
case 8 : time_buf[5]=0x08;break;
case 9 : time_buf[5]=0x09;break;
case 10 : time_buf[5]=0x10;break;
case 11 : time_buf[5]=0x11;break;
case 12 : time_buf[5]=0x12;break;
case 13 : time_buf[5]=0x13;break;
case 14 : time_buf[5]=0x14;break;
case 15 : time_buf[5]=0x15;break;
case 16 : time_buf[5]=0x16;break;
case 17 : time_buf[5]=0x17;break;
case 18 : time_buf[5]=0x18;break;
case 19 : time_buf[5]=0x19;break;
case 20 : time_buf[5]=0x20;break;
case 21 : time_buf[5]=0x21;break;
case 22 : time_buf[5]=0x22;break;
case 23 : time_buf[5]=0x23;break;
case 24 : time_buf[5]=0x24;break;
case 25 : time_buf[5]=0x25;break;
case 26 : time_buf[5]=0x26;break;
case 27 : time_buf[5]=0x27;break;
case 28 : time_buf[5]=0x28;break;
case 29 : time_buf[5]=0x29;break;
case 30 : time_buf[5]=0x30;break;
case 31 : time_buf[5]=0x31;break;
case 32 : time_buf[5]=0x32;break;
case 33 : time_buf[5]=0x33;break;
case 34 : time_buf[5]=0x34;break;
case 35 : time_buf[5]=0x35;break;
case 36 : time_buf[5]=0x36;break;
case 37 : time_buf[5]=0x37;break;
case 38 : time_buf[5]=0x38;break;
case 39 : time_buf[5]=0x39;break;
case 40 : time_buf[5]=0x40;break;
case 41 : time_buf[5]=0x41;break;
case 42 : time_buf[5]=0x42;break;
case 43 : time_buf[5]=0x43;break;
case 44 : time_buf[5]=0x44;break;
case 45 : time_buf[5]=0x45;break;
case 46 : time_buf[5]=0x46;break;
case 47 : time_buf[5]=0x47;break;
case 48 : time_buf[5]=0x48;break;
case 49 : time_buf[5]=0x49;break;
case 50 : time_buf[5]=0x50;break;
case 51 : time_buf[5]=0x51;break;
case 52 : time_buf[5]=0x52;break;
case 53 : time_buf[5]=0x53;break;
case 54 : time_buf[5]=0x54;break;
case 55 : time_buf[5]=0x55;break;
case 56 : time_buf[5]=0x56;break;
case 57 : time_buf[5]=0x57;break;
case 58 : time_buf[5]=0x58;break;
case 59 : time_buf[5]=0x59;break;
default : time_buf[5]=0x01;
}
switch(times[4])//设置星期
{
// case 0 : time_buf[2]=0x00;break;
case 1 : time_buf[7]=0x01;break;
case 2 : time_buf[7]=0x02;break;
case 3 : time_buf[7]=0x03;break;
case 4 : time_buf[7]=0x04;break;
case 5 : time_buf[7]=0x05;break;
case 6 : time_buf[7]=0x06;break;
case 7 : time_buf[7]=0x07;break;
default : time_buf[7]=0x01;
}
ds1302_write_time();
rxok = 0;
}
sprintf(senddata,"%d-%d-%d-%d-%d",buf[2],buf[0],huo,mei,ren);//将温度数值。湿度数值。火灾状态、煤气、防盗、整合到数组
HAL_UART_Transmit_IT(&huart1,"AT+CIPSEND=0,14\r\n",sizeof("AT+CIPSEND=0,14\r\n"));//发送初始化
HAL_Delay(300);
HAL_UART_Transmit_IT(&huart1,senddata,14);//启动发送向手机发送数据
//HAL_Delay(500);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
包含内容
项目分享:
https://gitee.com/sinonfin/sharing