目 录
绪论1
1 单片机的概述2
1.1 单片机的发展情况和应用2
1.2 单片机的结构和性能2
2 系统硬件电路的设计5
2.1 系统方案的设计5
2.2 温度传感器的选择5
2.2.1 DS18B20简介5
2.2.2 DS18B20的性能特点6
2.2.3 DS18B20测温原理6
2.3 单片机控制模块的设计7
2.3.1 单片机型号的选择7
2.3.2 单片机接口电路的设计8
2.4 显示电路的设计8
2.4.1 MAX7219简介10
2.4.2 MAX7219内部寄存器和工作模式11
2.5 电源的设计11
3 系统软件的设计13
3.1 显示子程序的设计13
3.1 DS18B20数据采集子程序的设计14
结论16
附录A AT89S52与MAX7219接口程序18
附录B DS18B20数据采集程序20
致 谢22
插图索引
图1 总体框图5
图2 DS18B20外部形状及管脚图6
图3 DS18B20测温原理7
图4 单片机接口电路图8
图5 显示电路原理图9
图6 电源电路12
图7 显示字程序流程13
图8 温度采集程序流程14
基于DS18B20数字温度计的设计
摘 要
本文研制的数字式定时温控系统是一个基于单总线数字式温度传感器DS18B20,以单片机芯片为核心的系统。该系统具有对温度的实时检测功能,实时日历时钟、温度和时间数值的设定等功能。该系统可以应用于发面、菜窖温度控制及保健等领域。
本文首先对测温技术、温度控制技术的现状进行了介绍,对各种控制理论、方案进行了简单的分析与比较;其次根据用户提出的总体要求和技术指标,从工程应用的角度出发,以发面器为主要应用对象进行了硬件部分的设计和选型、软件的设计与分析,且在实现中遵循了简单、经济、实用的原则:然后详细介绍了本系统所用各芯片的特点、工作原理、应用及其与单片机间的通信协议。最后本文对实验、调试和实践应用过程中出现的问题、误差及采用的抗干扰措施进行了分
析和讨论。
【关键词】:数字温度计、单片机、温度传感器、单线技术。
The design of digital thermometer Based on DS18B20
Abstract
This paper developed by Digital Timing is a temperature control system based on single-bus digital temperature sensor DS18B20,microcontroller chip as the core to the system..The system has the temperature of the real-time detection,real-time calendar clock,temperature and time of setting numerical and other features.The system can be applied to Famian,Caijiao temperature control and health and other fields.
In this paper the temperature measurement technology,the status of temperature control technology was introduced the various control theory,the programme carried out a simple analysis and comparison followed by users in accordance with the general requirements and technical indicators, from the engineering point of view,to Famian for application as the main targets of a hardware part of the design and selection,software design and analysis,and follow in the realization of a simple,economic,practical principles:and then described in detail the system used by the chip characteristics,work Principle,and its application MCU and the communication protocol. Finally on this experiment,testing and practical application of the problems in error and the use of anti-jamming measures were discussed.
【Key words】Digital Thermometer MCU Temperature Sensor One-way technology