摘 要
本文介绍了一个多功能体重称设计,本设计以单片机为平台,利用金属应变片来感应人体的重量,传感器输出模拟量经 AD转换器转换成数字量传入单片机。利用超声波在介质中传播速度固定的原理可由超声波在空气中的传播时间算出传播距离,实现身高的测量。通过串口电路实现了单片机与上位机的通信。本设计硬件电路包括电源电路、单片机最小系统电路、液晶屏电路、串口通信电路、独立按键电路、蜂鸣器电路、超声波模块电路、AD转换器电路和全桥电路。软件部分包括主程序、系统初始化程序、AD转换器通信程序、按键检测程序、超声波信号发射及接收程序、液晶屏驱动程序。
整个设计系统由Atmel公司生产STC89C51单片机进行控制;软件实现功能开机检测,主要是开机后自动逐个扫描LED数码管,以防止某段数码管损坏造成视觉误差;出于人性化考虑我们还可以增加语音电路,实现自动语音播报重量。本设计一个能完成精确计量且LED数码显示的体重称,并且带有身高体重比例正常与否的语音提示。
关键词:STC89C51;体重称;LED数码管;语音播报
ABSTRACT
In this paper, a multifunctional weight weighing design is introduced. The design is based on a single chip microcomputer. The metal strain gauge is used to induce the weight of the human body. The analog output of the sensor is converted into a digital input microcontroller by AD converter.The propagation distance can be calculated from the propagation time of ultrasonic wave in air by using the principle of the constant velocity of ultrasonic wave in the medium, and the height measurement can be realized.The communication between MCU and host computer is realized by serial circuit.The design hardware circuit includes power supply circuit, MCU minimum system circuit, LCD screen circuit, serial communication circuit, independent keystroke circuit, buzzer circuit, ultrasonic module circuit and AD converter. Circuit and full bridge circuit.The software includes main program, system initialization program, AD converter communication program, key detection program, ultrasonic signal transmitting and receiving program, LCD screen driver program.
The whole design system is controlled by STC89C51 single-chip computer produced by Atmel Company, and the function of software realization is to start the detection, mainly to scan the LED digital tube one by one automatically after the boot, to prevent the damage of a section of digital tube from causing visual error.For the consideration of humanization, we can also increase the voice circuit and realize the weight of automatic voice broadcast.This design can achieve accurate measurement and LED digital display of electronic, and with a normal height and weight ratio of the voice hint.
Keywords: STC89C51; weight weighing LED digital tube; Voice broadcast
目 录