Yoctopuce Yocto - 3D sensor
The Yocto-3D is a USB 3-axis accelerometer, gyroscope and compass. If you need to detect an orientation, a movement or a magnetic field, the Yocto-3D is what you need. This USB device provides a 3D accelerometer, a 3D magnetometer, a 3D gyroscope to measure angular velocity, a 2D inclinometer (tilt sensor), a tilt compensated compass and an inertial estimation of the orientation based on the 3D gyroscope.
All math required to use this kind of sensors are handled directly by the device. You can mount it in any position, as the reference frame can be configured and taken into account internally by the Yocto-3D. The device automatically computes tilt angles and the estimated device attitude (using a quaternion, with an optional conversion to Tait-Bryan angles in the API). No additional computation is required in the application to determine the device orientation.
You can move away the sensor part as required, in particular if you want to avoid electromagnetic interferences from other devices.