[Graduation project] 16-Single-chip microcomputer-based alcohol concentration monitoring system design (schematic diagram + simulation + physical diagram + thesis + defense PPT)

[Graduation project] 16-Single-chip microcomputer-based alcohol concentration monitoring system design (schematic + simulation + source code + physical map + answer essay + answer PPT)

Data download link

mission statement

Main content:
understand and master the basic knowledge of single-chip microcomputer; understand the working principle and basic structure of STC89C52 single-chip microcomputer; design a circuit with alcohol concentration detection function based on single-chip microcomputer; make alarm function and LCD display function, set different according to different environments When the concentration value exceeds the allowable concentration value, an alarm will be issued.
Basic requirements:
1. Master the development of STC89C52 and its working principle and basic structure.
2. Mainly study the linear conversion of voltage to concentration and the LCD display of the final concentration value, and calibrate the designed sensor.
3. It is required that the designed alcohol concentration be measured, and the measurement data be displayed. At the same time, the liquid crystal display is used to simply display the level of the concentration, and an alarm will be issued when it exceeds the allowable value.

Data link
1. Schematic engineering
2. Source code engineering
3. Simulation engineering
4. Physical welding process diagram + physical diagram
5. Thesis (low repetition rate), 22518 words
6. PPT defense

design manual

Summary

In recent years, my country's economy has gradually increased, and the number of private cars has also gradually increased. However, drunk driving behaviors have been repeatedly banned, and the number of road traffic accidents caused by them has increased year by year. This paper designs an alcohol concentration detection system based on a single-chip microcomputer for the current traffic road drunk driving detection behavior, which is used to detect alcohol concentration, and can realize the detection and alarm function of the system by adjusting the alarm concentration of the system. This design system chooses to use STC89C52 single-chip microcomputer, MQ-3 gas sensor as the alcohol concentration detection sensor of the system, ADC0832 as the analog-to-digital converter of the system, and LCD1602 as the liquid crystal display of the system. The working principle of the system is that the alcohol concentration signal detected by the alcohol concentration sensor is passed through the ADC0832, the analog signal is converted into a digital signal, calculated by the single-chip computer, and the output signal of the sensor is processed by the analog-to-digital conversion circuit through the system, and then the data is processed by the single-chip computer. Processing, the concentration value and threshold value are displayed by LCD1602.
Numerous experiments have proved that compared with the previous alcohol meter or mechanical testing equipment, the alcohol testing equipment based on single-chip microcomputer is more sensitive, with higher detection accuracy, accurate and convenient, strong reliability, easy expansion and powerful functions. Sound and light alarm for situations exceeding the threshold, intuitive and accurate. Therefore, it is of certain value to study and design the alcohol detection system based on single-chip microcomputer.

Design framework

insert image description here

