Arduino - detecting motion/movement?

为君一笑 提交于 2019-12-13 21:16:01

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/36245649/arduino-detecting-motion-movement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!