Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

MinIMU-9 v5 mounting


Hi, I recently purchased a MinIMU-9 v5 for my robot project. Can you give me advice on how to mount the sensor on my robot, the chassis is made of stainless steel with aluminum, Should I mount this directly on aluminum or is insulation required? Also the best position should be in the center of the robot right? Thank you.


Also I heard that you have to calibrate the compass, how should I do this, provided that I intend to use this sensor with an Arduino, thanks again.



The MinIMU-9 v5’s mounting hole is not electrically connected to anything on the board, so you can use that as a way to fix the board to your robot. You should generally be cautious when mounting electronics to conductive metal surfaces; just make sure none of the header pins or conductive parts of the components could come into contact with the surface of the bare chassis.

Assuming you have a rigid chassis, the exact placement of the MinIMU should not affect the gyroscope readings. If you place the MinIMU at the center of rotation of your robot, you can minimize how much rotation adds to your accelerometer readings. As for the compass, you should try to keep the board away from stray magnetic fields (e.g. from things like wires supplying power to the robot’s motors).

We have an Arduino library for the MinIMU’s LIS3MDL compass that includes a calibration sketch, “Calibrate.ino”. You can find a link to the GitHub page for that library under the “Resources” tab of the MinIMU-9 v5’s product page. The calibration routine requires that the compass be rotated in all directions while the sketch is running. For me, it helps to imagine I have to paint the entire inside of a basketball with the tip of the MinIMU.



I have a robot and I want to make it go straight, the problem is when it’s travelling straight, the direction relative to North changes, is there anything I’m doing wrong?Thank you.


You might not be doing anything wrong; it could be that the magnetic field around your robot is changing. You can test this out by using something like a phone compass app or handheld (non-electronic) compass. If the magnetic field is not changing, it might be that you need to mount or calibrate the IMU better.



Hi thanks for your quick reply, I understand that the library has default setting for the accelerometer as ±2g is there a function in the library that allows changing it?, thank you.


Our library’s writeReg() function can be used to change the full-scale acceleration range of the accelerometer. That range is determined by the state of the FS_XL bits in the CTRL1_XL register. You can learn more about that register inside the LSM6DS33’s datasheet, which you can also find under the Resources tab of the MinIMU-9’s product page. For an example of how to use writeReg() to set those bits in the CTRL1_XL register, you can look through our LSM6 enableDefault() function inside LSM6.cpp.