STC89C52单片机的电子秤设计

对STC89C52单片机功能和借口拓展有了深入的了解。了解认识了各种传感器,对A/D转换后的数据处理也掌握了一定的方法。C语言编程也有了相对的提升。然而研究时间较短,加上本人知识有限,设


摘  要:本设计是一款基于单片机的电子秤,电子秤在生产和家庭生活中必不可少,人们对它的功能要求也越来越高。本设计除了拥有最根本的称量功能外,还加入求出总价、语音播报和电子日历功能。该电子秤以单片机STC89C52为控制中心,包括LCD1602液晶显示模块、HX711数模转换模块、语音播报模块、矩阵键盘模块等,测量范围在5KG以内。电子秤使用压力传感器收集由被测对象的压力发生变化而产生的电信号,再通过电子秤专用的24位AD转换芯片HX711进行AD转换,把经过改变的数字信号送到单片机去处理,得出重量,再发送给LCD1602液晶显示芯片实现显示。当传感器不放置物品时,显示屏自动显示当天日期,并可以通过键盘修改日期。除此之外,还能够利用按键模块确定单价,乘以总重量得出总金额,并使用语音芯片NY3P087B实现各个功能的播报。

关键词:STC89C52  AD转换  语音播报  电子日历  矩阵键盘

A Design of Intelligent Electronic Scale Based on Single-chip Computer

Abstract:This paper is based on the design of an electronic scale, in addition to the basic weighing utility, but also to get the total price, voice broadcast and electronic calendar function. This paper discusses the system design of the hardware part of the chip related circuit and software part of the C language. This electronic scale takes the monolithic integrated circuit STC89C52 as the center, including the LCD1602 liquid crystal display module, the HX711 module conversion module, the sound broadcast module, the matrix keyboard module and so on, the measuring range is within 10KG. The electronic scale using pressure sensor signal collection is a signal generated by the object to be measured pressure changes, through the 24 AD electronic scale conversion chip HX711 AD conversion, the digital signal sent to the microcontroller to change after the treatment, the weight, and then sent to the LCD1602 chip of LCD display. When the station does not place items, the display automatically displays the date of the day, and can be modified by the date of the keyboard. In addition, the use of matrix keys to determine the unit price, multiplied by the total weight of the total amount, and the use of voice chip NY3P087B voice broadcast function.

Key Words:STC89C52  Analog-to-Digital Convert  Voice Announcements  

electronic calendar  Matrix keyboard

目  录

摘  要 I

Abstract II

1 绪论 1

1.1 电子秤的发展和现状 1

1.2 研究的目的和意义 1

1.3 设计主要内容 2

2 系统的设计和功能 3

2.1 系统整体设计 3

2.2 系统的主要功能 4

3 硬件电路的设计 5

3.1 称重传感器 5

3.2 AD转换模块 7

3.3 单片机STC89C52模块 10

3.4 人机交互模块电路 13

3.5 语音模块 16

3.6 时钟模块 17

4 系统软件设计 20

4.1 主程序的设计 20

4.2 子程序的设计 22

4.3 日历程序 25

5 结论 26

参考文献 27

致谢 28

1 绪论

1.1 电子秤的发展和现状

电子秤是一种衡量器。衡量器作为一种工具,在工业生产、对外贸易、科学研究、人民生活中发挥着重要作用。衡量器技术水平的高下给各行业的自动化水平和经济效益的进步带来了深刻的影响。

第二次世界大战以后,为了激励战后的经济繁荣,在生产过程当中对称重技术提出了新的需求。希望能实现称重自动化,摆脱以往手动称重的工作。在1954年生产过程中利用了倾斜式秤,该秤包含新式打印机。在1960年开发出了称重值打印机,其特意和衡量器相联,用电子方式控制重量有关的显示和记录。以1980年为起点,西欧、北美等发达国家,就开始研究数字化的称重传感器及系统。历经多年的研究,推出了几款智能化数字式的称重系统,在很大程度上的促进了电子衡器在国际上的发展。我国的衡器在1940年以前还全是机械式的,1940年以后发展了机电结合式的衡器。1950年最先出现了包含了称重传感器的电子测量衡器。尤其到了1980年之后,我国衡器历经了质的飞跃,将使用多年的机械式衡器发展为集数字化和智能化于一体的电子衡器。