摘 要
随着时代的进步和发展,单片机技术已经普及到我们生活、工作、科研、各个领域,已经成为一种比较成熟的技术。在工业生产中温度是常用的被控参数,而采用单片机来对这些被控参数进行控制已成为当今的主流。传统的测温元件有热电偶和二电阻。而热电偶和热电阻测出的一般都是电压,再转换成对应的温度,这些方法相对比较复杂,需要比较多的外部硬件支持。我们用一种相对比较简单的方式来测量。我们采用美国DALLAS半导体公司推出的DS18B20作为检测元件,温度范围为-55~125 ºC,最高分辨率可达0.0625 ºC。DS18B20可以直接读出北侧温度值,而且采用三线制与单片机相连,减少了外部的硬件电路,具有低成本和易使用的特点。电路采用DS18B20作为温度监测元件,测量范围-50℃-~+120℃,使用LED模块显示,能设置温度报警上下限。该电路设计新颖、功能强大、结构简单。
关键词 温度测量;DS18B20;AT89S52
ABSTRACT
With the progress and development of the times, SCM technology has been popular to our lives, work, research, various fields, has become a relatively mature technology. In industrial production temperature is commonly used in the accused parameters, and the use of single-chip to control the control parameters have become the mainstream of today. The traditional thermometer has thermocouples and two resistors. The thermocouple and thermal resistance are generally measured voltage, and then converted to the corresponding temperature, these methods are relatively complex, the need for more external hardware support. We use a relatively simple way to measure. We use the United States DALLAS Semiconductor introduced the DS18B20 as a detection component, the temperature range of -55 ~ 125 ºC, the highest resolution of up to 0.0625 ºC. DS18B20 can directly read the north side of the temperature value, and the use of three-wire system connected with the microcontroller to reduce the external hardware circuit, with low cost and easy to use features. Circuit using DS18B20 as a temperature monitoring components, measuring range -50 ℃ - ~ +120 ℃, the use of LED module display, can set the upper and lower temperature alarm. The circuit design novel, powerful, simple structure.
Key words temperature measurement; DS18B20; AT89S52
目 录
1 设计课题任务、功能要求说明及总体方案介绍 1
1.1 设计任务 1
1.2 功能要求说明 1
1.3 总体方案介绍及工作原理说明 1
2 硬件系统的设计 3
2.1 硬件系统各模块功能简要介绍 3
2.2 温度传感器介绍 3
2.3 电路原理图、PCB图和元器件布局图 5
2.4 元器件清单 5
3 软件系统的设计 6
3.1 使用的单片机资源的情况 6
3.2 程序流程 6
3.3 部分子程序程序清单及说明 11
3.4 程序清单 14
4 设计结论、仿真结果和教学建议 15
4.1 设计结论 15
4.2 使用说明及仿真结果 15
4.3 误差分析 18
4.4 设计体会 18
4.5 教学建议 19
参考文献 20
致 谢 21
附 录 22
附录Ⅰ 原理图 22
附录Ⅱ PCB图 23
附录Ⅲ 元器件分布图 24
附录Ⅳ 元器件清单 25
附录Ⅴ 总程序清单 26