Reading the IMU

The IMU is a special measurement unit that will tell you about the movement of your robot. It uses a combination of accelerometers and gyroscopes, sometimes also magnetometers. This will allow your robot to sense when it is falling over, and then can respond and right itself.

Here is an image of a unit that is available at most online electronic retailers:

Reading the IMU

The connections to this chip are straightforward, and the device communicates with Raspberry Pi using the I2C bus. Since you are using the motor controller, you can connect the device to the I2C bus on the controller board. Here is a close-up of the I2C connector on the RaspiRobot ...

Get Raspberry Pi Robotic Projects - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.