基于單片機(jī)的測(cè)速表設(shè)計(jì).doc
基于單片機(jī)的測(cè)速表設(shè)計(jì),摘 要隨著科技的迅速發(fā)展,單片機(jī)的應(yīng)用也越來越廣泛,并帶動(dòng)傳統(tǒng)控制檢測(cè)技術(shù)不斷更新?,F(xiàn)在的車速表大多是電子式的,用led數(shù)碼管或lcd即時(shí)顯示,顯示更加直觀。電子式車速表采用接觸車速傳感器代替軟軸傳動(dòng),可使車速表的安裝位置不受距離限制,進(jìn)一步有效地克服了機(jī)械式車速表中的諸多不足。本次設(shè)計(jì)給出了以a...
內(nèi)容介紹
此文檔由會(huì)員 huangbinbest 發(fā)布基于單片機(jī)的測(cè)速表設(shè)計(jì)
摘 要
隨著科技的迅速發(fā)展,單片機(jī)的應(yīng)用也越來越廣泛,并帶動(dòng)傳統(tǒng)控制檢測(cè)技術(shù)不斷更新?,F(xiàn)在的車速表大多是電子式的,用LED數(shù)碼管或LCD即時(shí)顯示,顯示更加直觀。電子式車速表采用接觸車速傳感器代替軟軸傳動(dòng),可使車速表的安裝位置不受距離限制,進(jìn)一步有效地克服了機(jī)械式車速表中的諸多不足。
本次設(shè)計(jì)給出了以AT89C2051為核心,利用單片機(jī)的運(yùn)算和控制功能,并采用系統(tǒng)化LED顯示模塊實(shí)時(shí)顯示所測(cè)速度的設(shè)計(jì)方案,以及串口數(shù)據(jù)存儲(chǔ)電路和系統(tǒng)軟件。
該方案由于使用了數(shù)碼管顯示模塊和E2PROM,以及高效快速算法,因而可在節(jié)約系統(tǒng)資源和簡(jiǎn)化程序設(shè)計(jì)的基礎(chǔ)上保證測(cè)量精度和系統(tǒng)實(shí)時(shí)性。其中信號(hào)預(yù)處理電路包含信號(hào)放大、波形變換和波形整形:信號(hào)預(yù)處理電路中的放大器用于對(duì)待測(cè)信號(hào)進(jìn)行放大,以降低對(duì)待測(cè)信號(hào)的幅度要求;波形變換和波形整形電路則用來將放大的信號(hào)轉(zhuǎn)換成可與單片機(jī)接口的TTL 信號(hào)。通過單片機(jī)的設(shè)置可使INT0 引腳能夠?qū)?nèi)部定時(shí)器T0 的工作進(jìn)行控制,這樣能精確地測(cè)出加到INT0 引腳的正脈沖寬度(即測(cè)出脈沖信號(hào)的期) 。速度顯示部分采用數(shù)碼顯示, 所得的數(shù)據(jù)采用I2C總線, 并通過E2PROM來存儲(chǔ), 因而節(jié)省了所需單片機(jī)的口線和外圍器件, 同時(shí)也簡(jiǎn)化了顯示部分的軟件編程。
本方案實(shí)現(xiàn)了電動(dòng)車速度即時(shí)顯示,并可通過控制兩個(gè)按鍵顯示速度或里程,同時(shí)加入了超速語(yǔ)音報(bào)警功能,使之更加人性化。
關(guān)鍵詞:?jiǎn)纹瑱C(jī);霍爾傳感器;數(shù)碼顯示;語(yǔ)音報(bào)警;DC/DC變換器
Abstract
With the rapid development of technology, more and more widespread application of microcomputer, and promote the traditional control detection technology constantly updated. Most of the current electronic speedometer, and with the LED digital tube or LCD display real-time, display more intuitive. Electronic speedometer flexible shaft using the contact speed sensor instead of driving, speed tables can be installed without distance limitations, and further to effectively overcome the mechanical disadvantages of speed in the table.
The AT89C2051 is designed to give the core of computing and the use of microcomputer control, and adopting a systematic LED display module shows the measured real-time speed design, and the serial data storage circuits and system software.
The program due to the use of the digital display module and E2PROM, and efficient fast algorithm, thus saving resources and simplifying programming system based on the system to ensure accuracy and real-time. Signal pre-processing circuit which includes signal amplification, wave conversion and waveform shaping: signal pre-processing circuit in the amplifier for the amplified signal could be to reduce the requirements on signal amplitude; wave transformation and wave-shaping circuitry is used to enlarge the signal converted into TTL signals with the microcontroller interface. Set by MCU enables INT0 pin to the work of the internal timer T0 control, so to accurately measure the INT0 pin is added to the pulse width (ie measured pulse signal period). Speed display part of a digital display, the data collected using I2C bus, and through E2PROM to store, thus saving the need microcontroller port lines and peripheral devices, but also simplifies the display part of the software programming.
The program achieved the speed of real-time electric vehicle revealed two buttons can be displayed by controlling the speed or mileage, while adding a speed voice alarm function, make it more humane.
Key words: microcomputer; Hall sensor; digital display;voice alarm; DC / DC converter
目 錄
摘 要 I
Abstract II
1 引 言 1
1.1 選題背景 1
1.2 研究意義 1
1.3 研究?jī)?nèi)容 2
2 總體設(shè)計(jì)方案 3
3 系統(tǒng)單元模塊概述 5
3.1 傳感器選擇 5
3.2 單片機(jī)選型 7
3.3 顯示模塊選型 8
3.4 報(bào)警電路選擇 9
3.5 速度算法概述 9
4 系統(tǒng)硬件設(shè)計(jì) 15
4.1單片機(jī)主控電路 15
4.1.1 單片機(jī)概述 15
4.1.2 復(fù)位電路 17
4.1.3 晶振電路 18
4.2 變換電路設(shè)計(jì) 19
4.3 傳感器電路設(shè)計(jì) 20
4.4 信號(hào)處理電路設(shè)計(jì) 23
4.5 存儲(chǔ)器電路設(shè)計(jì) 24
4.5.1 I2C總線概述 24
4.5.2 存儲(chǔ)器電路 25
4.6 報(bào)警電路設(shè)計(jì) 27
4.6.1 語(yǔ)音芯片概述 27
4.6.2 語(yǔ)音報(bào)警電路 28
4.7 顯示電路設(shè)計(jì) 31
4.8 掉電保護(hù)電路設(shè)計(jì) 33
4.9 數(shù)據(jù)處理過程 35
5 系統(tǒng)仿真與分析 37
5.1仿真結(jié)果 37
5.2仿真分析 38
6 系統(tǒng)軟件設(shè)計(jì) 39
6.1 系統(tǒng)軟件總流程圖 39
6.2 速度處理子程序 40
6.3 顯示子程序 41
7 總結(jié)與展望 43
致 謝 44
參考文獻(xiàn) 45
附錄A 程序清單 46
附錄B 電路圖 57