【正文】
編號 (2022301134) 畢 業(yè) 設 計 ( 2022 屆本科) 設計題目: 基于 STC89C52 單片機的電子秤功能仿真設計 學 院: 電氣工程學院 專 業(yè): 電氣工程及其自動化 班 級: 11 級電氣一班 作者姓名: 指導教師: 職 稱 : 研究生 完成日期: 2022 年 5 月 1 日 目 錄 基于 51 單片機的電子秤設計 .............................................. (2) 中文摘要 .............................................................. (2) 英文摘要 ............................................................... (2) 1 引言 ................................................................. (3) 課題研究背景 ........................................................ (2) 電子衡器的研究現(xiàn)狀 .................................................. (2) 課題的研究意義 ...................................................... (3) 本文的設計思路 ...................................................... (4) 2 系統(tǒng)方案論證與硬件選型 ............................................... (5) 系統(tǒng)總體設計方案的比較與論證 ........................................ (5) 硬件方案設計與論證 .................................................. (6) A/D 轉換器的選擇 .................................................... (8) 鍵盤處理部分 方案的論證 .............................................. (9) 顯示器部分的選擇 .................................................... (9) 超量程報警部分的選擇 ............................................... (10) 3 硬件電路設計 ........................................................ (10) STC89C52 單片機介紹 ................................................ (10) A/D 轉換器與 STC89C52 單片機接口電路 ............................... (11) 顯示電路與 STC89C52 單片機的接口電路 ............................... (13) 4 主程序設計 .......................................................... (17) 主程序設計 ......................................................... (17) 系統(tǒng)主程序流程圖 ................................................... (18) 系統(tǒng)子程序設計 ..................................................... (19) 5 系統(tǒng)調試 ............................................................ (20) 調試過程 ........................................................... (20) 故障分析與解決方案 ................................................. (20) 功能測試 ........................................................... (21) 精度測量 ........................................................... (21) 6 結論 ................................................................ (212) 參考文獻 ............................................................. (212) 致 謝 ................................................................. (214) 附錄材料目錄 .......................................................... (25) 附錄 1 ................................................................. (25) 附錄 2 ................................................................ (257) 附錄 3 ................................................................. (28) 1 基于 STC89C52 單片機的電子秤 功能仿真設計 摘 要: 隨著數字化技術的快速不斷變化和應用,電子稱重技術同樣也得到了很大的發(fā)展和應用,各種數字化智能化的電子衡器逐漸出現(xiàn),但商用電子稱作為電子稱重方面重要的一部分,在中小型市場并沒有得到普及,依然以桿秤、臺秤和普 通電子秤為主的商用電子秤,存在明顯的精度差、容易損壞和難維修等缺陷,特別是在進行輕微物體、藥材等的測量時誤差更大。 本文設計的電子秤主要以 STC89C52 單片機為核心,通過 Proteus 軟件和 Keil 軟件實現(xiàn)了對電子稱的功能仿真設計。主要分為五個模塊:物體重量采集模塊、單片機處理模塊、鍵盤控制模塊、數據顯示模塊以及軟件驅動模塊 [1]。用壓力傳感器采集壓力數值,通過 A/D 轉換送給單片機,單片機通過重量參數進而選擇 24 位精度值進行處理,最后將輸出的稱重值顯示在在 1602LCD液晶上。整個電子秤系統(tǒng)能夠智能化的實 現(xiàn)自動測量、自動報警、直接顯示等功能,具有操作方便,測量準確,成本比較低、穩(wěn)定性高等特點,可以很好的用于不同的應用場合,適應了中小型市場的需要。 關鍵詞: 單片機 STC89C52。稱重傳感器 。A/D 轉換 。液晶顯示器 2 The design of electronic scales based on 51 MCU Abstract:With the rapid development and application of digital technology, electronic weighing technology has been developed and applied extensively .And a variety of intelligent digital electronic weighing is emerging progressively, but in small and middle market, the mercial electronics, which is an important part of the electronic weighing, is still limited to the simple electronics said such as steelyard, platform scales and simple electronics. All these are known as the main mercial electronic scales, but the existence of accuracy, easily damage, and difficult to repair defects also affect itself. Especially during weighing some minor objects such as tea, medicinal herbs, mistakes is easy to appearance through measuring. This paper, the design of the doubleprecision electronic using microcontroller STC89C52 as the core, achieve the simulation capabilities of electronic design by using Proteus Software and KEIL software. Now dividing this paper into five main modules: how to collect the weight of the object with this doubleprecision electronic said module, how to deal with the data through singlechip machine, how to control keyboard module, the display module and how to drive software module. Fristly, use different pressure sensor to acquire pressure parameters. Secondly the signal processor and A / D conversion work out the data, finally given to the MCU. Thridly according to the data above the MCU will automatically select whether the 24 precision value puting processor. Ultimately the input through the keyboard will be showed on the LCD1602 realtime display. The entire electronic system can intelligently acplish doubleprecision measurement automatically, automatic alarm, visual display, at the same time, it’s easy to operate, accurate measurement, low cost, stability and high reliability. Based on the introduction above ,it can be used in different applications occasions, and it can adapt to the needs of small and mediumsized market. Key Words: Doubleprecision electronic。STC89C52。Load sensor。A/D converter。LCD display 1 引 言 課題研究背景 電子稱重技術是現(xiàn)代化稱重技術和系統(tǒng)控制工程的重要基礎之一,從 50 年代中期 開始電子技術逐漸進入到衡器的輔助測量裝置系統(tǒng)中, 60 年代初期出現(xiàn)機電結合式電子稱量系統(tǒng)以來,經過 40多年的不斷發(fā)展和完善,從最開始的機電結合型發(fā)展到現(xiàn)在的全電子型和數字化智能型,電子衡器稱重技術經過了很長的發(fā)展,其便于與電子計算機緊密結合而實現(xiàn)稱重計數與過程自動控制的特點,在貿易、能源、冶金、輕工、醫(yī)藥、航天航空等部門得到了廣泛的利用。而衡器作為國家法定計量的器具,自古以來就被人們重視,作為一