Using an Arduino in series with a 3-axis acceleromter and 3-axis gyroscope.

The LSM303D is better than the MPUxxxx products, and includes a magnetometer and level shifters for either 3.3V or 5V operation.