You'll need the following parts to build this project:
- Adafruit BNO055 absolute orientation sensor breakout.
- Raspberry Pi (any model like A, B, A+, B+, Pi 2, etc. will work) or BeagleBone Black (any revision).
- Breadboard & hookup wires.
- Soldering tools.
Follow the BNO055 guide to assemble the breakout by soldering headers to the board. If you're using the Raspberry Pi be sure to solder both rows of headers as you'll need to access the PS0 and PS1 pins.
Follow the steps below based on the board you're using to connect the BNO055 to your hardware.
Normally the BNO055 is connected to a device using its I2C interface, however on the Raspberry Pi the BNO055's use of I2C clock stretching will cause problems with a hardware I2C clock stretching bug in the Raspberry Pi. To work around this clock stretching issue you can instead connect to the BNO055 using its serial UART mode.
To use the UART mode of the BNO055 make sure you've soldered both the top and bottom row of headers to the breakout board (i.e. both the VIN, GND, SDA, SCL, etc and PS0, PS1, etc. rows of connections). You'll need to connect the PS1 pin from the top row to 3.3V power to put the BNO055 into UART mode. Once in UART mode the BNO055's SCL and SDA pins will become serial RX and TX pins.
When using a serial UART device with the Raspberry Pi you'll need to make sure you disable the kernel's use of the Pi's serial port. Normally when the Pi kernel boots up it will put a login terminal on the serial port, however if you connect a device like the BNO055 to this serial port it will get confused by the login terminal. Luckily it's easy to disable the kernel's use of the serial port by using the raspi-config tool.
To disable the kernel serial port connect to the Raspberry Pi in a terminal (using SSH) and launch the raspi-config tool by running:
Navigate the menus to the Advanced Options -> A8 Serial option and when prompted if you want a login shell over the serial port select No. Then select the Finish menu option to exit raspi-config.
Note on Raspbian Jessie you might also need to execute the following to disable the login terminal service on the serial port:
Finally run the reboot command to reboot the Pi and make the change take effect:
If you'd ever like to re-enable the kernel serial port in the future use the same raspi-config menu option to enable the login serial port and re-run the systemctl command but change disable to enable.
Once the Pi has rebooted and the serial port is disabled, follow the diagram below to wire up the BNO055 to the Raspberry Pi.
- Connect BNO055 Vin to Raspberry Pi 3.3V power.
- Connect BNO055 GND to Raspbery Pi ground.
- Connect BNO055 SDA (now UART TX) to Raspberry Pi RXD pin.
- Connect BNO055 SCL (now UART RX) to Raspberry Pi TXD pin.
- Connect BNO055 PS1 to BNO055 Vin / Raspberry Pi 3.3V power.
On a BeagleBone Black you can use the BNO055's I2C communication mode as the hardware fully supports I2C clock stretching. Connect your BeagleBone Black to the BNO055 as follows.
If you aren't familiar with how pins are numbered on the BeagleBone Black be sure to read this guide first.
- Connect BNO055 Vin to BeagleBone Black 3.3V power pin P9_3.
- Connect BNO055 GND to BeagleBone Black ground pin P9_1.
- Connect BNO055 SDA to BeagleBone Black I2C2_SDA pin P9_20.
- Connect BNO055 SCL to BeagleBone Black I2C2_SCL pin P9_19.
Continue on to learn how to install the BNO055 Python module and use the sensor.