基于均值滑动滤波算法和STM32电子秤的设计 联系客服

发布时间 : 星期三 文章基于均值滑动滤波算法和STM32电子秤的设计更新完毕开始阅读8f4c230ef56527d3240c844769eae009591ba24d

龙源期刊网 http://www.qikan.com.cn

基于均值滑动滤波算法和STM32电子秤的设计

作者:周继裕 陈思露 符少文 来源:《现代电子技术》2017年第10期

摘 要: 为了提高电子秤的抗干扰性和数据的准确性,介绍基于均值滑动滤波算法和STM32电子秤的设计。选用电阻应变片构成的惠斯通电桥传感器采集重物信号,24位HX711 A/D模块完成电信号的放大和转换,在STM32内实现软件滤波,采用滑动均值滤波算法,减小误差,提高数据的准确度。通过软硬件结合的方法进行校正。矩阵键盘输入控制指令实现设置单价、计算物品金额并实现金额累加和去皮等功能。实验测试表明,该电子秤测量范围是0~500 g,误差不超过±1 g,称重反应灵敏,5 s左右读数稳定。 关键词: 滑动均值滤波; 电阻应变片; HX711; STM32

中图分类号: TN99?34 文献标识码: A 文章编号: 1004?373X(2017)10?0010?03 Abstract: In order to improve the anti?jamming and data accuracy of electronic scale, the design of the electronic scale based on the mean sliding filter algorithm and STM32 is introduced in this paper. The Wheatstone bridge sensor with the structure of resistance strain gage is selected to collect weight signal. 24 bit HX711 A/D module is adopted to complete the signal amplification and conversion to realize software filtering in STM32.Tthe sliding men filtering algorithm is used to reduce the error and improve the data accuracy. The correction is executed with the method

combining the software and hardware. Matrix keyboard input control instructions are employed to set the unit price, calculate the amount of item and achieve the money accumulation and peeling, and other functions. The experimental results show that the measurement range of the electronic scale is 0~500 g, its error is not more than ±1 g, and has sensitive weighing response and about 5 s stable reading.

Keywords: sliding mean filter; resistance strain gage; HX711; STM32

电子秤是一种通过作用在物体上的重力来测定该物体质量的一种计量仪器。因其操作简单、称量准确、体积小、称量速度快、读数方便,被广泛应用于商业贸易、医院、学校、企业等部门[1?2]。而悬臂式电子秤是一种铁质悬臂梁固定在支架上,悬臂梁上粘贴电阻应变片作为称重传感器进行感应相应重量变化的电子秤。提出一种在悬臂梁上粘贴电阻应变片构成惠斯通电桥[3]作为称重传感器采集数据,HX711作为A/D转换器,STM32为主控器的电子秤,采用滑动均值滤波算法[4],减小各种干扰和提高数据的准确性。 1 系统硬件设计