Preface 1
Chapter 1 Introduction 2
Section 1 Research background 2
Section 2 Domestic research situation 2 Section 3
Foreign research situation 3
Section 4 Main research content of this paper 3 Section 5
Summary of this chapter 4
Chapter 2 Alcohol concentration detection system scheme Design 5
Section 1 System Function Analysis 5
Section 2 Selection of Main Components of the System 5
1. Single Chip Microcomputer Selection 5
2. Analog-to-Digital Converter Selection 6
3. Display Selection 6 Section
3 System Hardware General Block Diagram 7
4th Chapter Summary 8
Chapter 3 Alcohol Concentration Detection System Hardware Circuit Design 9
Section 1 Main Controller Minimum System Design 9
Section 2 Power Module Design 10 Section
3 Button Circuit Module Design 11
Section 4 LED Display Module Circuit Design
12 Section 5 Circuit Design of LCD Liquid Crystal Display Module 12
Section 6 Circuit Design of Alcohol Concentration Detection Module 14 Section
7 Circuit Design of Buzzer Alarm Module 15 Section 8
Design of System General Circuit Diagram 16
Section 9 Summary of This Chapter 16 Chapter
4 Alcohol Concentration Detection System software design 17
Section 1 Introduction to software development tools 17 Section
2 Overall software architecture design 17
1. Main program design process 17
2. Main program source code 18
Section 3 Key module programming 19
1. Button program design process 19
2. Button program source code 20
Section 4 LCD liquid crystal display module program design 21
1. Liquid crystal display module program design process 21
2. Liquid crystal display program source code 22
Section 5 Alcohol concentration detection module program design 23
一2. Alcohol concentration detection program design process 23
2. Alcohol concentration detection source code 24
Section 6 Buzzer alarm and LED module program design 24
1. Buzzer and LED program design process 24
2. Buzzer and LED program source code
25 Chapter 7 Summary of this Chapter 26
Chapter 5 Simulation Implementation of Alcohol Concentration Detection System 27 Section
1 Introduction of Simulation Development Tools 27 Section 2
Simulation Circuit Construction and Debugging 27
Section 3 System Simulation Test 28
Section 4 Summary of this Chapter 31 Summary
33
Acknowledgments 34
References 35 Appendix
37
1. Original English text 37
2. English translation 40
3. Engineering drawings 44
4. Source code 45

Design instructions and design documents

insert image description here
insert image description here

insert image description hereinsert image description here

Source code display

/*此处的蜂鸣器是NPN型的*/
#include "reg52.H"
#include "1602.h"
#include "ADC0832.h"
#define uchar unsigned char
#define uint  unsigned int
//#include "eeprom52.h"
//声明常量
#define ALCH       80       //报警值
//K_MG_MV和K_ZERO为传感器校准系数,要根据每个MQ-3模块校准
#define K_MG_MV    80/160  //传感器灵敏度系数
#define K_ZERO     20      //传感器零点漂移
//定义按键
sbit Key_Up = P3^6;
sbit Key_Down = P3^7;
//定义LED报警灯
sbit Led_Warn1 = P3^4;
sbit Led_Warn2 = P3^5;
sbit beep=P1^4;		   //蜂鸣器IO口
//定义标识
volatile bit FlagStartAL = 0;  //开始转换标志
volatile bit FlagKeyPress = 0; //有键弹起标志
//全局变量定义
uchar Threshold;	           //酒精浓度上限报警值
uint  ALCounter;                //酒精转换计时器
long   ALValue;                   //酒精测量值
float ALtemp;                    //计算临时变量
uchar n;
uint keyvalue, keyUp, keyDown; //键值
char * pSave;                  //EEPROM存盘用指针
//函数声明
void Data_Init();
void Timer0_Init();
void Port_Init();
void ADC_Init();
uchar GetADVal();
void KeyProcess(uint );
void DELAY(unsigned int t)
{
	while(t!=0)
	t--;
}
//数据初始化
void Data_Init()
{
   ALCounter = 30;
   ALValue = 0;
   Led_Warn1 = 1;
   Led_Warn2 = 2;
   keyvalue = 0;
   keyUp = 1;
   keyDown = 1;
}
void di()
{
   beep = 0;
   DELAY(500);
   beep = 1;
}
void Timer0_Init()
{
	ET0 = 1;        //允许定时器0中断
	TMOD = 0x01;       //定时器工作方式选择
	TL0 = (65536-2000)%256;
	TH0 = (65536-2000)/256;     //定时器赋予初值
	TR0 = 1;        //启动定时器
}
//定时器0中断
void Timer0_ISR (void) interrupt 1 using 0
{
	TL0 = (65536-2000)%256;
	TH0 = (65536-2000)/256;     //定时器赋予初值
	//每1秒钟启动一次AD转换
    ALCounter ++;
    if (ALCounter >= 500)
    {
       FlagStartAL = 1;
	   ALCounter = 0;
    }
}

Guess you like

Origin blog.csdn.net/qq_22592979/article/details/128108688