本项目设计是基于51单片机的时钟+温湿度+PM2.5+12864B液晶屏DIY制作的毕业设计,也可以应用于室内环境检测仪。该室内环境检测系统,时间采用专门的DS1302时钟芯片,温湿度采用DHT22模块,比dht11要好。pm2.5采用激光pm2.5检测传感器。51单片机室内环境检测仪成品实物截图:

说明:

没有采用简单的模块堆积,除了激光pm2.5检测传感器以外其他均与电路板一化体设计,同时还增加了时间校准界面,预留了串口调试接口。左侧从上到下依次为PM2.5传感器接口、电源指示灯、电源开关。右侧为四个侧边按键,第一个按键为进入时间校准界面和确定界面,第二个按键为向上按键,第三个按键为向下按键,第四个为返回按键,可以调整年月日时分秒和星期。内置一颗CR2032电池,可以保证断电情况下时间不会中断。为了好看,我自己做了一个亚克力板外壳。很多同学问我pcb的问题,该pcb设计是为了方便做手工pcb打洞,过孔做的小了一些,如果要在网上打样,把过孔调到正常大小。

室内环境检测仪完整代码
室内环境检测仪完整pcb图和原理图
相关芯片传感器数据资料
相关参考文献及文献格式

void showtime();
void showweek();
void showweek1();
void showTH();
void showPM();
void Usartinit();
unsigned char Read_SensorData(void);
unsigned char Read_Sensor(void);
void Delay_N10us(unsigned char t);
void Delay_N1ms(unsigned int t);
void form1();
void form2();
void data1();
void clearping();
void Hgarden(int x);//空心圆
void Sgarden(int x);//实心圆
void timesetting(int x);


/********************************************
界面文字显示
********************************************/
//第1界面显示
unsigned char code CharCode[13]="0123456789.-:";
unsigned char code Temperature[]="温度:";
unsigned char code Tsign[]="℃";
unsigned char code Humidity[]="湿度:";
unsigned char code Hsign[]="RH";
unsigned char code PM1[]="PM2.5:";
unsigned char code TPM1[]="ug/m3";

//第2界面显示
unsigned char code year1[]="年";
unsigned char code mouth1[]="月";
unsigned char code day1[]="日";
unsigned char code hour1[]="时";
unsigned char code minute1[]="分";
unsigned char code second1[]="秒";
unsigned char code week3[]="周";
unsigned char code week1[]="星期";

//清屏
unsigned char code clear[]="                ";

unsigned char code week2_0[]="日";
unsigned char code week2_1[]="一";
unsigned char code week2_2[]="二";
unsigned char code week2_3[]="三";
unsigned char code week2_4[]="四";
unsigned char code week2_5[]="五";
unsigned char code week2_6[]="六";
unsigned int  flagkeyup_down=1;
unsigned int page=1;
unsigned int i,j,m;
unsigned int flag2,flag3;
					
uchar UART_Upload[9];
uchar UARTnum[11]={"0123456789."};
uchar UARTdata[5];
uint pm_rateH,pm_rateL,pm_particle,pm_density;//低脉冲率高位。低脉冲率低位, 比率,颗粒,浓度
uchar accord,pm_URV=20,temp_pM; //PM_URV  pm上限值

【资源下载】下载地址如下(792):https://docs.qq.com/doc/DTlRSd01BZXNpRUxl

版权声明:本文为cczero原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/cczero/p/14634204.html