Trying to find an adjustable way to mount Accelerometer chip

Hey guys, I'm working on an automotive project and I'm totally stumped. I'm using an LSM303 Accelerometer/Compass to provide vehicle tilt, roll, and compass heading.

I'm racking my brain trying to think of some way to install the chip so that it can be adjusted based on how the project box is installed. The goal is to level the chip as well as point it in a consistent direction so that the compass reading is accurate no matter what direction I face the project box. I want to be able to install the project box facing whatever direction works best and then have the ability adjust rotate the chip independently as well as make small chip tilt and roll adjustments to level it out.

I'm looking for something that offers the same features as a digital camera tripod leveler but in a knob type format... and I have no idea what I might even be looking for. Any suggestions?

Thanks!!!

Would you not end up with the connecting wires all twisted up together?

Paul

There is no need to adjust the chip orientation at all, because you can correct the yaw, pitch and roll angles by any amount in software. The order of applying rotations is not standardized, so beware that angular corrections are NOT additive.

You just need some way of calibrating the orientation, for example push a button when the vehicle is level and heading due North. That becomes the reference orientation for subsequent measurements. Some matrix or quaternion math will be required to work out the correction.

Keep in mind, especially in a vehicle, that the magnetometer must be calibrated in its final location or the readings will be useless. Overview on calibration.

Thanks guys for the comments. Paul- I was hoping to find a way to limit the movement to 180 degrees. Jreminginton, I had thought of coding but I didn't want to have to calibrate each time you restarted the vehicle. However, after learning about EEPROM, that's the obvious solution. Thank you both!