基于单片机的电子秤设计毕业论文设计 下载本文

基于单片机的电子秤设计

上海理工大学 王凯

摘要

电子秤集计算机、检测与转换、数字技术以及信息处理等为一体而成的现代测重仪器。

电子秤以单片机为核心控制器,通过称重传感器进行对物体重量信号的检测,检测到的信号进行A/D转换,将重量信号发送到显示电路。添加适当的键盘,设置显示电路。电子称不仅实现高速精测量,更能达到自动测重和数字化显示,广受人们欢迎。

本系统的设计硬件电路:通过 HX711 压力传感器采集物体产生的压力信号,传感器采集到的模拟量信号还需进行进行AD转换,得到的数字量信号传送到单片机STC89S52进行处理显示,采用的显示器是 LCD1602液晶显示器。 关键词:STC89S52单片机;电子秤;压力传感器;HX711。

I

Abstract

Electronic scales set computer, detection and conversion, digital technology and information processing as one made of modern weighing instruments.

Electronic scales microcontroller as the core controller, by weighing the weight of the object detection sensor signal, the signal detected by the A / D conversion, the weight signal is sent to the display circuit. Add the appropriate keyboard, set the display circuit. Electronics not only to achieve high-speed precision measurements, can be better achieved automatically weigh and digital display, widely welcomed by the people.

The system hardware design: The HX711 pressure sensor to collect objects produce a pressure signal, sensor to the analog signal needs to be AD conversion, the digital signal is transmitted to the microcontroller for processing STC89S52 display, the display is used LCD1602 LCD monitor.

Key words:STC89S52 SCMC;Electrnoic Scale;Load sensor; HX711

II

目 录

摘要 ................................................................... I Abstract .............................................................. II 目 录 ................................................................ III 绪论 ....................................................................................................................................... 1

1.1课题研究背景 ................................................... 1 1.2课题研究目的和意义 ............................................. 1 1.3课题研究的主要内容 ............................................. 1 第二章 系统硬件方案设计 ................................................................................................. 2

2.1系统设计方案 ................................................... 2 2.2系统元器件参数 ................................................. 4

2.2.1单片机选型 ............................................... 4 2.2.2传感器选择 ............................................... 5 2.2.4 AD转换芯片选择 .......................................... 7 2.2.5 时钟芯片选择 ............................................. 8

3系统硬件电路设计 ............................................................................................................ 9

3.1系统电源电路设计 ............................................... 9 3.2系统串口电路设计 .............................................. 10 3.3单片机控制电路设计 ............................................ 11 3.4系统显示电路设计 .............................................. 11 3.5超重报警提示电路设计 .......................................... 12 3.6按键输入电路设计 .............................................. 13 3.7系统硬件电路的绘制与PCB制作 .................................. 14

3.7.1 Protel99SE简介 ......................................................................................... 14 3.7.2系统原理图的绘制 .................................................................................... 15

4 系统软件设计 ................................................................................................................. 17

4.1主程序流程图 .................................................. 17 4.2系统显示部分流程图 ............................................ 17 4.3按键检测流程图 ................................................ 18 5 系统整体调试 ................................................................................................................. 19

5.1硬件调试遇到的问题 ............................................ 19 5.2系统实物调试效果图 ............................................ 19 5.3系统设计总结 .................................................. 20 参考文献 ............................................................................................................................. 21 致 谢 ................................................................................................... 错误!未定义书签。 附录 ..................................................................................................................................... 23

附录1系统整体电路图 ............................................................................................. 23 附录2系统设计PCB图 ............................................................................................ 25

III

附录3系统部分源程序 ............................................................. 错误!未定义书签。

IV