Design of hardware system of smoke alarm based on single-chip microcomputer-bishe course design

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

The fire alarm mainly detects temperature and smoke, and then controls the corresponding alarm and drives the load through the single-chip microcomputer. The current smoke value and temperature value are displayed on the LCD, and the corresponding threshold value is set through the buttons.

The project is mainly for the completion of tasks, including:

(1) Hardware part: including the selection of sensors, the selection of display modules, the design of smoke signal conversion circuit, and the design of alarm drive circuit.

(2) Software part: including the programming of the microprocessor control program and the drawing of the schematic diagram.

(3) Comprehensive debugging and analysis of the system: After the software and hardware are completed, comprehensive testing and experiments should be carried out on the system to analyze the reliability and practicability of the system and adjust the deficiencies of the system.

This design is mainly composed of smoke detection sensor circuit, single chip microcomputer, light alarm circuit, load drive circuit, control program and codec program.

//程序头函数
#include <reg52.h>
//显示函数
#include <display.h>	//显示函数display.h在工程里	也可鼠标选中左边右键open document <display.h>

//宏定义
#define uint unsigned int 
#define uchar unsigned char
#define Data_ADC0809 P1		 //定义P1口为Data_ADC0809 (之后的程序里Data_ADC0809即代表P1口)
 
//管脚声明
sbit LED_yanwu= P2^1;		 //烟雾报警灯
sbit baojing= P2^5;			 //蜂鸣器接口
//ADC0809
sbit ST=P3^3;
sbit EOC=P3^6;
sbit OE=P3^2;
//按键
sbit Key1=P2^6;				 //设置键
sbit Key2=P2^7;				 //加按键
sbit Key3=P3^7;				 //减按键

//酒精含量变量
uchar temp;					 //用于读取ADC数据
uchar yushe_yanwu=45;		 //烟雾预设值
//按钮模式|  
uchar Mode=0;				 //=1是设置温度阀值  =2是设置烟雾阀值

//函数声明
extern uchar ADC0809();
extern void Key();

//ADC0809读取信息
uchar ADC0809()
{
	uchar temp_=0x00;
	//初始化高阻太

	OE=0;
	//转化初始化
	ST=0;
	//开始转换
	ST=1;

Guess you like

Origin blog.csdn.net/AuroraFaye/article/details/115052587