Book Image

Raspberry Pi Robotic Projects - Third Edition

By : Richard Grimmett, Jon Witts
Book Image

Raspberry Pi Robotic Projects - Third Edition

By: Richard Grimmett, Jon Witts

Overview of this book

This book will allow you to take full advantage of Raspberry Pi Zero and Raspberry Pi 3 by building both simple and complex robotic projects. The book takes a mission-critical approach to show you how to build amazing robots and helps you decide which board to use for which type of robot. The book puts a special emphasis on designing mobile (or movable) robots using the Raspberry Pi Zero. The projects will show inexpensive, yet powerful, ways to take full advantage. It will teach you how to program Raspberry Pi, control the movement of your robot, and add features to your robots.
Table of Contents (13 chapters)
Raspberry Pi Robotic Projects - Third Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

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:

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 board:

There are five connections. You'll connect your device VCC to the 5V connection on the motor controller. You'll connect GND on your device to GND on the motor controller. Then connect the SCL connector on your device to the C connector on the motor controller and the SDA pin on the device to the D connection on the motor controller. Notice...