【正文】
41 芯片觸發(fā)加熱,當(dāng)所需溫度低于當(dāng)前采集的水溫時(shí),則停止加熱。關(guān)鍵詞:?jiǎn)纹瑱C(jī);C 語(yǔ)言;采集;智能;家用電熱水器 AbstractWith the development of social and program of human technology, every trade all transfer own product into intelligence, digitize, because the water heater of old style uses gas or natural gas to heat water and manually adjust mode conditioning temperature, not only unable to sufficiently accurately recognize the user need of water temperature, but also exist some certain risk. The electrical water heater is a kind of home appliances that bathroom, loo and kitchen can use, with raising of quality of human live, the modernistic household electrical water heater has abandonned the past way, but adopts a kind of implementation scheme of more accurate ,safety.C language possess many merits for programming of singlechip, such as:Is easy to ransplant, having little bug when sentence construction review, fastness good, the head document type is so many that expediently quickly using various function etc.The writer adopts an AT 89 Cs 52 singlechip to be the controller and using C languages to write programming ,design a style of intelligence household electrical water array form keyboard input temperature, the temperature can be accuratly recognized to ℃, and use LED light display it, can accurately provide to the warm water of temperature that user DS18 B20 to collect temperature, use LED light display, the accurately displays to collect water the temperature needed higher than to collect water temperature at present, use the MOC3041 chip lead to heating , when the temperature needed is lower than the collect water temperature at present, stop simply carry out intelligence control function.Key Words: singlechip。 collect。 household electric water heater 1目 錄第 1 章 緒論 1 家用電熱水器的現(xiàn)狀 .............................................................................................1 TX1C 單片機(jī)實(shí)驗(yàn)開發(fā)板簡(jiǎn)介 .............................................................................1第 2 章 系統(tǒng)硬件設(shè)計(jì) 2 系統(tǒng)硬件的組成部分 .............................................................................................2 系統(tǒng)硬件各部分的簡(jiǎn)介 .........................................................................................2 數(shù)碼管顯示 .............................................................................................................3 數(shù)碼管簡(jiǎn)介 .........................................................................................................3 數(shù)碼管的實(shí)現(xiàn)方法 .............................................................................................4 鎖存器與數(shù)碼管顯示方法 .................................................................................6 鍵盤輸入設(shè)計(jì) .........................................................................................................7 鍵盤輸入方法 .....................................................................................................7 鍵盤輸入的抖動(dòng)與去抖的方法 .........................................................................8 DS18B20 溫度采集 .................................................................................................9 DS18B20 技術(shù)性能與應(yīng)用范圍 .........................................................................9 DS18B20 的初始化與讀寫操作 .......................................................................10 DS18B20 的指令與格式 ...................................................................................12 DS18B20 寄生電源供電方式 ...........................................................................15 DS18B20 改進(jìn)的寄生電源供電方式 ...............................................................16 DS18B20 外部電源供電方式 ...........................................................................17 DS18B20 寄生電源供電方式 ...........................................................................18第 3 章 系統(tǒng)軟件設(shè)計(jì) 20 鍵盤輸入的程序 ...................................................................................................20 DS18B20 溫度傳感器設(shè)計(jì) ...................................................................................21 主函數(shù)的分析 .......................................................................................................25 顯示函數(shù)的分析 ...................................................................................................26 中斷加熱子函數(shù)的分析 .......................................................................................33第 4 章 功能簡(jiǎn)介 35 智能熱水器具的功能 ...........................................................................................35第 5 章 總結(jié) 38附錄 程序 41第 1 章 緒論 單片機(jī)是一種與我們生活息息相關(guān)的控制器,它存在于許多地方,例如:電子手表、掌上游戲機(jī)、數(shù)碼相機(jī)、錄音筆、電視機(jī)遙控器等等。通過(guò)單片機(jī)人們的生活將會(huì)變得更加方便、快捷。我們的生活電熱水器是一種可供浴室、洗手間及廚房使用,按照人們的需要的溫度,提供溫水的家用電器。隨著社會(huì)的發(fā)展、人們生活質(zhì)量的提高,人們對(duì)電熱水器的要求越來(lái)越趨向于智能化和數(shù)字化,這種老式而簡(jiǎn)單的電熱水器已經(jīng)不能夠滿足人們的需要了。它能提供用戶方便快捷的數(shù)字化輸入方式,并且能精確的采集和控制環(huán)境中的水溫,將其提供給用戶,因此備受人們的關(guān)注。該開發(fā)板集常用的單片機(jī)外圍資源、串口和 USB 口兩種調(diào)試下載接口于一身,完全兼容 ATMEL 公司的 51 單片機(jī),除此之外還有很多特點(diǎn),如:無(wú)法解密、低功耗、高速、高可靠、強(qiáng)抗靜電、強(qiáng)抗干擾等。當(dāng)用 STC 公司的單片機(jī)時(shí),直接用產(chǎn)品套件附帶的串口線將開發(fā)板與計(jì)算機(jī)串口相連,按照 STC 單片機(jī)下載操作教程便可以下載程序,而且下載速度比起其他下載工具要快的多。 2第 2 章 系統(tǒng)硬件設(shè)計(jì) 系統(tǒng)硬件的組成部分系統(tǒng)設(shè)計(jì)硬件原理結(jié)構(gòu)見圖 所示。 圖 系統(tǒng)設(shè)計(jì)硬件原理結(jié)構(gòu) 系統(tǒng)硬件各部分的簡(jiǎn)介這里 AT89C51 為總控制器。鍵盤的輸入由 P3 口完成在第 4 章節(jié)中會(huì)具體介紹如何實(shí)現(xiàn)。圖 時(shí)鐘復(fù)位電路 3溫度采集芯片由 DS18B20 芯片完成,DS18B20 的 2 號(hào)接口接在單片機(jī)的 P2^2 口,按協(xié)議傳送以兩個(gè)字節(jié)為一組的溫度數(shù)據(jù),第 3 章會(huì)介紹具體實(shí)現(xiàn)方