227 [Complete Course Design] Design of Combustible Gas Liquid Crystal Display Alarm Based on 51 Single Chip Computer

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

51 combustible gas LCD display alarm design-MQ-9-LCD1602-LED

This design consists of STC89C52 single-chip circuit + LCD602 liquid crystal display circuit + A/D sampling PCF8591 circuit + LED indicator circuit + MQ-9 combustible gas sensor circuit + power supply circuit.

1. LCD1602 liquid crystal displays the current combustible gas concentration in real time.

2. If the concentration exceeds a certain value, the red light is on, and if the concentration is lower than this value, the green light is on. (The specific value is determined by Tongwang Technology)

#include<reg52.h> //包含头文件,一般情况不需要改动,头文件包含特殊功能寄存器的定义
#include<stdio.h>
#include "1602.h"
#include "delay.h"
#include "i2c.h"

sbit LED_G = P1^6;	//绿灯
sbit LED_R = P1^5;	//红灯

char dis0[16];			   //打印数组初始化
char dis1[16];			   //打印数组初始化
unsigned long time_20ms=0;		   //定时器计数
unsigned int coNongDu = 0;	//浓度
float Volt=0.0;		  	//检测电压
unsigned char  readAdc = 0; //adc读取标志

void Init_Timer0(void);
void uartSendStr(unsigned char *s,unsigned char length);
void UART_Init(void);
void uartSendByte(unsigned char dat);

 

Guess you like

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