【正文】
脈沖波 ,單片機(jī)接收脈沖波從而計(jì)算出車輛的行駛距離 ,然后算出總車費(fèi)。 關(guān)鍵詞 : 出租車, 80C51,霍爾傳感器 Abstract: As the taxi development, urban taxi industry is an important ponent of the traffic, developing the taxi bees more and more important. In this paper, it shows the design of microcontrollerbased taxi billing system, the system uses 80C51 microcontroller core, uses A44E Hall sensor measuring vehicle distance and make the vehicle and the fare output to the digital display tube. The article also describes the working principle of the Hall sensor, Hall sensor bases its work on the Hall effect, when the Hall sensor is in a changing magic filed it can generate the pluse which is received by microcontroller to calculate the vehicle distance, and then calculate the total fare. The show circuit uses the 8bit digital display tubes, of which 4 used to show distance,4 to display the total fare. The system can not only achieve the basic taxi distance and fare, but also can calculate the intermediate wait time to adjust the prices, when the taxi is empty the starting can be article not only describes the hardware structure of each module in the circuit in detail,but also describe the software design in detail. Key words: Taxi 80C51 Hall sensor西安航空職業(yè)技術(shù)學(xué)院 畢業(yè)設(shè)計(jì)論文 2 目 錄 1 緒論 ...................................................................................................................... 3 單片機(jī)應(yīng)用的發(fā)展及現(xiàn)狀 .................................................................................. 3 單片機(jī)概述 ............................................................................................. 3 單片機(jī)的應(yīng)用 .......................................................................................... 3 現(xiàn)今對出租車計(jì)費(fèi)系統(tǒng)的有關(guān)研究 .................................................................... 4 2 出租車計(jì)費(fèi)系統(tǒng)設(shè)計(jì)目標(biāo) ....................................................................................... 5 出租車計(jì)費(fèi)系統(tǒng)原理概述 ................................................................................. 5 出租車計(jì)費(fèi)系統(tǒng)實(shí)現(xiàn)的功能 .............................................................................. 6 3系統(tǒng)硬件設(shè)計(jì) ......................................................................................................... 7 系統(tǒng)設(shè)計(jì)框圖 ................................................................................................... 7 80C51 單片機(jī)的內(nèi)部邏輯結(jié)構(gòu) ................................................................ 8 單片機(jī)的引腳 ........................................................................................ 10 單片機(jī)的中斷系統(tǒng) ................................................................................ 12 單片機(jī)最小系統(tǒng) .................................................................................... 14 霍爾傳感器介紹 ................................................................................... 17 霍爾效應(yīng) ............................................................................................... 17 I/O 擴(kuò)展電路 .................................................................................................. 21 8155 的結(jié)構(gòu)和引腳圖 ........................................................................... 22 8155 的工作方式與基本操作 ................................................................ 23 8155 的地址編碼 .................................................................................. 24 單片機(jī) I/O 擴(kuò)展電路 ............................................................................ 24 74HC244 芯片介紹 ................................................................................. 25 LED 顯示器介紹 .................................................................................... 26 數(shù)碼管顯示原理 ................................................................................... 27 顯示電路 .............................................................................................. 28 4 系統(tǒng)軟件設(shè)計(jì) ...................................................................................................... 30 出租車計(jì)費(fèi)系統(tǒng)軟件總體設(shè)計(jì) 思想 ................................................................. 30 軟件設(shè)計(jì)各個(gè)模塊介紹 ................................................................................... 32 里程、車費(fèi)計(jì)算及顯示模塊 ................................................................. 32 等待時(shí)間計(jì)時(shí)加費(fèi)模塊 ........................................................................ 33 設(shè)置起步價(jià)模塊 ................................................................................... 34 5 總結(jié) .................................................................................................................... 35 致謝 ........................................................................................................................ 36 參考文獻(xiàn) ................................................................................................................. 37 3 1 緒論 單片機(jī)應(yīng)用的發(fā)展及現(xiàn)狀 單片機(jī)概述 自從 1946 年美國賓夕法尼 亞大學(xué)研制了世界上第一臺電子計(jì)算機(jī)以來,計(jì)算機(jī)的發(fā)展經(jīng)歷了 4個(gè)時(shí)代(電子管時(shí)代、晶體管時(shí)代、集成電路時(shí)代、大規(guī)模及超大規(guī)模集成電路時(shí)代),現(xiàn)代的計(jì)算機(jī)都是大規(guī)模集成電路計(jì)算機(jī),他們具有功能強(qiáng)、結(jié)構(gòu)緊湊、系統(tǒng)可靠等特點(diǎn),其發(fā)展趨勢是巨型化、微型化、網(wǎng)絡(luò)化及智能化。尤其是近幾年,單片機(jī)以面向?qū)ο蟮膶?shí)時(shí)控制及信息家電為己任,不斷增強(qiáng)控制能力和信息處理能力,降低成本、減小體積,改善開發(fā)環(huán)境,從而迅速取代經(jīng)典電子系統(tǒng),改造傳統(tǒng)電氣控制系統(tǒng),嵌入到各產(chǎn)品或設(shè)備之中。實(shí)行出租車區(qū)域計(jì)價(jià)制度需要出租車的計(jì)價(jià)器具有區(qū)域識別功能。 “出租車計(jì)價(jià)器加密傳感器的設(shè)計(jì)”上描述了為了對出租車計(jì)價(jià)進(jìn)行有效的管理,在分析現(xiàn)有出租車計(jì)價(jià)傳感器漏洞的基礎(chǔ)上,采用 PIC12C508A和 PIC12CE518A 單片機(jī)提出了出租車計(jì)價(jià)加密傳感器的加密模型和系統(tǒng)結(jié)構(gòu)模型,完成了密碼傳感器系統(tǒng)中加密器和解密器軟硬件系統(tǒng)設(shè)計(jì)。與已有的系統(tǒng)相比,該系統(tǒng)具有超速提醒等更強(qiáng)的功能。怎樣獲取到車輪的即使轉(zhuǎn)速是最關(guān)鍵的問題,一般的出租車在車輪上都會(huì)附有一塊磁鐵,在靠近車輪附近的車軸上附上一塊霍爾傳感器,當(dāng)車輪轉(zhuǎn)動(dòng)時(shí),車輪上的磁鐵就會(huì)不斷地靠近和遠(yuǎn)離霍爾傳感器,這時(shí)霍爾傳感器受磁場感應(yīng)產(chǎn)生脈沖,當(dāng)車輪轉(zhuǎn)動(dòng)一圈時(shí)霍爾便產(chǎn)生一個(gè)脈沖送入主控制器,主控制器對接收到的脈沖進(jìn)行計(jì)數(shù),由于車輪的周長已知,便可根據(jù)脈沖個(gè)數(shù)以及車輪周長算出一定時(shí)間內(nèi)行駛里程數(shù)。規(guī)定行駛里程在 3km以內(nèi)時(shí)起步價(jià)為 10 元,當(dāng)超過 3km時(shí)車價(jià)按 3 元 /公里來計(jì)算。再次按下按鍵后系統(tǒng)重新正常行駛計(jì)費(fèi)。 圖 系統(tǒng)設(shè)計(jì)總框圖