0

Is there a sensor I could use which would let me know which direction an object is heading/facing? i.e. I have a servo that can rotate 0 to 180 degrees, and I have another sensor on a block. When I turn the block 45 degrees, I want the servo to also turn 45 degrees - I thought I could do this with a compass, but the varying magnetic fields make it impossible. Gyro/acc maybe? Except I don't know how to use that to solve this problem.

So in other words we need to know the block was rotated 45 degrees using a sensor on the block, which tells the servo to rotate 45 degrees.

asked Jun 21, 2016 at 6:15
4
  • 2
    You can lookup "sensor fusion" (which is a complicated matter) and "MPU6050", which is a cheap board with some hardware support and plenty of examples for it - perhaps it might be what you need. Commented Jun 21, 2016 at 7:10
  • Great thanks, I think that might work I have used that sensor before for an indoor positioning system / IMU setup -- one question though is there a way to have two separate MPU6050 synchronize orientations? That was the reason for my compass system - both knew which way was north irregardless of when they were turned on so I could use that as a calibration point. Commented Jun 21, 2016 at 7:37
  • Lookup Magnetometer sensor. Commented Jun 21, 2016 at 13:32
  • You could use the accelerometer to "synchronize orientation" because gravity always points down, but that will only work if the two sensors rotate on an axis that does not line up with gravity (e.g. they don't rotate around an axis pointed up). Similarly, a magnetometer won't work if the table rotates around the north vector. Commented Jul 27, 2016 at 18:40

1 Answer 1

1

Use a gyro, it will give you the angle. Gyros are difficult to find spare, so you should buy an IMU like MPU6050 that contains also an accelerometer.

answered Jun 27, 2016 at 18:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.