Arduino - 检测运动/运动? [英] Arduino - detecting motion/movement?

查看:52
本文介绍了Arduino - 检测运动/运动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检测物品移动的方向.我想知道该项目是向上还是向下移动.

I need to detect in which direction the item is moving. I want to know if the item is moving up or down.

这个平台和使用特定的盾牌是否可以做到这一点?

Is this possible with this platform and by using a specific shield?

我想到了超声波传感器,我可以用它来测量物品离某个点的距离,并由此表明由于距离变化而发生的运动类型.我认为这可能很棘手,想看看是否有更好的替代方案.

I had in my mind the ultrasonic sensor, with which I would measure how far the item is from a certain point, and with this suggest what type of movement is happening because of the distance changes. I think this might be tricky, and wanted to see if there are better alternatives.

更新:我更新了问题,更正了方向——不是向前/向后,而是向上/向下.

UPDATE: I updated the question, corrected directions - it's not forward/backward but up/down.

推荐答案

通常,要了解运动方向,您需要使用陀螺仪测量结果,通常表示为四元数.要获得距离,您需要整合加速度数据.但请注意,这种方法不是很宽容.您可以使用 6 轴 mems 传感器,用于测量加速度和旋转速度.有基于 Invensense 的 IC mpu6050 和 mpu9250 的 arduino 屏蔽.尝试诸如 i2cdevlib 之类的库.也可能有助于实现本机 Invensense 的固件,它被移植到 ARM 和微芯片平台,并且应该很容易将代码移动到 arduino 平台.另一个有用的链接是 freeImu.

In general, to know direction of movement you need use gyro measurements results, usually represented as quaternions. To obtain distance you need integrate acceletation data. But notice that this method is not very tolerate. You may use 6 axis mems sensors, which measure acceleration and rotation speed. There are arduino shields based on Invensense's ICs mpu6050 and mpu9250. Try libraries such as i2cdevlib. Also maybe useful to implement native Invensense's firmware, it is ported to ARM and microchip platforms, and should be easy to move the codes to arduino platform. Another useful link is freeImu.

这篇关于Arduino - 检测运动/运动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