目录
一、项目成品图片
二、项目功能简介
1.主要器件组成
2.功能详解介绍
三、项目原理图设计
四、项目PCB硬件设计
项目PCB图
五、项目程序设计
六、项目实验效果 编辑
七、项目包含内容
一、项目成品图片

哔哩哔哩视频链接:
资料分享看文章末尾
二、项目功能简介
1.主要器件组成
本设计由STM32F103C8T6单片机+WIFI模块ESP8266-01S电路+OLED屏幕电路+DS18B20温度传感器电路+MQ-2烟雾传感器电路+火焰传感器感器电路+红外光电传感器电路+风扇电路+蜂鸣器电路+按键电路+电源电路。
2.功能详解
1、环境采集:DS18B20温度传感器采集温度、MQ-2烟雾传感器检测烟雾浓度是否正常、火焰传感器检测是否发生火灾、红外光电传感器检测恒温箱内是否有物品情况。
2、屏幕显示:OLED屏幕显示当前温度、湿度、烟雾、是否发生火灾、恒温箱内是否有物品、加热状态、降温状态信息
3、物体检测:红外光电传感器检测恒温箱内是否有物品。
4、阈值设置:可以设置恒温箱加热阈值和降温阈值
5、手自动模式:可以设置手动模式和自动模式
6、手动控制:在手动模式下通过按键和app控制降温和加热开关
7、自动恒温:在自动模式下检测到温度小于加热阈值时开启加热,当检测到温度大于设置的降温阈值时开启降温
8、防火报警:实时检测恒温箱是否发生火灾,当检测到火灾时声光报警
9、烟雾报警:实时检测恒温箱烟雾浓度,当检测烟雾浓度大于设置的阈值时声光报警
10、远程控制:通过WIFI连接手机APP,APP可以查看当前环境信息数据,可调节阈值范围
三、项目原理图设计

四、项目PCB硬件设计


五、项目程序设计
#include "stm32f10x.h"
#include "delay.h"
#include "usart.h"
#include "USART2/usart2.h"
#include "GPIO/gpio.h"
#include "dht11.h"
#include "oled.h"
#include "timer.h"
#include "DS1302/ds1302.h"
#include "pwm.h"
/****************破晓电子工作室*******************
*** 破晓单片机
*** 项目:STM32单片机智能恒温箱
*** BILIBILI:破晓单片机
*** 小红书:破晓单片机
*** 授权IP:破晓单片机
*** 淘宝:破晓单片机
*** 淘宝:破晓电子
*** 版本:V01.01
*** MCU:STM32F103C8T6
******************破晓单片机***********************/
//显示界面
CaiDanJieGouTi KeyTab[SIZE_CAIDAN]=
{
{0 ,0 ,0 ,0 ,0 ,Main_Menu0},
{1 ,1 ,1 ,1 ,1 ,Main_Menu1},
{2 ,2 ,2 ,2 ,2 ,Main_Menu2},
{3 ,3 ,3 ,3 ,3 ,Main_Menu3},
{4 ,4 ,4 ,4 ,4 ,Main_Menu4},
{5 ,5 ,5 ,5 ,5 ,Main_Menu5},
{6 ,6 ,6 ,6 ,6 ,Main_Menu6},
{7 ,7 ,7 ,7 ,7 ,Main_Menu7},
{8 ,8 ,8 ,8 ,8 ,Main_Menu8},
} ;
//传感器变量声明
typedef struct
{
uint16_t TEMP;
uint16_t smoke;
uint16_t fire;
uint16_t youren;
}SensorModulesValue;
typedef struct
{
uint16_t TEMPyz;
uint16_t smokeyz;
}SensorThresholdValue;
typedef struct
{
uint8_t mode;
uint8_t hot;
uint8_t fan;
}DriveFlag;
int main(void)
{
delay_init();
TIM3_Int_Init(9,7199);//定时器初始化
OLEDGUI_Config(); //OLED初始化
OLEDGUI_DispString(30,16,"Init...",16,1);
DS18B20_Init(); // DS18B20初始化
key_Init(); //按键初始化
Adc_Init(); //adc初始化
smoke_Init(); //smoke初始化
fire_Init(); //fire初始化
fan_Init(); //fan初始化
hot_Init(); //hot初始化
delay_ms(100);
OLEDGUI_Clear(); //OLEDT清屏
uart1_init(9600);
delay_ms(100);
uart2_init(9600);
delay_ms(100);
uart3_init(9600);//串口初始化
delay_ms(100);
//WIFI初始化
delay_ms(100);
memset((uint8_t *)¤tDataPoint, 0, sizeof(dataPoint_t));
gizwitsInit();
while(1)
{
//获取按键值
key_scan();
//进入菜单界面显示处理数据
GetKeylnput(&Keystatus);
//获取传感器数据
SensorDataGet();
//数据上传
currentDataPoint.valuetitemp=titemp/10;
currentDataPoint.valuewupin=wupin;
currentDataPoint.valuemode=mode;
currentDataPoint.valuesmoke=smoke;
currentDataPoint.valuehuoyan=huoyan;
currentDataPoint.valuehot=hot;
currentDataPoint.valuefan=fan;
tempmin=currentDataPoint.valuetempmin*10;
tempmax=currentDataPoint.valuetempmax*10;
smokeyz=currentDataPoint.valuesmokeyz;
delay_ms(100);
}
}
六、项目实验效果 编辑
七、项目包含内容