【正文】
大連理工大學(xué)城市學(xué)院 本科生畢業(yè)設(shè)計(論文) 學(xué) 院: 電子與自動化學(xué)院 專 業(yè): 自動化 學(xué) 生 : 姜美芹 指導(dǎo)教師: 刁立強(qiáng) 完成日期: 2020年 6月 6日 大連理工大學(xué)城市學(xué)院本科生畢業(yè)設(shè)計(論文)題目 基于單片機(jī)出租車多功能計價器設(shè)計 總計 畢業(yè)設(shè)計(論文 ) 32 頁 表格 6 表 插圖 26 幅 I 摘 要 隨著社會的高度發(fā)展,出租車已經(jīng)成為人們?nèi)粘I钪斜夭豢缮俚拇焦ぞ撸捎诟鱾€地方的生活水平不同,導(dǎo)致物價存在一定的差異,因此出租車的計費標(biāo)準(zhǔn)也不盡相同。這就要求我們設(shè)計出簡易化、智能化、計價精確、可移植、可靠性高的出租車計價器。 本次設(shè)計利用軟件設(shè)計和硬件設(shè)計相結(jié)合,設(shè)計出具有 性能可靠、電路簡單、成本低等特點的多功能計價器。 由單片機(jī) AT89C51控制, 使用12MHz 晶振提供時鐘信號 ,利用裝在車輪上的霍爾傳感器 A44E發(fā)出的脈沖個數(shù)來測速 ,因為本設(shè)計涉及到白天和黑夜的轉(zhuǎn)換,通過 AT24C02實現(xiàn)白天和黑夜單價的修改和存儲,從而實現(xiàn)白天和黑夜不同的計費標(biāo)準(zhǔn)。另外 AT24C02中的數(shù)據(jù)是不可隨意更改的,具有防作弊的效果。 通過 C語言編程實現(xiàn)記時、里程檢測、費用計算,同時通過 LED數(shù)碼管將里從而達(dá)到計費的目的。 最后將總車費和總金額很直觀的在 LED數(shù)碼管中顯示出來 ,達(dá)到計價器計價收費的目的。而且,本次設(shè)計還通過 DS1302,可以在不計價的情況下作為時鐘顯示時、分、秒,使駕 駛員了解實時時間。系統(tǒng)包括控制模塊、里程傳感模塊、掉電保護(hù)模塊、獨立鍵盤電路、電源電路、時鐘顯示模塊部分。 該系統(tǒng)設(shè)有五個按鍵(清除、查詢 /確認(rèn)、停止、白天 /黑夜、功能選擇) ,進(jìn)行相應(yīng)的操作就可實現(xiàn)單程 /往返模式選擇、停止計費、等待時間查詢、清除復(fù)位等功能,使操作簡單方便。 關(guān)鍵詞:單片機(jī) 。 霍爾傳感器 A44E。 LED數(shù)碼管; DS1302 II Abstract With the high degree of social development, the taxi has bee an everyday essential means of transport, but because of the different levels of each of the local life, causing prices there are some differences, so taxis are not the same accounting standards. This requires us to design a simple, intelligent, accurate pricing, portable, high reliability taxi meter. The design of the software and hardware design using the bination of design with reliable performance, the circuit is simple and low cost multifunction meter. Controlled by the microcontroller AT89C51 using 12MHz crystal oscillator provides the clock signal, the use of a wheel mounted on the Hall sensor A44E number of pulses sent to the gun, as the design involves the conversion of the day and night, night and day to achieve through AT24C02 price changes and storage, day and night in order to achieve different billing standards. The data in another AT24C02 can not be changed, with the effect of anticheating. Through the C programming language in mind, the mileage testing, cost calculations, while the inside through the LED digital tube so as to achieve the purpose of billing. Finally, the total amount of the total fare and very intuitive in the LED digital tube display, to achieve the purpose of the meter valuation fees. Moreover, this design also adopted DS1302, can not denominated in the case as the clock displays hours, minutes, seconds, the driver understand realtime. System prises a control module, mileage sensing module, power protection module, separate keyboard circuit, power circuit, the clock display module section. The system has five buttons (Clear, check / confirm, stop, day / night function selection), the appropriate action can be achieved one way / return III mode selection, stop charging, waiting time queries, clear Reset function. make operation simple and convenient. Keywords: microcontroller。 hall sensor A44E。 LED digital tube。 DS1302 目錄 第一章 引言 .............................................. 1 出租車簡介 ............................................ 1 出租車計價器概述 ................................ 1 出租車計價器的工作原理 .......................... 1 單片機(jī)簡介 ......................................... 2 單片機(jī)的基礎(chǔ)知識 ................................ 2 單片機(jī)的發(fā)展歷史、趨勢及應(yīng)用 .................... 2 MCS51 單片機(jī)的應(yīng)用特性 ......................... 3 .............................. 4 設(shè)計任務(wù) ........................................ 4 設(shè)計要求 ........................................ 4 系統(tǒng)主要功能 .................................... 5 第二章 計價器硬件設(shè)計 .................................... 6 ................................. 6 系統(tǒng)的硬件構(gòu)成及功能 ................................. 8 AT89C51 單片機(jī)及其引腳說明 ............................ 8 AT24C02 掉電存儲電路設(shè)計 ............................. 11 里程計算、計價單元的設(shè)計 ............................. 13 電源電路設(shè)計 ......................................... 15 獨立鍵盤電路設(shè)計 ..................................... 16 指示燈電路設(shè)計 ....................................... 16 數(shù)碼管顯示電路設(shè)計 ................................... 17 DS1302 時鐘電路設(shè)計 ................................. 20 第三章 系統(tǒng)的軟件設(shè)計 ................................... 23 系統(tǒng)主程序設(shè)計 ...................................... 23 定時中斷服務(wù)程序 .................................... 24 里程計數(shù)中斷服務(wù)程序 ................................ 25 中途等 待程序 ........................................ 27 鍵盤掃描子程序 ...................................... 28 計算程序 ............................................. 30 結(jié)束語 ..................................................... 32 致謝 ....................................................... 33 參考文獻(xiàn) .................................................. 34 附錄 多功能計價器程序設(shè)計 ............................. 35 設(shè)計原理圖 ................................................ 55 基于單片機(jī)出租車多功能計價器設(shè)計 1 第一章 引言 本次畢業(yè)設(shè)計利用單片機(jī)知識作為理論支撐來實現(xiàn)一臺多功能出租車計價器設(shè)計,使之具有 性能可靠、電路簡單、成本低、使用方便等特點。 出租車簡介 出租車計價器概述 計價器顯示的總金額是總里程與不同情況下的單價(白天、黑夜、中途等待)的函數(shù)。出租車計價器通過里程傳感器與車輪連接。出租汽車的實際里程通過傳感器的脈沖信號在計價器里按照設(shè)定的函數(shù)轉(zhuǎn)換成一定的總 里程。出租車計價器功能主要有 具有數(shù)據(jù)的復(fù)位功能、白天 /黑夜轉(zhuǎn)換功能、數(shù)據(jù)輸出功能、計時計價功能等等,在原有功能的基礎(chǔ)上增加單價輸出、單價調(diào)整、路程輸出、顯示當(dāng)前的系統(tǒng)時間等功能。 出租車計價器的工作原理 當(dāng)汽車運行起來時,就啟動計價,根據(jù)里程寄存器中的內(nèi)容計算和判斷行駛里程是否已超過起步價公里數(shù)。若已超過,則根據(jù)里程值、每公里的單價數(shù)和起步價數(shù)來計算出當(dāng)前的總金額,并將結(jié)果存于總金額寄存器中;中途等待時,無脈沖輸入,不產(chǎn)生中斷,當(dāng)時間超過等待設(shè)定值時,開始進(jìn)行計時,并把等待價格加到總金額里,然后將 總金額、里程和單價、白天黑夜價格送數(shù)碼管顯示出來。 基于單片機(jī)出租車多功能計價器設(shè)計 2 單片機(jī)簡介 單片機(jī)的基礎(chǔ)知識 單片機(jī)結(jié)構(gòu)包括:輸入設(shè)備,運算器,輸出設(shè)備,控制器,內(nèi)存。 1946 年第一臺計算機(jī)誕生,經(jīng)歷了電子管、晶體管、集成電路、大規(guī)模集成電路、超大規(guī)模集成電路的過程 單片機(jī)的發(fā)展歷史、趨勢及應(yīng)用 ①歷史 : 1974 年 12 月,美國仙童 ( Fairchild) 公司推出了世界上第一臺 8 位單片機(jī) F8。單片機(jī)的發(fā)展過程分為以下幾個發(fā)展階段。 第一代單片機(jī)( 1974— 1976 年 ) 單片機(jī)發(fā)展的起步階段。