222【Complete Course Design】The temperature control system of rice cooker based on 51 single chip microcomputer

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

51 Rice Cooker Temperature Control System-LCD602-DS18B20-KEY-RELAY

The design is composed of STC89C52 single-chip circuit + DS18B20 temperature detection circuit + button circuit + relay control circuit + LCD1602 liquid crystal display circuit + power supply circuit.

1. The temperature is detected in real time by the DS18B20 temperature sensor, and the upper and lower limits of the temperature can be set by pressing the button. If the current temperature is lower than the set temperature lower limit, the relay is closed, and if the current temperature exceeds the set temperature upper limit, the relay is disconnected.

2. LCD1602 displays the current temperature and temperature threshold in real time.

3. The relay can be connected to the heating load of the hot fast lamp.

#include<reg52.h> //包含头文件,一般情况不需要改动,头文件包含特殊功能寄存器的定义
#include<stdio.h>
#include "18b20.h"
#include "1602.h"
#include "delay.h"		 
	
sbit key1=P2^0;	//引脚定义
sbit key2=P2^1;
sbit key3=P2^2;	  

sbit relay =P1^0;

unsigned char DisFlag=0;		//更新显示标志

unsigned long time20ms=0;	//定时计数

unsigned char ReadTempFlag=0;//定义读时间标志
int temp1;		//温度读取值
float temperature; //实际温度

char dis0[16];//定义显示区域临时存储数组
char dis1[16];			  //温度显示

unsigned int setL = 20;   // 设置 温度下
unsigned int setH = 40;   //设置 温度上
unsigned char SetFlag = 0;//设置标志

 

Guess you like

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