基于单片机的酒精浓度测试仪设计

苏州科技学院本科生毕业设计(论文)

基于单片机的酒精浓度测试仪设计

摘 要

中国经济的飞速发展使得私家车的占有量越来越高。人们生活水平的提高,车辆的大幅度增多,也使得道路安全问题越来越严重。有些事故是让人回天乏术的,而有些事故是完全可以避免的。比如酒后驾车,这种行为是对自己以及他人生命的严重不负责。为了遏制这种行为,对驾驶员进行酒精浓度测试不失为一种有效的方法。酒精浓度测试仪不仅要能准确测出酒精的浓度,而且要让测试人员读出该浓度。当然也要有报警装置,提醒人们浓度超标。本设计目的在于实现对不同的酒精浓度的检测和显示,通过适当改进可以用于对驾驶员进行是否酒后驾车的检测。本文主要采用STC89C52单片机与MQ-3型气体传感器,而且能够对显示出所测量的数据,加之二极管的使用就可以简单地显示出所测的酒精浓度。当其浓度超过允许值时,检测仪将发出蜂鸣声。

关键词: 酒精浓度检测;STC89C52单片机;MQ-3气体传感器;A/D转换,

I

苏州科技学院本科生毕业设计(论文)

Alcohol tester based on MCU

Abstract

The rapid development of China's economy makes the share of private cars increase. What’s more, the improvement of people's living standards and a substantial increase in the vehicle makes the road safety problem get worse. Some accidents are beyond resurrection, while others are completely can be avoided . Such as drunk driving. such behavior is serious not responsible to their and the others’ lives . In order to curb this behavior, the driver alcohol test is an effective method. Alcohol tester is not only able to accurately measure the concentration of alcohol, but also can let testers reads the concentration. Of course, we have an alarm system to alert people to the concentration exceeded. The design aims to achieve different alcohol concentration detection and display. And it can be used for the driver is drunk driving tests through appropriate improvements. This paper uses STC89C52 MCU and MQ-3 Gas Sensor as the main devices. With the use of the diode, the alcohol tester can display the measured data and simply show the alcohol concentration measured. When the concentration exceeds the allowable value, the detector will beep.

Keywords STC89C52 microcontroller; MQ-3 gas sensor; A/D conversion

II

苏州科技学院本科生毕业设计(论文)

目 录

第1章 绪论 ............................................................................................................................................. 1

1.1 酒精测试仪现状和发展趋势 ..................................................................................................... 1 1.2 酒精浓度检测仪设计的意义 ..................................................................................................... 1 1.3 研究内容 .................................................................................................................................... 2 1.4 系统总体思路 ............................................................................................................................. 2 第2章 系统总体方案设计.................................................................................................................... 3

2.1 总体设计 ..................................................................................................................................... 3 2.2控制模块方案论证 ...................................................................................................................... 3 2.3显示模块方案论证 ...................................................................................................................... 4 第3章 硬件电路设计............................................................................................................................ 5

3.1 单片机电路设计 ......................................................................................................................... 5

3.1.1 单片机介绍 ...................................................................................................................... 5 3.1.2 STC89C52的功能特性 .................................................................................................... 6 3.1.3 STC89C52的原理说明 .................................................................................................... 6 3.2 MQ3气体传感器 ........................................................................................................................ 7

3.2.1 MQ-3主要技术指标 ........................................................................................................ 8 3.2.2 MQ-3结构、外形、测试电路 ........................................................................................ 8 3.2.3 MQ-3传感器调理电路 .................................................................................................. 10 3.3 电源电路 ................................................................................................................................... 11 3.4 ADC0809 ................................................................................................................................... 11 3.5 LCD液晶显示模块 ................................................................................................................... 12

3.5.1 LCD1602显示模块技术参数 ........................................................................................ 12 3.5.2 LCD602显示模块功能 .................................................................................................. 13 3.6 发光二极管显示报警电路 ....................................................................................................... 15 3.7阈值存储电路............................................................................................................................ 15 3.8 系统硬件设计原理图分析 ....................................................................................................... 16 第4章软件系统的设计与实现 .............................................................................................................. 18

4.1 主程序设计 ............................................................................................................................... 18 4.2 分部分软件设计 ....................................................................................................................... 19

4.2.1 ADC程序流程图 ........................................................................................................... 19 4.2.2 LCD程序流程图 ............................................................................................................ 20

III

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4