基于STC15W4K56S4单片机控制的管道内钢珠运动测量装置设计
2020-07-09张仁朝王先彪张茂贵
张仁朝 王先彪 张茂贵



摘 要:文章设计了一种基于STC15W4K56S4单片机控制的管道内钢珠运动测量装置。该装置采用霍尔传感器测量钢珠运动参数,通过钢珠在管道内的运动特点建立数学模型,利用数学模型实现对钢珠个数、运动方向、角度、周期的测量,通过标定法减小系统误差,并在12864LCD上进行显示。该装置可以较好地完成钢珠数量与运动方向显示,并且将倾斜角度误差的绝对值在误差范围之内。
关键词:单片机;运动;测量;显示
中图分类号:TP368.1 文献标识码:A 文章编号:2096-4706(2020)02-0041-04
Abstract:In this paper,a steel ball motion measuring device in pipeline is designed based on STC15W4K56S4 single chip microcomputer. The device uses Hall sensor to measure the movement parameters of steel balls,establishes the mathematical model through the movement characteristics of steel balls in the pipeline,realizes the measurement of the number of steel balls,movement direction,angle and period by using the mathematical model,reduces the system error by the calibration method,and displays on 12864LCD. The device can display the number of steel balls and the direction of movement well,and the absolute value of the tilt angle error is within the error range.
Keywords:SCM;motion;measure;display
0 引 言
角度測量在我们日常生活中的应用非常广泛。测量一个运动物体角度的方法除了角度传感器,应用比较多的就是霍尔传感器。通过霍尔传感器,单片机控制液晶显示运动物体的数量与角度,是角度测量的另一有效措施。
1 系统方案设计
本文计划设计并制作一个管道内钢珠运动测量装置,使用2个非接触传感器检测钢珠运动,配合信号处理和显示电路获得钢珠的运动参数。
根据以上要求,本系统主要由传感器模块、主控制模块 (MCU)、放大电路模块、比较电路模块、液晶显示模块、按键模块、电源模块构成。其系统结构如图1所示。
2 方案论证与选择
2.1 传感器的选择
2.1.1 霍尔传感器
霍尔效应是指磁场作用于导体的载流子产生横向电位差的物理现象。当电流通过霍尔元件时,垂直于电流的方向放置磁铁施加磁场,则霍尔元件两侧面会出现横向电位差(即称为霍尔电压),因为钢珠滚过管道引起霍尔传感器的磁场变化,所以霍尔元件将磁场的变化转为电信号传输给控制器来处理,从而实现测速和测长度等。……
