1、 基于单片机的酒精浓度检测基于单片机的酒精浓度检测 学 生 姓 名: 指导教师: 合 作 指 导 教 师: 专业名称: 所在学院: 2012 年 5 月 目 录 摘要 I 第 1 章 前言 1 1.1 研究目的和意义 1 1.2 研究内容和方法 1 第 2 章 系统的介绍 2 第 3 章 硬件的选择介绍 . 3 3.1 硬件系统框图 . 3 3.2 传感器的选择 . 4 3.3 LCD 显示器的的选择 . 5 第 4 章 酒精浓度检测的硬件电路设计 8 4.1 89C51 单片机系统 . 8 4.2 A/D 转换电路 12 4.3 LED 显示电路 14 第 5 章 酒精浓度监测的软件设计 1
2、9 5.1 开发环境 19 5.2 程序流程 19 5.3 程序代码编写 21 第 6 章 系统调试与测试结果 27 6.1 电路的调试 27 6.2 浓度与显示之间的关系 28 第 7 章 结论与建议 . 31 致谢. 33 参考文献 . 33 附录. 34 I 摘要 本设计实现了对不同浓度酒精的检测和显示,通过适当改进可以用于检测酒后驾车。本文用 AT89C51 单片机与 MQ-3 型气体传感器实现了对酒精浓度的测量, 并对测量数据进行显示, 同时利 用二极管简单显示浓度的高低,在设计允许值时发出报警。 论文主要研究了(1)硬件方面,MQ-3 气体传感器技术参数的检测和将它接入到酒精浓度检
3、 测模块中;将模拟电压信号放大驱动发光二极管点亮报警;将采集到的模拟电压信号通过单片机 控制经 A/D 转换,得到数字电压信号;用于显示浓度的数码管显示模块。 (2)软件方面,主要研 究了电压到浓度的线性转换和最终浓度值的数码管显示。 (3)对设计的传感器进行了标定。设计 的传感器对酒精气体反应灵敏,能在有效范围内测量它的浓度值。并且在检测低浓度酒精时误差 较小,最大误差为 8.2%满足设计要求。 本文的特色在于标准的确定。对于流动空气,样品的稳定性和水蒸气的影响,提出了解决方 案和验证方法。对不同的区间浓度和电压转换关系做线性化处理,简化了硬件电路的设计。设计 的传感器可以检测不同浓度的酒精
4、气体,改进之后对解决酒后驾车事故和特殊场合酒精检测都可 以使用。 关键词:单片机;A/D 转换;酒精传感器 II Abstract Different concentrations of alcohol solution are detected and showed in the design. The design can be used to the detection of drunk driving through improvement. In this thesis, the concentration of alcohol can be measured and display
5、ed by using the gas sensor based on A T89C51 MCU and MQ-3. At the same time the concentration is displayed by LED, and the system allow to alarm in the certain value. In the thesis Major researches are three points. (1) In the hardware, detecting the technology parameters MQ-3 gas sensor, and connec
6、ting it to a testing part of the alcohol gas concentration; Analog voltage signal amplification to drive light-emitting diode light to alarm; conversing the voltage signal through the A/D conversion at the control of the single-chip, obtaining the digital voltage signal; displaying the concentration in the digital tube display module.(2)In the Software, linear conversion between the concentration of the alcohol and the voltage and the digital displ