DS18B20数字式温度传感器毕业论文中英文资料外文翻译文献
- 格式:pdf
- 大小:554.57 KB
- 文档页数:26
DS18B20Programmable Resolution1-WireDigital Thermometer1、DS18B20FEATURES(1)Unique1-Wire interface requires only one Port pin for communication,requires no external components(2)Each device has a unique64-bit serial code stored in an onboard ROM(3)Can be powered form data line.Power supply range is3.0Vto5.5V(4)Measures temperatures form-55℃to+125℃,±0.5℃accuracy from-10℃to +85℃(5)Thermometer resolution is user-selected from9to12bits(6)Converts temperature to12-bit digital word in750ms(max)(7)Alarm search command identifies and addresses devices whose temperature is outside of programmed limits(temperature alarm condition)(8)Available in8-pin SOIC,and3-bin TO-92packages2、DS18B20BLOCK DIAFRAMFigure1shows a block diagram of the DS18B20,The64-bite ROM stores the device’s serial code.The scratchpad memory contains the2-byte temperature egister that stores the digital output from the temperature sensor.In addition,the scratchpad provides access to the1-byte upper and lower alarm trigger register(TH and TL),and the1-byte configuratuion register.The configuration register allows the user to set the resolution of the temperature-to-digital conversion to9,10,11or12bits.The TH,TL and configuration registers are nonvolatile(EEPROM),so they will retain data when the device is powered down.Figure1block diagram of the DS18B203、DS18B20ROM COMMANDS(1)SEARCH ROM[0F0H]When a system is initially powered up,the master must identify the ROM codes of all slave devices on the bus,which allows the master to determine the number of slaves and their device types.The master learns the ROM codes through a process of elimination that requires the master to perform a Search ROM cycle as many times as necessary to identify all of the slave’s64-bit ROM devices.(2)READ ROM[55H]This command can only be used when there is one slave on the bus.It allows the bus master to read the slave`64-bit ROM code without using the Search ROM procedure.If this command is used when there is more than one slave present on the bus,a data collision will occur when all the slaves attempt to respond at the same time.(3)MATCH ROM[55H]The match ROM command followed by a64-bit ROM code sequence allows the bus master to address a specific DS18B20on a multidrop or single-drop bus.Only the DS18B20that exactly matches the64-bitROM code sequence will respond to thefunction command issued by the master;all other slaves on the bus will wait for a reset pulse.(4)SKIP ROM[0CCH]The master can use this command to address all devices on the bus simultaneously without sending out any ROM code information.Note that the Read Scratchpad command can follow the Skip ROM command only if there is a single slave device on the bus.In this case time is saved by allowing the master to read from the slave without sending the device’s64-bit ROM code.A Skip ROM command followed by a Read Scratchpad command will cause a data collision on the bus if there is more than one slave since multiple devices will attempt to transmit data simultaneously.(5)ALARM SEARCH[0ECH]The operation of this command is identical to the operation of the Search ROM command except that only slaves with a set alarm flag will respond.This command allows the master device to determine if any DS18B20s experienced an alarm condition during the most recent temperature conversion.Refer to the OPERATION-ALARM SIGNAING section for an explanation of alarm flag operation.(6)CONVERTT[44H]This command initiates a single temperature conversion.Following the conversion,the resulting thermal data is stored in the2-bute temperature register in the scratchpad memory and the DS18B20returns to its low-power idle state.If the device is being used in parasite power mode,within10us after this command is issued the master must enable a strong pullup on the1-Wire bus for the duration of the conversion as described in the POWERING THE DS18320section.If the DS18B20 is powered by an external supply,the master can issue read time slots after the Convert T command and the DS18B20will respond by transmitting a0while the temperature conversion is in Progress and a1when the conversion is done.In parasite power mode this notification technique cannot be used since the bus1is pulled high by the strong pullup during the conversion.(7)WRITE SCRACHPAD[4EH]This command allows the master to write3bytes of the data to the DS18B20’s scratchpad.The first data byte is writer into the TH register,the second byte is written into the TL register,and the third byte is written into the configuration register. Data must be transmitted least significant bit first.All three bytes must be written before the master issues a reset,or the data may be corrupted.(8)READ SCRACHPAD[0BEH]This command allows the master to read the contents of the scratchpad.The data transfer starts with the least significant bit of byte0and continues through the scratchpad until9byte(byte8-CRC)is read.The master may issue a reset to terminate reading at any time if only partof the scratchpad data is needed.(9)COPY SCRATCHPAD[48H]This command copies the contents of the scratchpad TH,TL and configuration registers to EEPROM.If the device is being used in parasite power mode,within 10us(max)after this command is issued the master must enable a strong pullup on the 1-Wire bus for at least10ms as described in the POWERING THE DS18B20section.(10)RECALL E2[B8H]This command recalls the alarm trigger values(TH and TL)and configuration data from EEPROM,respectively,in the scratchpad memory.The master device can issue read time slots following the Recall E2command and the DS18B20will indicate the status of the recall by transmitting0while the recall is in progress and1 when the recall is done.The recall operation happens automatically at power-up,so valid data is available in the scratchpad as soon as power is applied to the device.DS18B20单总线数字温度计1、DS18B20的特性(1)独特的单总线接口只占用一个I/O端口,而无需外围元件;(2)可以由总线提供电源,电压适用范围为3.0V~5.5V;(3)测量温度范围为-55℃~+125℃,在-10℃~+85℃范围内精度为±0.5℃;(4)每个DS18B20含有一个唯一的64位ROM编码;(5)用户可以通过编程实现9~12位的温度分辨率;(6)分辨率为12时最大转换时间为750ms;(7)报警搜索命令可识别哪片DS18B20温度超限;(8)采用3脚T0-92或8脚SOIC封装。
DS18B20数字温度计的设计摘要温度是一种最基本的环境参数,人们生活与环境温度息息相关,在工业生产过程中需要实时测量温度,在工业生产中也离不开温度的测量,因此研究温度的测量方法和控制具有重要的意义。
本论文介绍了一种以单片机为主要控制器件,以DS18B20为温度传感器的新型数字温度计。
主要包括硬件电路的设计和系统程序的设计。
硬件电路主要包括主控制器,测温控制电路和显示电路等,主控制器采用单片机AT8 9C52,温度传感器采用美国DALLAS半导体公司生产的DS18B20,显示电路采用8位共阴极LED数码管,ULN2803A为驱动的动态扫描直读显示。
测温控制电路由温度传感器和预置温度值比较报警电路组成,当实际测量温度值大于预置温度值时,发出报警信号,即发光二极管亮。
系统程序主要包括主程序,测温子程序和显示子程序等。
DS18B20新型单总线数字温度传感器是DALLAS 公司生产的单线数字温度传感器, 集温度测量和 A /D转换于一体,直接输出数字量,具有接口简单、精度高、抗干扰能力强、工作稳定可靠等特点。
由于采用了改进型智能温度传感器DS18B20作为检测元件,与传统的温度计相比,本数字温度计减少了外部的硬件电路,具有低成本和易使用的特点。
DS18B20温度计还可以在高温报警、远距离多点测温控制等方面进行应用开发,具有很好的发展前景。
此外,还介绍了系统的调试和性能分析。
关键词:显示电路,单片机,AT89C52,温度传感器,DS18B20 ,单总线IThe Design of DS18B20 Digit ThermometerABSTRACTTemperature is a basic parameters of the environment, people's lives a nd the environment are closely related to temperature. in the course of ind ustrial production immediate need for temperature measurement in industrial production has to do with temperature measurement, The study o f the temperature measurement and control is of great significance.The paper introduced one kind new digital thermo meter that take the Micro Controller Unit as the primary control component and take DS18B20 as the temperature sensor. Mainly included the design of the hardware electric circuit and the design of the system program .The hardware electric circuit mainly included the master controller, the temperature measured electric circuit and the display circuit and so on, the master contro ller used Micro Controller Unit AT89C52, the temperature sensor used DS18B20 which the American DALLAS semiconductor company produces, the disp lay circuit used 8 altogether anodes LED numerical code tube by the dynamic scanning method straight to read the demo nstration.ULN2803A-driven dynamic scan showed straight time. Temperature control circuit fro m temperature sensors and preset temperature value compared alarm circuit components, When measured temperature greater than preset temperature value, issued warning signal that the bright light emitting diodes. The system program mainly included the master routine, the temperature subroutine, the data renovates subroutine and so on. DS18B20 is a digital temperature sensor of single bus .It is producted by DALLAS cooperation . DS18B20 assemb les temperature measure and A /D converter, exports digital signal directly, operation easily, better precise, protecting disturb, running steably and so on.IIBecause used the advanced version intelligence temperature sensor DS18B20 as the examine part, compared with the traditio nal thermo meter, this d igital thermo meter reduced the exterior hardware electric circuit, has characteristic that the low cost and was easy to use. The DS18B20 therm ometer also may used to the high temperature warning, the long-distance ran ge multi- spots temperature measured aspect and so on temperature contro l carries on the applicatio n development, has the very good prospects for development. In addition, introduced the system debugging and the perform ance analysis.KEY WORDS:Disp lay Circuit, Microcontroller Unit , AT89C52,Temperature Sensor, DS18B20,1-WireIII目录前言 (1)第1章设计任务及方案分析 (2)§1.1 设计任务及要求 (2)§1.2 设计总体方案及方案论证 (2)§1.3 温度测量的方案与分析 (2)§1.3.1 芯片选择 (2)§1.3.2 实现方法简介 (3)§1.3.3 测温流程图 (3)第2章芯片功能简介 (4)§2.1 A T89C52的功能简介 (4)§2.1.1 A T89C52芯片简介 (4)§2.1.2 引脚功能说明 (4)§2.2 DS18B20的功能简介 (7)§2.2.1 芯片简介 (7)§2.2.2 DS18B20外形和内部结构 (8)§2.2.3 DS18B20的工作时序 (11)§2.2.4 DS18B20与单片机的典型接口设计 (12)§2.2.5 DS18B20的各个ROM命令 (13)第3章系统硬件电路的设计 (15)§3.1 主控制电路和测温控制电路原理图 (15)§3.2 驱动电路模块原理图 (16)§3.3 显示模块原理图 (17)第4章软件编程调试及性能分析 (18)§4.1 主程序流程图 (18)§4.2 主程序 (19)§4.3 温度子程序 (21)§4.3.1 DS18B20复位子程序 (22)IV§4.3.2 读DS18B20子程序 (23)§4.3.3 写DS18B20子程序 (25)§4.3.4 比较报警子程序 (26)§4.3.5 按键子程序 (27)§4.4 显示子程序 (27)§4.5 调试性能分析和注意事项 (29)§4.5.1 调试性能分析 (29)§4.5.2 DS18B20使用中的注意事项 (30)结论 (31)参考文献 (32)致谢 (33)附录 (34)V前言日常生活及工农业生产中经常要用到温度的检测及控制,在冶金、食品加工、化工等工业生产过程中,广泛使用的各种加热炉、热处理炉、反应炉等,都要求对温度进行严格控制。
毕业设计(论文)外文文献翻译文献、资料中文题目:基于DS18B20的单片机温度测量系统文献、资料英文题目:文献、资料来源:文献、资料发表(出版)日期:院(部):专业:班级:姓名:学号:指导教师:翻译日期: 2017.02.14《单片机原理及应用》课程设计报告课题名称:单片机测温系统设计分院:教研室:电气工程及其自动化班级:姓名:学号:指导教师:基于DS18B20的单片机温度测量系统引言随着人们生活水平的不断提高,单片机控制无疑是人们追求的目标之一,它所给人带来的方便是不可否定的,各种数字系统的应用也使人们的生活更加舒适。
数字化控制、智能控制为现代人的工作、生活、科研等方面带来方便。
其中数字温度计就是一个典型的例子。
数字温度计与传统的温度计相比,具有读数方便、测温范围广、测温精确、功能多样话等优点。
其主要用于对测温要求准确度比较高的场所,或科研实验室使用,该设计使用STC89C52单片机作控制器,数字温度传感器DS18B20测量温度,单片机接受传感器输出,经处理用LCD1602液晶实现温度值显示。
一设计要求1 用字符型液晶显示模块LCD1602显示实时室温等数据,如下图所示(仅供参考,可个性化差异设计,如显示姓名等):2 单片机完成对DS18B20的温度数据传输控制,要求显示精确到0.1℃。
二硬件设计1 系统框图如下图:2 温度检测模块在该模块中,采用DS18B20温度传感器作为温度采集芯片。
DS18B20温度传感器是达拉斯公司生产的一种单总线芯片,它的测温范围为-55℃~+125℃,固有测温分辨率0.5℃,具有使用简单、工作稳定的优点。
可以适用于工业生产、家庭应用等场合。
DS18B20在完成准确的温度变换时,I/O线上必须提供足够的功率,解决这一问题就是在DQ和电源之间加上4.7k的上拉电阻。
3 单片机控制模块由前所述,单片机由于其各种优点,是一种常用的控制器件。
80C51单片机是第三代单片机中的典型代表,在该设计中,单片机作为控制模块,接受来自按键模块、时间模块、温度检测模块的信息,来控制液晶显示模块的显示信息。
分辨率可编程单总线数字温度传感器——DS18B201 概述1.1 特性:⏹独特的单总线接口,只需一个端口引脚即可实现数据通信⏹每个器件的片上ROM 都存储着一个独特的64 位串行码⏹多点能力使分布式温度检测应用得到简化⏹不需要外围元件⏹能用数据线供电,供电的范围3.0V~5.5V⏹测量温度的范围:-55℃~+125℃(-67℉~+257℉)⏹从-10℃~+85℃的测量的精度是±0.5℃⏹分辨率为9-12 位,可由用户选择⏹在750ms 内把温度转换为12 位数字字(最大值)⏹用户可定义的非易失性温度报警设置⏹报警搜索命令识别和针对设备的温度外部程序限度(温度报警情况)⏹可采用8 引脚SO(150mil)、8引脚μSOP和3引脚TO-92 封装⏹软件兼容DS1822⏹应用范围包括:恒温控制、工业系统、消费类产品、温度计和任何的热敏系统图1 DS18B20引脚排列图1.2 一般说明DS18B20数字温度计提供9至12位的摄氏温度测量,并具有非易失性的用户可编程触发点的上限和下限报警功能。
DS18B20为单总线通信,按定义只需要一条数据线(和地线)与中央微处理器进行通信。
DS18B20能够感应温度的范围为-55~+125℃,在-10~+85℃范围内的测量精度为±0.5℃,此外,DS18B20 可以直接从数据线上获取供电(寄生电源),而不需要一个额外的外部电源。
每个DS18B20都拥有一个独特的64位序列号,因此它允许多个DS18B20作用在一条单总线上,这样,可以使用一个微处理器来控制许多DS18B20分布在一个大区域。
受益于这一特性的应用包括HAVC 环境控制、建筑物、设备和机械内的温度监测、以及过程监测和控制过程的温度监测。
注意: A "+"符号在封装上也标有图2 订购信息表1 DS18B20详细引脚说明* 表中所有未列出的引脚都是NC (空接)2 工作原理及功能2.1 温度测量DS18B20 的核心功能是它的直接数字温度传感器器,其分辨率可由用户配置为9、10、11 或者12 位,相应的增量值分别0.5℃、0.25℃、0.125℃和0.0625℃。
The DS-18B20 number temperature spreads a feeling machine The DS-18B20 number temperature spreads a feeling machine, the product adoption's United States' DALLAS company produces of DS18 B20 can set net number the temperature spread the feeling machine chip to pack but become and have to bear to whet to bear to touch, the physical volume is small, use convenience, seal to pack a form diverse, be applicable to various narrow and small space equipments number to measure moderate control realm.1、the technique function describe:1.1 special single lines connect a people's method, DS18 B20 while linking with microprocessor only need a line can immediately carry out the double of microprocessor and DS18 B20 toward the communication.1.2 measure scope-55 ℃ ~ +125 ℃ , proper measure resolution's0.5 ℃ .1.3 support several set nets function, several DS18 B20s can merge at unique three on-line, the most can merge 8, if amount was excessive, it would make power supply the power electric voltage over low, result in thus the signal delivers of unsteady, the realizations order to measure more1.4 work the power:3~5V|DC1.5 don't need any outer circle component in the use1.6 measure the result measure a way string with 9~12 numbers line transmission1.7 stai nless steels protect to take care of diameter Φ 61.8 be applicable to DN15~25, DN 40~ DN250 various equipments that lie industrial piping of quality and narrow and small space measure1.9 standards install the thread M10 X1, M12 X1.5, the G 1|2 term chooses1.10 PVC electric cable direct the line or virtuous type ball type connect line box line, the easy to and other electric appliances equipments links.2、Application2.1 products are applicable to cold storage, food Cang, keep a bottle, tele-communications engine room, electric power engine room, cable slot etc. measures moderate control realm2.2 stalk tiles, urn body, the Fang machine, the air condition, waits industrial equipments of narrow and small space to measure a moderate control.2.3 car air condition, refrigerator, cold cabinet, and medium low temperature dry box of etc.s.2.4 provide hot|make cold piping calories to calculate, the central air condition divides a thermal energy to calculate to measure a moderate control with industrial realm3、Product model number and specificationThe model number measures scope to install thread electric cable length to apply pipingThe B20 -55~125s TS-18s have no 1.5 msTS-18B20A -55~125 M10X1 1.5m DN15~25The B20 TS-181|s Bs-55~125ses 2 Gs connects line box DN40~ 60 4、Connect line elucidationThe characteristics special front line connects, needs a line to correspond by letter to order more ability and simplified a distribute type the temperature spread the feeling application didn't need an external component to use data total line power supply, the electric voltage scope has never needed to provide for use the power diagraph temperature scope for the 3.0-5.5 Vs BE-55 ℃ to+125 ℃ .The Fahrenheit is equal hence-67-257 Fahrenheit degree-10 ℃ go to+85 ℃accuracy inside the scope is ±0.5 ℃The temperature spreads a feeling machine's programmable resolution to convert into 12 number formats for 9~12 temperatures biggest be worth to 750 a milli- of second the customer can define of not and easily lose sex temperature to report to the police to establish an application to include a constant temperature control, industrial system, consume electronics product thermometer, or any hot sensitive systemThe number thermometer that describes the DS18 B20 provides9-12(the programmable equipments temperature read a number.The information is disheveled hair to send to|connect through a line from the DS18 B20, so central microprocessor and DS18 B20 only have a per line conjunction.For read and write and the temperature conversion can acquire energy from the data line, don't need to circumscribe the power.Because each DS18 B20 includes a special ordinal number, several ds 18 bs 20 seses can be existed to a total line at the same time.This makes the temperature spread a feeling machine to place in many different places.Its use is a lot of, include an air condition environment control, detect equipments inside the building or machine, and carry on process monitor and control.The DS18 B20 internal structure mainly constitutes to°from thefour-part cent:64 temperatures that only engrave ROM and temperature to spread a feeling machine and don't vaporize report to the police to trigger a machine TH and TL and allocation to deposit a machine.While equiping signal line Gao, the internal capacitor stores an energy from a line and corresponds by letter circuit to the film power supply, and at low electricity even period for film power supply until next Gao Dian Ping's arrival re- refreshes.The power of the DS18 B20 can also.5V electric voltages get from 3 Vs-5s in the exterior.The DS18 B20 adopts front line correspondence to connect.Because the front line correspondence connects, have to previously complete ROM enactment, otherwise memory and control function will can not use.Mainly provide following function to orderany first of a:1、read ROM2、ROM match3、search ROM4、jump ROM5、report to the police a check.These instruction operation the function has no 64 sequences that only engrave ROM of a spare part, can be hanging several spare parts on the front line to make selection a certain spare part, at the same time, the total line can also knowalways on-line hang how much, what kind of equipments.If the instruction successfully makes the DS18 B20 completion temperature measure, the data saves in the saving machine of DS18 B20.The performance of a control function conductor designation DS18 B20 measures.Measure result will be placed in the DS18 B20 memorieses, and can let reading to send out the conductor of remembering the function, reading contents of slice ascend saving machine.The temperature reports to the police to trigger machine TH and TLs to all have one word stanza EEPROM data.If DS18 B20 not the use report to the police to check instruction, these deposit a machine to be a general customer to remember use.Still carry to there is allocation word's the stanza converting by ideal solution temperature number on the slice.Write TH, TL instruction and allocation word stanza makes use of instruction completion that remembers function.Pass to slowly save a machine to read to deposit a machine.All datas read writing all a beginning from the lowest.The DS18 B20 has 4 main data partses:(1)only engrave 64 sequences in ROM are what factory front be only engraved likes, it can see make the address sequence that is the DS18 B20 code.64 alignments that only engrave ROM are:Starting 8(28 Hs) is the product type mark number, immediately after of 48 sequences that is the DS18 B20 oneselfses, last 8 is 56 front circulating redundancy schools to check code.(CRC=X 8+ Xs 5+ Xs 4+s 1)The function that only engraves ROM is to make each DS18 B20 all each not same, so can carry out a purpose that is always on-line to hang to connect several DS18 B20s.(2) the temperature in the DS18 B20 spread a feeling machine to complete the diagraph to the temperature and take 12 conversions as an example:The binary system expanding with 16 signs repairs code to read to count a form to provide, with 0.0625 ℃ |the LSB form express, among them, the S is a sign.The saving machine of DS18 B20 includes high speed to temporary save machine RAM and can give or get an electric shock to wipe in addition to RAM, can give or get an electric shock to wipe in additionto RAM includes temperature to trigger machine TH and TL again, and an allocation deposits a machine.Saving machine ability the integrity really settle the communication of front-line port, the number starts using to write the order of depositing the machine to write into deposit a machine, immediately after can also use order of reading to deposit the machine to confirm these numbers.After confirming can use the order that the replication deposits a machine can give or get an electric shock to wipe to transfering these numbers to in addition to RAM in.While once modifying to deposit the number in the machine, this process can ensure the integrity of number.The high speed temporary saves machine RAM to constitute to°from the saving machine of 8 word stanzas;The first and the second word stanza are temperatures to show.The fourth Sha-ho word stanza is to make duplicate TH and TL, at the same time the fourth Sha-ho number of word stanza can renew;The fifth word stanza is to make duplicate allocation to deposit a machine, the fifth number of word stanza can renew at the same time;6, 7, 8, three word stanzas are calculator oneselfs ing reads that the order that deposit a machine can read the ninth word stanza, this word stanza is eight word stanzas to the front to carry on schools to check.648 ex- oneself codes that is a DS18 B20 that only engrave ROM, next 48 are a continuous number code, 8 of end is to 56 ex- of the CRC schools check.64-the light of engrave ROM and include the function order of 5 ROMs:Read ROM, match ROM, jump up ROM, check to seek ROM and report to the police to check to seek.The DS18 B20 can use external power VDD as well as use the power in the living on of inner part.When the VDD port connects the electric voltage with 3.0 Vs ~Vs-5.5ses is use external power;When the VDD port connects ground used the power in the living on of inner part.No matter is an inner part to live on the power or an external power supply, I|the O line want to connect a 5 K Ω to or soly and up pull electric resistance.Allocation's depositing a machine is the conversion that installs different number to make sure temperature and number.R1, the R0 is the decision of temperature, from the R1, the different combination of R0 can install for 9, 10, 11, 12 temperatures show.So can know a different temperature conversion to should of conversion time, four kinds of resolutions of allocations distinguish to 0.5 ℃ , 0.25 ℃ , 0.125 ℃ and 0.0625 ℃ , factory take installing as 12. DS18 B20 at factory with install for 12, read temperature totally read 16, so the empress is 112 enter make to convert into 10 enter make after at multiply 0.0625 is then measure of temperature, also need to be judged plus or minus.Front 5 piece words are signs, current 5 is 1:00, read of temperature is minus quantity;5 is 0:00, read at present of temperature is plus quantity.16 numbers put from low to Gao Wei.The instruction agrees on code operating instructions:The temperature converts the 44 H start DS18 B20 to carry on a temperature conversionRead to temporary save machine BEH to read to temporary save machine 9 word stanza contentsesWrite temporary and save the machine 4 EHs to write in a data temporary TH of saving the machine and TL word stanzaThe replication temporary saves the machine 48 Hs temporary save the TH of machine and TL word stanza to write E2 RAMRe- adjust the E2 RAM B8's Hs write the E2 TH within RAMs and TL word stanza to arrive to temporary save machine TH and TL word stanza and read that the signal that the B4 H start DS18 B20 of the power supply method sends out the power supply method gives lord CPUThe beginning of DS18 B20 starts to turn.(1) place data line first Gao Dian Ping"1".(2) postpone(what the time request isn't very strict, but possibly a little bit shorter)(3) the data line pull a low electricity even"0".(4) postpone 750.(the horary time scope can from 480-960)(5) the data line pull Gao Dian Ping"1".(6) wait for while postponing(if is early to start to become anachievement then in 15-60 time inside produce a low electricity that is returned by the DS18 B20 even"0".Can make sure its existence according to the status, but should notice can not be infinitely carry on waiting for, otherwise will make procedure get into to die circulating, so control while wanting to carry on to be super).(7) if CPU read the data is on-line low to give or get an electric shock even"0" after, while also needing to do to postpone time for it to postpones from send out of Gao Dian Ping start to calculate to at least want 480.(8) pull data line again Gao Dao Gao to end after giving or getting an electric shock is even"1".DS-18B20 数字温度传感器DS-18B20数字温度传感器,该产品采用美国DALLAS公司生产的DS18B20可组网数字温度传感器芯片封装而成,具有耐磨耐碰,体积小,使用方便,封装形式多样,适用于各种狭小空间设备数字测温和控制领域。
毕业论文中英文资料外文翻译文献外文资料DS1722 Digital ThermometerWith scientific and technological progress and development of the types of temperature sensors increasingly wide range of application of the increasingly widespread, and the beginning analog toward digital, single-bus, dual-bus and bus-3 direction. And the number of temperature sensors because they apply to all microprocessor interface consisting of automatic temperature control system simulation can be overcome sensor and microprocessor interface need signal conditioning circuit and A / D converters advant ages of the drawbacks, has been widely used in industrial control, electronic transducers, medical equipment and other temperature control system. Among them, which are more representative of a digital temperature sensor DS18B20, MAX6575, the DS1722, MAX6636 other. This paper introduces the DS1722 digital temperature sensor characteristics, the use of the method and its timing. Internal structure and other relevant content.FEATURES:Temperature measurements require no external components;Measures temperatures from -55°C to +120°C. Fahrenheit equivalent is -67°F to +248°F;Thermometer accuracy is ±°C;Thermometer resolution is configurable from 8 to 12 bits (°C to °C resolution);Data is read from/written to via a Motorola Serial Peripheral Interface (SPI) or standard 3-wire serial interface;Wide analog power supply range ( - );Separate digital supply allows for logic;Available in an 8-pin SOIC (150 mil), 8-pin USOP, and flip chip package;PIN ASSIGNMENTFIGURE 1 PIN ASSIGNMENTPIN DESCRIPTION:SERMODE - Serial Interface Mode.CE - Chip Enable.SCLK - Serial Clock.GND – Ground.VDDA - Analog Supply Voltage.SDO - Serial Data Out.SDI - Serial Data In.VDDD - Digital Supply Voltage.DESCRIPTION:The DS1722 Digital Thermometer and Thermostat with SPI/3-Wire Interface provides temperature readings which indicate the temperature of the device. No additional components are required; the device is truly a temperature-to-digital converter. Temperature readings are communicated from the DS1722 over a Motorola SPI interface or a standard 3-wire serial interface. The choice of interface standard is selectable by the user. For applications that require greater temperature resolution, the user can adjust the readout resolution from 8 to 12 bits. This is particularly useful in applications where thermal runaway conditions must be detected quickly.For application flexibility, the DS1722 features a wide analog supply rail of - . A separate digital supply allows a range of to . The DS1722 is available in an 8-pin SOIC (150-mil), 8-pin USOP, and flip chip package.Applications for the DS1722 include personal computers/servers/workstations, cellular telephones, office equipment, or any thermally-sensitive system.OVERVIEW:A block diagram of the DS1722 is shown in Figure 2. The DS1722 consists offour major components:1. Precision temperature sensor.2. Analog-to-digital converter.3. SPI/3-wire interface electronics.4. Data registers.The factory-calibrated temperature sensor requires no external components. The DS1722 is in a power conserving shutdown state upon power-up. After power-up, the user may alter the configuration register to place the device in a continuous temperature conversion mode or in a one-shot conversion mode. In the continuous conversion mode, the DS1722 continuously converts the temperature and stores the result in the temperature register. As conversions are performed in the background, reading the temperature register does not affect the conversion in progress. In the one-shot temperature conversion mode, the DS1722 will perform one temperature conversion, store the result in the temperature register, and then eturn to the shutdown state. This conversion mode is ideal for power sensitive applications. More information on the configuration register is contained in the “OPERATION-Programming”section. The temperature conversion results will have a default resolution of 9 bits. In applications where small incremental temperature changes are critical, the user can change the conversion resolution from 9 bits to 8, 10, 11, or 12. This is accomplished by programming the configuration register. Each additional bit of resolution approximately doubles the conversion time. The DS1722 can communicate using either a Motorola Serial Peripheral Interface (SPI) or standard 3-wire interface. The user can select either communication standard through the SERMODE pin, tying it to VDDD for SPI and to ground for 3-wire. The device contains both an analog supply voltage and a digital supply voltage (VDDA and VDDD, respectively). The analog supply powers the device for operation while the digital supply provides the top rails for the digital inputs and outputs. The DS1722 was designed to be Logic-Ready.DS1722 FUNCTIONAL BLOCK DIAGRAM Figure 2OPERATION-Measuring Temperature:The core of DS1722 functionality is its direct-to-digital temperature sensor. The DS1722 measures temperature through the use of an on-chip temperature measurement technique with an operating range from -55°to +120°C. The device powers up in a power-conserving shutdown mode. After power-up, the DS1722 may be placed in a continuous conversion mode or in a one-shot conversion mode. In the continuous conversion mode, the device continuously computes the temperature and stores the most recent result in the temperature register at addresses 01h (LSB) and 02h (MSB). In the one-shot conversion mode, the DS1722 performs one temperature conversion and then returns to the shutdown mode, storing temperature in the temperature register. Details on how to change the setting after power up are contained in the “OPERATION-Programming”section. The resolution of the temperature conversion is configurable (8, 9, 10, 11, or 12 bits), with 9-bit readings the default state. This equates to a temperature resolution of °C, °C, °C, °C, or °C. Following each conversion, thermal data is stored in the thermometer register in two’s complement format; the information can be retrieved over the SPI or 3-wire interface with the address set to the temperature register, 01h (LSB) and then 02h (MSB). Table 2 describesthe exact relationship of output data to measured temperature. The table assumes the DS1722 is configured for 12-bit resolution; if the evince is configured in a lower resolution mode, those bits will contain 0s. The data is transmitted serially over the digital interface, MSB first for SPI communication and LSB first for 3-wire communication. The MSB of the temperature register contains the “sign” (S) bit, denoting whether the temperature is positive or negative. For Fahrenheit usage, a lookup table or conversion routine must be used.AddressLocation S 2625242322212002h MSB (unit = ℃) LSB2-12-22-32-40 0 0 0 01hTEMPERATURE DIGITAL OUTPUT(BINARY) DIGITAL OUTPUT(HEX)+120℃0111 1000 0000 0000 7800h+ 0001 1001 0001 0000 1910h+ 0000 1010 0010 0000 0a20h+ 0000 0000 1000 0000 0080h0 0000 0000 0000 0000 0000h1111 1111 1000 0000 Ff80h1111 0101 1110 0000 F5e0h1110 0110 1111 0000 E6f0h-55 1100 1001 0000 0000 C900h OPERATION-Programming:The area of interest in programming the DS1722 is the Configuration register. All programming is done via the SPI or 3-wire communication interface by selecting the appropriate address of the desired register location. Table 3 illustrates the addresses for the two registers (configuration and temperature) of the DS1722.Register Address Structure Table 3CONFIGURATION REGISTER PROGRAMMING:The configuration register is accessed in the DS1722 with the 00h address for reads and the 80h address for writes. Data is read from or written to the configuration register MSB first for SPI communication and LSB first for 3-wire communication. The format of the register is illustrated in Figure 2. The effect each bit has on DS1722 functionality is described below along with the power-up state of the bit. The entire register is volatile, and thus it will power-up in the default state.CONFIGURATION/STATUS REGISTER Figure 21SHOT = One-shot temperature conversion bit. If the SD bit is "1", (continuous temperature conversions are not taking place), a "1" written to the 1SHOT bit will cause the DS1722 to perform one temperature conversion and store the results in the temperature register at addresses 01h (LSB) and 02h (MSB). The bit will clear itself to "0" upon completion of the temperature conversion. The user has read/write access to the 1SHOT bit, although writes to this bit will be ignored if the SD bit is a "0", (continuous conversion mode). The power-up default of the one-shot bit is "0".R0, R1, R2 = Thermometer resolution bits. Table 4 below defines the resolution of the digital thermometer, based on the settings of these 3 bits. There is a direct tradeoff between resolution and conversion time, as depicted in the AC Electrical Characteristics. The user has read/write access to the R2, R1 and R0 bits and the power-up default state is R2="0", R1="0", and R0="1" (9-bit conversions).THERMOMETER RESOLUTION CONFIGURATION Table 4SD = Shutdown bit. If SD is "0", the DS1722 will continuously perform temperature conversions and store the last completed result in the temperature register. If SD is changed to a "1", the conversion in progress will be completed and stored and then the device will revert to a low-power shutdown mode. The communication port remains active. The user has read/write access to the SD bit and the power-up default is "1" (shutdown mode).SERIAL INTERFACE:The DS1722 offers the flexibility to choose between two serial interface modes. The DS1722 can communicate with the SPI interface or with a standard 3-wire interface. The interface method used is determined by the SERMODE pin. When this pin is connected to VDDD SPI communication is selected. When this pin is connected to ground, standard 3-wire communication is selected.SERIAL PERIPHERAL INTERFACE (SPI):The serial peripheral interface (SPI) is a synchronous bus for address and data transfer. The SPI mode of serial communication is selected by tying the SERMODE pin to VDDD. Four pins are used for the SPI. The four pins are the SDO (Serial Data Out), SDI (Serial Data In), CE (Chip Enable), and SCLK (Serial Clock). The DS1722 is the slave device in an SPI application, with the microcontroller being the master. The SDI and SDO pins are the serial data input and output pins for the DS1722, respectively. The CE input is used to initiate and terminate a data transfer. The SCLK pin is used to synchronize data movement between the master (microcontroller) and the slave (DS1722) devices. The shift clock (SCLK), which is generated by the microcontroller, is active only when CE is high and during address and data transfer to any device on the SPI bus. The inactive clock polarity is programmable in somemicrocontrollers. The DS1722 offers an important feature in that the level of the inactive clock is determined by sampling SCLK when CE becomes active. Therefore, either SCLK polarity can be accommodated. There is one clock for each bit transferred. Address and data bits are transferred in groups of eight, MSB first.3-WIRE SERIAL DATA BUS:The 3-wire communication mode operates similar to the SPI mode. However, in 3-wire mode, there is one bi-directional I/O instead of separate data in and data out signals. The 3-wire consists of the I/O (SDI and SDO pins tied together), CE, and SCLK pins. In 3-wire mode, each byte is shifted in LSB first unlike SPI mode where each byte is shifted in MSB first. As is the case with the SPI mode, an address byte is written to the device followed by a single data byte or multiple data bytes.外文资料译文DS1722数字温度传感器随着科学技术的不断进步和发展,温度传感器的种类日益繁多,应用逐渐广泛,并且开始由模拟式向着数字式、单总线式、双总线式和三总线式发展。
中英文对照翻译附件1:外文资料翻译译文一种基于DS18B20的温度探测系统摘要所有的DS18B20传感器,用于多点温度测试,IO总线与MCU连接,温度数据的轮流收集。
如果系统有大量的传感器,MCU的时间用在处理温度数据明显延长,因此周期替代测试变得更长。
在本文中,一种新的方法,DS18B20的合理组合和一些在软件上采取的措施,替代试验进展速度明显。
关键词:DS18B20的集团,温度测试,轮流测试所花费的时间。
引言由于结构简单,安装方便,低损失和广泛的用途的温度测试,DS18B20温度测试传感器应用领域,需要多点温度测试,如化学工业,粮食,环境监督管理等。
因为通过一个DS18B20的多点温度测试系统总线,所有DS18B20是挂在一条总线上,然后每个温度测试点的值转换轮流读。
作为转换后读值必须阅读8次引脚的状态,移动时间,位置和存储数据,所以时间多花费在阅读每一个点的数据系统时间。
如果温度测试系统是大型系统由它造成的损失是相当多的,然后交替测试系统的运行速度明显降低,从而影响多点温度测试系统的效率。
在本文中,DS18B20的一些I / O总线上都挂着分组DS18B20的均匀,温度转换获取数据读取DS18B20的状态,系统损耗减少和替代测试速度增加显然,这将不会影响精度和转换的可靠性。
一套点对多点温度,在此实现人工环境实验室测试,这增加了测试效率。
作者对DS18B20的认识DS18B20是单总线数字温度传感器来自美国达拉斯公司。
DS18B20是由64数字光盘刻激光,温度敏感性组成部分,非易失性温度报警触发器(设备TH和TL)。
DS18B20的通信微处理器单总线端口和测试范围DS18B20是从-55摄氏度到+125摄氏度,增量值是0.5摄氏度。
温度可在720ms的数字改为每个DS18B20具有唯一的64数字序号。
图1揭示的具体内容:两个8的数字储量(0号和1号),用于存储在DS18B20的温度值。
0号存储存储器温度值,补充和一号存储器温度值的符号。
DS18B20中文资料在现代电子技术领域,温度测量是一项非常重要的任务。
而DS18B20 作为一款常用的数字温度传感器,以其出色的性能和简单的接口,在各种温度测量应用中得到了广泛的应用。
DS18B20 是由美国达拉斯半导体公司(Dallas Semiconductor)推出的一款单线数字温度传感器。
它具有体积小、硬件开销低、抗干扰能力强、精度高等优点。
从外观上看,DS18B20 通常采用小型的TO-92 封装或者SOP 封装,这使得它能够轻松集成到各种电路中,占用极小的空间。
在性能方面,DS18B20 的测量范围非常广泛,从-55℃到+125℃,能够满足大多数实际应用场景的温度测量需求。
其测量精度在-10℃到+85℃范围内可达到 ±05℃,这对于很多对温度精度要求较高的场合来说,是非常出色的表现。
DS18B20 之所以能够在众多温度传感器中脱颖而出,很大程度上得益于其独特的单线接口。
这意味着它只需要一根数据线就可以与微控制器进行通信,大大简化了电路设计和布线工作。
在使用 DS18B20 进行温度测量时,首先需要将其正确连接到微控制器。
通常,将 DS18B20 的数据线连接到微控制器的一个通用输入输出引脚(GPIO)上。
然后,通过微控制器发送特定的指令来启动温度转换,并读取转换后的温度值。
DS18B20 的工作原理基于其内部的温度敏感元件和模数转换电路。
当接收到温度转换指令后,传感器内部的温度敏感元件会感知当前环境温度,并将其转换为对应的数字信号,然后通过单线接口传输给微控制器。
在编程方面,不同的微控制器平台可能会有一些差异,但基本的流程大致相同。
一般来说,需要先初始化单线接口,然后发送复位脉冲和搜索 ROM 指令来识别总线上的 DS18B20 设备。
接着,发送启动温度转换指令,并等待转换完成。
最后,读取转换后的温度数据,并进行相应的处理和显示。
为了确保测量的准确性和稳定性,在实际应用中还需要注意一些问题。
2012 届本科毕业设计(论文)外文文献翻译学院:物理与电子工程学院专业:电子科学与技术姓名:学号:外文出处:Changsha University of Science(用外文写)and Technology附件: 1.外文资料翻译译文;2.外文原文。
附件1:外文资料翻译译文一种基于DS18B20的温度探测系统摘要所有的DS18B20传感器,用于多点温度测试,IO总线与MCU连接,温度数据的轮流收集。
如果系统有大量的传感器,MCU的时间用在处理温度数据明显延长,因此周期替代测试变得更长。
在本文中,一种新的方法,DS18B20的合理组合和一些在软件上采取的措施,替代试验进展速度明显。
关键词:DS18B20的集团,温度测试,轮流测试所花费的时间。
引言由于结构简单,安装方便,低损失和广泛的用途的温度测试,DS18B20温度测试传感器应用领域,需要多点温度测试,如化学工业,粮食,环境监督管理等。
因为通过一个DS18B20的多点温度测试系统总线,所有DS18B20是挂在一条总线上,然后每个温度测试点的值转换轮流读。
作为转换后读值必须阅读8次引脚的状态,移动时间,位置和存储数据,所以时间多花费在阅读每一个点的数据系统时间。
如果温度测试系统是大型系统由它造成的损失是相当多的,然后交替测试系统的运行速度明显降低,从而影响多点温度测试系统的效率。
在本文中,DS18B20的一些I / O总线上都挂着分组DS18B20的均匀,温度转换获取数据读取DS18B20的状态,系统损耗减少和替代测试速度增加显然,这将不会影响精度和转换的可靠性。
一套点对多点温度,在此实现人工环境实验室测试,这增加了测试效率。
作者对DS18B20的认识DS18B20是单总线数字温度传感器来自美国达拉斯公司。
DS18B20是由64数字光盘刻激光,温度敏感性组成部分,非易失性温度报警触发器(设备TH和TL)。
DS18B20的通信微处理器单总线端口和测试范围DS18B20是从-55摄氏度到+125摄氏度,增量值是0.5摄氏度。
中文3200字毕业设计外文资料翻译题目基于DS18B20的啤酒发酵温度测控系统学院自动化与电气工程学院专业自动化班级自动化xxxx班学生xxxxxxxxx学号20100321166指导教师xxxxx二〇一四年三月三十一日Advanced Materials Research Vols. 108-111 (2010) pp 898-902© (2010) Trans Tech Publications, Switzerlanddoi:10.4028//AMR.108-111.898Temperature Detecting System of Beer FermentationBased on DS18B20Fen-Ping Zhou, Hong-Tao Ma, Bing-Dong Sui,and Jia-Mo Sun College of Information Science & Engineering, Hebei University of Science and TechnologyHebei, Shijiazhuang 050054, Chinazhoufenping@,mahongtao@suibd@,sunjiamo@Keywords: DS18B20, Temperature Detecting, Beer Fermentation, Bus-driving, Fault Detecting Abstract.This Paper introduces a temperature detection system in beer fermentation. A temperature monitoring system with characteristics of bus topology structure is composed of industrial computer, temperature detector, bus converter, transmission bus and especially 1-wire digital temperature sensor DS18B20. Four-core cable is used to form a tree-like or star-like network, in which 54 digital temperature sensors existing on 18 fermentation tanks can be connected.The quantity of junction wires between temperature sensor and computer will be reduced greatly.Temperature detector provides power supply for bus converter and DS18B20 through Four-core cable. Because bus converter has used hardware fault detecting technology, the fault temperature sensor can automatically detach from the main bus and will not affect normal working of other sensor in network. So to solve the problem of a certain sensor or branch's damage causing the paralysis of entire bus. The length of detecting temperature bus can reach more than 500 meters. These all make system maintenance and expansion easy. The experiments show that this system is characterized by high intelligence, high-precision, capability of making temperature test on multi-points and compensating function. The method has a good applicable value to the temperature test..IntroductionThe change of fermentation temperature has a greater impact on the quality of beer in the process of beer production. Many fermentation tanks are used to ferment beer in a brewery. A few sensors are installed in each fermentation tank to measure the temperature of liquid. The temperature monitoring system is characterized by greater number of temperature measurement points, the temperature measurement points are relatively concentrated.The traditional temperature detection system is compose of sensor, transmitter, A/D converter and so on. When there exist many detected points, the moretransmitter and junction wires are needed, which not only makes the cost increase, and also brings usmany inconvenience. DALLAS Corp of United States first produced 1-wire digital temperature sensor DS1820, and then an enhanced product DS18B20 is released. The DS18B20 is a kind of digital temperature sensor of high integration, which consists of 64-bit laser ROM, temperature sensor, 1-wire interface, scratchpad RAM, temperature alarm triggers TH and TL, 8-bit CRC generator, control logic and parasitic power [1]. The measuring temperatures of DS18B20 is range from -55°C to +125°C, which precision is ±0.5°C and resolution is programmable from 9 to 12 bits. It adopts 3-pin (GND, DQ, VDD), TO-92 package. Each DS18B20 has the unique 64-bit laser ROM address code [1]. A lot of DS18B20 can be connected to the same bus to detect the temperature without any external components. This feature is very well suitable for multi-point distributed temperature detection, and is convenient to constitute bus-type temperature detection system.The Composition of the SystemThe composition of temperature monitoring system of Beer fermentation is shown in Figure 1. Industrial Computer is responsible for the work of displaying temperature data, generating the curve of temperature change, and temperature chart printing and so on. Temperature detector can be connected to industrial computers through the RS-232 interface. It controls the working condition of all the temperature sensors through transmission bus, and collects temperature data of 18 fermentation tanks in accordance with industrial computer commands. Temperature Detector is connected to 3 bus converter through the transmission bus, each bus converter can be connected to 6 fermentation tanks; there are 3 temperature sensors (DS18B20) in each fermentation tank. The temperature monitoring system contains 54 temperature measurement points in 18 fermentation tanks. Transmission bus adopts the four-core cables;Temperature detector provides power supply for bus converter and DS18B20 through transmission bus. There is a bus driver in temperature detector; it can drive more than 500 meters transmission bus. If you need increase the number of temperature measurement points, more bus converters can be connected to transmission bus in order to achieve linking of more DS18B20s. The number of the DS18B20 can be connected up to more than 300 at most.The Design of Temperature DetectorThe composition of the temperature detector is shown in Figure 2, AT89C51 microcontroller is the core of the temperature detector to control the work of the various circuits. Control program is stored in the MCU's internal program memory. Data memory saves the temperature data of each detection point. 64-bit code memory saves laser ROM code of each temperature sensor (DS18B20).MCU's serial signals are converted to RS-232C standard through RS-232 interface to realize the connection of industrial computer and the temperature detector. Bus driver extends the driving capability of MCU's I/O port to drive the transmission bus, in order to obtain further transmission distance. Watchdog and reset circuit can provide power-on reset for the microcontroller, they can also provide reset signal when program has been confused by accidentally interfering. Display is used to show the current number of fermentation tanks and temperature value of 3 sensors in fermentation tanks. The keyboard is used to control the temperature detector starting and stopping, but also enter the testing cycle and other control parameter.Temperature detector can work independently, and display the number of fermentation tank and temperature value of 3 detected points in this tank, the range of temperature shown is -19.9°C ~ 99.9°C. The number of tank shown can automatically change in cycle. Time shown can be set arbitrarilyduring 1~99 seconds. Temperature detector is also able to accept orders of industrial computer, it transmits the temperature value to the industrial computer, and then the industrial computer completes data processing.The Design of Bus Driver and Bus ConverterTheoretically, lots of DS18B20s can be connected to one bus in parallel. However, the operating time slot of DS18B20 is fixed, and the width of many control impulses is so narrow that it is only few microseconds. In fact, we can seldom meet the need of the operating time slot of DS18B20 because of the limit of driving ability and distributing parameters. Especially the increase of distributing capacitance of the over-long bus will make the distortion of waveform unavoidable, so the read/write error occurs. The recommended length of the bus by the DALLAS Corporation is only 100 meters, and 20 DS18B20s can be connected to it at same time, hence, the application is limited [2,4]. In order to solve this problem, we have designed transmission bus and its driver. The composition of bus driver and bus converter is shown in Figure 3. Transmission bus includes two signal lines TXD and RXD. Bus driver adopts 74HC367-type logical circuit to expand the driving ability of TXD port in A T89C51, thus it completes to drive TXD line of transmission bus. The length of bus can be reached 500 meters. Multiple bus converters can be connected to a transmission bus to form “tree” or “star” network. Bus converter connects the transmission bus and the temperature sensor DS18B20 and completes the signal conversion between them. DS18B20 return signal is transmitted to the terminal RXD of the bus through the driver. The driver in bus converter also uses 74HC367-type logic circuit.The driver we mention here is different with the address switch of DALLAS corporation MicroLANs network [3]. The drivers on the bus are all connected to each other. When the skipping ROM command is sent to DS18B20s, all DS18B20s existing on the bus can receive it. This feature allows us to start temperature conversion of all the DS18B20s existing on the same bus. The temperature detector can acquire the temperature of the different serial number detecting-point by sending different address. This will greatly reduce the temperature detection cycle, thereby increasing the temperature detection speed. The Technology of Hardware Fault DetectingWhen one power line or data line of any DS18B20 in the system is short to the ground, it will cause the whole bus stop working. To avoid this problem, we have designed hardware fault detecting andprocessing circuits for the system. On the one hand, it limits the short circuit current under 10mA; on the other hand disconnects the failure branch from the transmission bus. The composition of hardware fault detecting and processing circuit see Figure 3. Fault detecting circuit tests the logic level of 1-wire interface, when the logic level is high, its output signal is “1”and driver of converter is s hutdown; when the logic level is low, its output signal is “0” and driver of converter is open. If logic level is low and its duration is more than 10ms, according to these phenomena, we can judge hardware failure occurring, temporality, the output signal is “1”, and the driver of converter will be a permanent shutdown. Thus, only failure DS18B20 is disconnected from transmission bus, the other DS18B20s can work normally. Although a bus converter can be connected to 30 DS18B20s, when short-circuit fault occurs in one of DS18B20s, the other 29 DS18B20s will stop working. If each DS18B20 can work independently and it has no effect to others when there is short-circuit fault occurring in one of them, it is necessary for each DS18B20 equipped with a bus converter. One transmission bus can connect more than 300 converters. The Design of Management Software Software of the temperature monitoring system is developed under VISUAL BASIC 6.0, it is responsible for the work of acquiring real-time temperature, sensor temperature compensating,displaying multi-point temperature value, showing temperature variation curve, the temperature value statements and the temperature variation curve printing.Module of acquiring real-time temperature is realized through Serial communication between the industrial Computer and temperature detector. Serial communication adopts RS-232C standard, the baud rate of data transfer is the 9600 bit/s, the data format is 8 data bits, 1 parity bit, and 1 stop bit. Industrial computer collects temperature value of 54 test points in 18 fermentation tanks once every 1 minute, then temperature data is saved in the computer hard disk in the format of a text file, in order to generate the temperature statements and curves of temperature change.Module of sensor temperature compensating is used to calibrate error of the sensor. It is ±0.5°C accuracy from -10°C to +85°C in DS18B20 [1]. In order to improve the measurement accuracy, we have set up temperature compensation for each one temperature measurement point in the management software. The range of temperature compensation is ±5°C, the resolution is 0.01°C. Temperature compensation data requires to be inputted manually.Module of displaying multi-point temperature value is used to display the current temperature of the 54 test points in the 18 fermentation tanks; the display interface is shown in Figure 4. You can find the number of fermentation tanks and temperature value of the three test points in fermentation tanks from monitor. Three test points are ranked by the upper, middle and lower. The interface contains quick button of temperature curve, by clicking on the mouse, you can switch to the display interface of temperature change curve. It also displays the communications status and the number of the fermentation tank in which the temperature data is being sampled.ConclusionWith the use of digital temperature sensor DS18B20, a tree-like or star-like network topology is achieved, which simplifies the hardware design of the temperature monitoring system and reduces the cost of system. Hardware fault detection technology and its continuous improvement make the reliability of temperature detection system greatly improved. Bus driver and bus converters adopt 74HC series logic circuits, with very low static power consumption. The temperature monitoring system has been running for more than four years. The practice shows that the system is simple in connecting wire,convenient in maintenance, and is also low cost, high dependability and good effect. It has excellent application prospect.References[1] Dallas Semiconductor, DS18B20 Programmable Resolution 1-Wire Digital Thermometer. (2003)[2] Dallas Semiconductor, MicroLAN - In the Long Run, Application Note 108. (2001)[3] Dallas Semiconductor, Complex MicroLANs, Application Note 106. (2001)[4] Dallas Semiconductor, Guidelines for Reliable 1-Wire Networks, Application Note 148. (2002)Advanced Materials Research Vols. 108-111 (2010) pp 898-902© (2010) Trans Tech Publications, Switzerlanddoi:10.4028//AMR.108-111.898基于DS18B20的啤酒发酵温度测控系统周芬萍马鸿涛隋秉栋孙佳莫河北工业大学信息科学与工程学院中国,河北,石家庄050054zhoufenping@ mahongtao@ suibd@ sunjiamo@ 摘要:本文介绍了一种在啤酒发酵时使用的温度检测系统。
中英文资料外文翻译文献The introduction to The DS18B201. DESCRIPTIONThe DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements and has an alarm function with nonvolatile user programmable upper and lower trigger points. The DS18B20 communicates over a 1-Wire bus that by definition requires only one data line for communication with a central microprocessor. It has an operating temperature range of -55°C to +125°C and is accurate to ±0.5°C over the range of -10°C to +85°C. In addition, the DS18B20 can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply.Each DS18B20 has a unique 64-bit serial code, which allows multiple DS18B20s to function on the same 1-Wire bus. Thus, it is simple to use one microprocessor to control many DS18B20s distributed over a large area. Applications that can benefit from this feature include HV AC environmental controls, temperature monitoring systems inside buildings, equipment, or machinery, and process monitoring and control systems.2.FEATURES●Unique 1-Wire® Interface Requires Only One Port Pin for Communication●Each Device has a Unique 64-Bit Serial Code Stored in an On-Board ROM●Multi-drop Capability Simplifies Distributed Temperature-Sensing Applications ●Requires No External Components1●Can Be Powered from Data Line; Power Supply Range is 3.0V to 5.5V●Measures Temperatures from -55°C to +125°C (-67°F to +257°F)●±0.5°C Accuracy from -10°C to +85°C●Thermometer Resolution is User Selectable from 9 to 12 Bits●Converts Temperature to 12-Bit Digital Word in 750ms (Max)●User-Definable Nonvolatile (NV) Alarm Settings●Alarm Search Command Identifies and Addresses Devices Whose Temperature isOutside Programmed Limits●Software Compatible with the DS1822●Applications Include Thermostatic Controls, Industrial Systems, ConsumerProducts, Thermometers, or Any Thermally Sensitive System3.OVERVIEWFigure 1 shows a block diagram of the DS18B20, and pin descriptions are given in the Pin Description table. The 64-bit ROM stores the device’s unique serial code. The scratchpad memory contains the 2-byte temperature register that stores the digital output from the temperature sensor. In addition, the scratchpad provides access to the 1-byte upper and lower alarm trigger registers (TH and TL) and the 1-byte configuration register. The configuration register allows the user to set the resolution of the temperature to-digital conversion to 9, 10, 11, or 12 bits. The TH, TL, and configuration registers are nonvolatile (EEPROM), so they will retain data when the device is powered down.The DS18B20 uses Maxim’s exclusive 1-Wire bus protocol that implements bus communication using one control signal. The control line requires a weak pull up resistor since all devices are linked to the bus via a 3-state or open-drain port (the DQ pin in the case of the DS18B20). In this bus system, the microprocessor (the master device) identifies and addresses devices on the bus using each device’s unique 64-bit code. Because each device has a unique code, the number of devices that can be addressed on one DS18B20 bus is virtually unlimited. The 1-Wire bus protocol,2including detailed explanations of the commands and “time slots,” is covered in the 1-Wire Bus System section.Another feature of the DS18B20 is the ability to operate without an external power supply. Power is instead supplied through the 1-Wire pull up resistor via the DQ pin when the bus is high. The high bus signal also charges an internal capacitor (CPP), which then supplies power to the device when the bus is low. This method of deriving power from the 1-Wire bus is referred to as “parasite power.” As an alternative, the DS18B20 may also be powered by an external supply on VDD.Figure 1.DS18B20 Block Diagram4.OPERATION—MEASURING TEMPERATURThe core functionality of the DS18B20 is its direct-to-digital temperature sensor. The resolution of the temperature sensor is user-configurable to 9, 10, 11, or 12 bits, corresponding to increments of 0.5°C, 0.25°C, 0.125°C, and 0.0625°C, respectively. The default resolution at power-up is 12-bit. The DS18B20 powers up in a low-power idle state. To initiate a temperature measurement and A-to-D conversion, the master must issue a Convert T [44h] command. Following the conversion, the resulting thermal data is stored in the 2-byte temperature register in the scratchpad memory and the DS18B20 returns to its idle state. If the DS18B20 is powered by an external supply, the master can issue “read time slots” (see the 1-Wire Bus System section) after the Convert T command and the DS18B20 will respond by transmitting 0 while3the temperature conversion is in progress and 1 when the conversion is done. If the DS18B20 is powered with parasite power, this notification technique cannot be used since the bus must be pulled high by a strong pull up during the entire temperature conversion.The DS18B20 output temperature data is calibrated in degrees Celsius; for Fahrenheit applications, a lookup table or conversion routine must be used. The temperature data is stored as a 16-bit sign-extended two’s complement number in the temperature register (see Figure 2). The sign bits (S) indicate if the temperature is positive or negative: for positive numbers S = 0 and for negative numbers S = 1. If the DS18B20 is configured for 12-bit resolution, all bits in the temperature register will contain valid data. For 11-bit resolution, bit 0 is undefined. For 10-bit resolution, bits 1 and 0 are undefined, and for 9-bit resolution bits 2, 1, and 0 are undefined. Table 1 gives examples of digital output data and the corresponding temperature reading for 12-bit resolution conversions.5.64-BIT LASERED ROM CODE4Each DS18B20 contains a unique 64–bit code (see Figure 3) stored in ROM. The least significant 8 bits of the ROM code contain the DS18B20’s 1-Wire family code: 28h. The next 48 bits contain a unique serial number. The most significant 8 bits contain a cyclic redundancy check (CRC) byte that is calculated from the first 56 bits of the ROM code. The 64-bit ROM code and associated ROM function control logic allow the DS18B20 to operate as a 1-Wire device using the protocol detailed in the 1-Wire Bus System section.Figure 3.64-Bit Lasered ROM Code6.MEMORYThe DS18B20’s memory is organized as shown in Figure 4. The memory consists of an SRAM scratchpad with nonvolatile EEPROM storage for the high and low alarm trigger registers (TH and TL) and configuration register. Note that if the DS18B20 alarm function is not used, the TH and TL registers can serve as general-purpose memory.Byte 0 and byte 1 of the scratchpad contain the LSB and the MSB of the temperature register, respectively. These bytes are read-only. Bytes 2 and 3 provide access to TH and TL registers. Byte 4 contains the configuration register data. Bytes 5, 6, and 7 are reserved for internal use by the device and cannot be overwritten. Byte 8 of the scratchpad is read-only and contains the CRC code for bytes 0 through 7 of the scratchpad. The DS18B20 generates this CRC using the method described in the CRC Generation section.Data is written to bytes 2, 3, and 4 of the scratchpad using the Write Scratchpad [4Eh] command; the data must be transmitted to the DS18B20 starting with the least significant bit of byte 2. To verify data integrity, the scratchpad can be read (using the Read Scratchpad [BEh] command) after the data is written. When reading the scratchpad, data is transferred over the 1-Wire bus starting with the least significant56bit of byte 0. To transfer the TH, TL and configuration data from the scratchpad to EEPROM, the master must issue the Copy Scratchpad [48h] command.7.CONFIGURATION REGISTERByte 4 of the scratchpad memory contains the configuration register, which is organized as illustrated in Figure 5. The user can set the conversion resolution of the DS18B20 using the R0 and R1 bits in this register as shown in Table 2. The power-up default of these bits is R0 = 1 and R1 = 1 (12-bit resolution). Note that there is a direct tradeoff between resolution and conversion time. Bit 7 and bits 0 to 4 in the configuration register are reserved for internal use bythe device and cannot be overwritten.8.1-WIRE BUS SYSTEMThe 1-Wire bus system uses a single bus master to control one or more slave devices. The DS18B20 is always a slave. When there is only one slave on the bus, the system is referred to as a “single-drop” system; the system is “multi-drop” if there are multiple slaves on the bus. All data and commands are transmitted least significant bit first over the 1-Wire bus. The following discussion of the 1-Wire bus system is broken down into three topics: hardware configuration, transaction sequence, and1-Wire signaling (signal types and timing).9.TRANSACTION SEQUENCEThe transaction sequence for accessing the DS18B20 is as follows:Step 1. InitializationStep 2. ROM Command (followed by any required data exchange)Step 3. DS18B20 Function Command (followed by any required data exchange)It is very important to follow this sequence every time the DS18B20 is accessed, as the DS18B20 will not respond if any steps in the sequence are missing or out of order. Exceptions to this rule are the Search ROM [F0h] and Alarm Search [ECh] commands. After issuing either of these ROM commands, the master must return to Step 1 in the sequence.(1)INITIALIZATIONAll transactions on the 1-Wire bus begin with an initialization sequence. The initialization sequence consists of a reset pulse transmitted by the bus master followed7by presence pulse(s) transmitted by the slave(s). The presence pulse lets the bus master know that slave devices (such as the DS18B20) are on the bus and are ready to operate.(2)ROM COMMANDSAfter the bus master has detected a presence pulse, it can issue a ROM command. These commands operate on the unique 64-bit ROM codes of each slave device and allow the master to single out a specific device if many are present on the 1-Wire bus. These commands also allow the master to determine how many and what types of devices are present on the bus or if any device has experienced an alarm condition. There are five ROM commands, and each command is 8 bits long. The master device must issue an appropriate ROM command before issuing a DS18B20 function command.1.SEARCH ROM [F0h]When a system is initially powered up, the master must identify the ROM codes of all slave devices on the bus, which allows the master to determine the number of slaves and their device types. The master learns the ROM codes through a process of elimination that requires the master to perform a Search ROM cycle (i.e., Search ROM command followed by data exchange) as many times as necessary to identify all of the slave devices. If there is only one slave on the bus, the simpler Read ROM command can be used in place of the Search ROM process.2.READ ROM [33h]This command can only be used when there is one slave on the bus. It allows the bus master to read the slave’s 64-bit ROM code without using the Search ROM procedure. If this command is used when there is more than one slave present on the bus, a data collision will occur when all the slaves attempt to respond at the same time.3.MATCH ROM [55h]The match ROM command followed by a 64-bit ROM code sequence allows8the bus master to address a specific slave device on a multi-drop or single-drop bus. Only the slave that exactly matches the 64-bit ROM code sequence will respond to the function command issued by the master; all other slaves on the bus will wait for a reset pulse.4.SKIP ROM [CCh]The master can use this command to address all devices on the bus simultaneously without sending out any ROM code information. For example, the master can make all DS18B20s on the bus perform simultaneous temperature conversions by issuing a Skip ROM command followed by a Convert T [44h] command. Note that the Read Scratchpad [BEh] command can follow the Skip ROM command only if there is a single slave device on the bus. In this case, time is saved by allowing the master to read from the slave without sending the device’s 64-bit ROM code. A Skip ROM command followed by a Read Scratchpad command will cause a data collision on the bus if there is more than one slave since multiple devices will attempt to transmit data simultaneously.5.ALARM SEARCH [ECh]The operation of this command is identical to the operation of the Search ROM command except that only slaves with a set alarm flag will respond. This command allows the master device to determine if any DS18B20s experienced an alarm condition during the most recent temperature conversion. After every Alarm Search cycle (i.e., Alarm Search command followed by data exchange), the bus master must return to Step 1 (Initialization) in the transaction sequence.(3)DS18B20 FUNCTION COMMANDSAfter the bus master has used a ROM command to address the DS18B20 with which it wishes to communicate, the master can issue one of the DS18B20 function commands. These commands allow the master to write to and read from the DS18B20’s scratchpad memory, initiate temperature conversions and determine the power supply mode.91.CONVERT T [44h]This command initiates a single temperature conversion. Following the conversion, the resulting thermal data is stored in the 2-byte temperature register in the scratchpad memory and the DS18B20 returns to its low-power idle state. If the device is being used in parasite power mode, within 10µs (max) after this command is issued the master must enable a strong pull up on the 1-Wire bus. If the DS18B20 is powered by an external supply, the master can issue read time slots after the Convert T command and the DS18B20 will respond by transmitting a 0 while the temperature conversion is in progress and a 1 when the conversion is done. In parasite power mode this notification technique cannot be used since the bus is pulled high by the strong pull up during the conversion.2.READ SCRATCHPAD [BEh]This command allows the master to read the contents of the scratchpad. The data transfer starts with the least significant bit of byte 0 and continues through the scratchpad until the 9th byte (byte 8 – CRC) is read. The master may issue a reset to terminate reading at any time if only part of the scratchpad data is needed.3.WRITE SCRATCHPAD [4Eh]This command allows the master to write 3 bytes of data to the DS18B20’s scratchpad. The first data byte is written into the TH register (byte 2 of the scratchpad), the second byte is written into the TL register (byte 3), and the third byte is written into the configuration register (byte 4). Data must be transmitted least significant bit first. All three bytes MUST be written before the master issues a reset, or the data may be corrupted.4.COPY SCRATCHPAD [48h]This command copies the contents of the scratchpad TH, TL and configuration registers (bytes 2, 3 and 4) to EEPROM. If the device is being used in parasite power mode, within 10µs (max) after this command is issued the master must enable a10strong pull-up on the 1-Wire bus.5.RECALL E2 [B8h]This command recalls the alarm trigger values (TH and TL) and configuration data from EEPROM and places the data in bytes 2, 3, and 4, respectively, in the scratchpad memory. The master device can issue read time slots following the Recall E2command and the DS18B20 will indicate the status of the recall by transmitting 0 while the recall is in progress and 1 when the recall is done. The recall operation happens automatically at power-up, so valid data is available in the scratchpad as soon as power is applied to the device.6.READ POWER SUPPL Y [B4h]The master device issues this command followed by a read time slot to determine if any DS18B20s on the bus are using parasite power. During the read time slot, parasite powered DS18B20s will pull the bus low, and externally powered DS18B20s will let the bus remain high.10.WIRE SIGNALINGThe DS18B20 uses a strict 1-Wire communication protocol to ensure data integrity. Several signal types are defined by this protocol: reset pulse, presence pulse, write 0, write 1, read 0, and read 1. The bus master initiates all these signals, with the exception of the presence pulse.(1)INITIALIZATION PROCEDURE—RESET AND PRESENCE PULSES All communication with the DS18B20 begins with an initialization sequence that consists of a reset pulse from the master followed by a presence pulse from the DS18B20. This is illustrated in Figure 6. When the DS18B20 sends the presence pulse in response to the reset, it is indicating to the master that it is on the bus and ready to operate.During the initialization sequence the bus master transmits (TX) the reset pulse by pulling the 1-Wire bus low for a minimum of 480µs. The bus master then releases11the bus and goes into receive mode (RX). When the bus is released, the 5kΩ pull-up resistor pulls the 1-Wire bus high. When the DS18B20 detects this rising edge, it waits 15µs to 60µs and then transmits a presence pulse by pulling the 1-Wire bus low for 60µs to 240µs.TimingBus master pulling lowDS18B20 pulling lowResistor pullupFigure 6.Initialization Timing(2)READ/WRITE TIME SLOTSThe bus master writes data to the DS18B20 during write time slots and reads data from the DS18B20 during read time slots. One bit of data is transmitted over the 1-Wire bus per time slot.1.WRITE TIME SLOTSThere are two types of write time slots: “Write 1” time slots and “Write 0” time slots. The bus master uses a Write 1 time slot to write a logic 1 to the DS18B20 and a Write 0 time slot to write a logic 0 to the DS18B20. All write time slots must be a minimum of 60µs in duration with a minimum of a 1µs recovery time between individual write slots. Both types of write time slots are initiated by the master pulling the 1-Wire bus low (see Figure 7).To generate a Write 1 time slot, after pulling the 1-Wire bus low, the bus master must release the 1-Wirebus within 15µs. When the bus is released, the 5kΩ pull-up resistor will pull the bus high. To generate a Write 0 time slot, after pulling the 1-Wire1213bus low, the bus master must continue to hold the bus low for the duration of the time slot (at least 60µs).The DS18B20 samples the 1-Wire bus during a window that lasts from 15µs to 60µs after the master initiates the write time slot. If the bus is high during the sampling window, a 1 is written to the DS18B20. If the line is low, a 0 is written to the DS18B20.DS18B20Write Time SlotSTART OF SLOTVccBus master pulling low Resistor pullupFigure 7.DS18B20 Write Time Slot2.READ TIME SLOTSThe DS18B20 can only transmit data to the master when the master issues read time slots. Therefore, the master must generate read time slots immediately after issuing a Read Scratchpad [BEh] or Read Power Supply [B4h] command, so that the DS18B20 can provide the requested data. In addition, the master can generate read time slots after issuing Convert T [44h] or Recall E 2 [B8h] commands to find out the status of the operation.All read time slots must be a minimum of 60µs in duration with a minimum of a 1µs recovery time between slots. A read time slot is initiated by the master device pulling the 1-Wire bus low for a minimum of 1µs and then releasing the bus (see Figure 8). After the master initiates the read time slot, the DS18B20 will begin transmitting a 1 or 0 on bus. The DS18B20 transmits a 1 by leaving the bus high andtransmits a 0 by pulling the bus low. When transmitting a 0, the DS18B20 will release the bus by the end of the time slot, and the bus will be pulled back to its high idle state by the pull up resister. Output data from the DS18B20 is valid for 15µs after the falling edge that initiated the read time slot. Therefore, the master must release the bus and then sample the bus state within 15µs from the start of the slot.VccBus master pulling lowResistor pullupDS18B20 pulling lowFigure 8.DS18B20 Read Time Slot1415DS18B20介绍1.说明DS18B20数字式温度传感器提供9位到12位的摄氏温度测量,并且有用户可编程的、非易失性温度上下限告警出发点。