Library Installation

You can install the Adafruit BNO08x RVC library for Arduino using the Library Manager in the Arduino IDE.

Click the Manage Libraries ... menu item, search for Adafruit BNO08x RVC, and select the Adafruit BNO08x RVC library:

UART RVC Wiring

Wiring up the BNO085 in UART RVC is similar to UART, but with one less wire!

  • Board 3V to BNO085 Vin (Red Wire). 
  • Board GND to BNO085 GND (Black Wire)
  • Board RX to BNO085 SDA (Blue Wire)
  • Board 3V to BNO085 P0 (Purple Wire
For an even simpler hardware setup, bridge the P0 solder jumper on the back of the board to keep it configured in UART RVC. mode. You can always remove the solder to use other modes!

Load Example - Serial Console

Open up File -> Examples -> Adafruit BNO08x RVC-> uart_rvc

After opening the demo file, upload to your Arduino wired up to the sensor. Once you upload the code, you will see the heading principal axes and acceleration values being printed when you open the Serial Monitor (Tools->Serial Monitor) at 115200 baud, similar to this:

Load Example - Serial Plotter

In addition to the text based example code shown above, we have also included a version that is formatted to display nicely in the Arduino Serial Plotter.

Open up File -> Examples -> Adafruit BNO08x RVC-> uart_rvc_plotter

After opening the demo file, upload to your Arduino wired up to the sensor. Once you upload the code, open the Serial Plotter (Tools->Serial Plotter) at 115200 baud and you will see graphs of the heading and acceleration like these:

 

Play around with it! Move the sensor around and see how rolling back and forth, front to back, and twisting change the graphs. I think you'll be pleasantly surprised!

/* Test sketch for Adafruit BNO08x sensor in UART-RVC mode */

#include "Adafruit_BNO08x_RVC.h"

Adafruit_BNO08x_RVC rvc = Adafruit_BNO08x_RVC();

void setup() {
  // Wait for serial monitor to open
  Serial.begin(115200);
  while (!Serial)
    delay(10);

  Serial.println("Adafruit BNO08x IMU - UART-RVC mode");

  Serial1.begin(115200); // This is the baud rate specified by the datasheet
  while (!Serial1)
    delay(10);

  if (!rvc.begin(&Serial1)) { // connect to the sensor over hardware serial
    Serial.println("Could not find BNO08x!");
    while (1)
      delay(10);
  }

  Serial.println("BNO08x found!");
}

void loop() {
  BNO08x_RVC_Data heading;

  if (!rvc.read(&heading)) {
    return;
  }

  Serial.println();
  Serial.println(F("---------------------------------------"));
  Serial.println(F("Principal Axes:"));
  Serial.println(F("---------------------------------------"));
  Serial.print(F("Yaw: "));
  Serial.print(heading.yaw);
  Serial.print(F("\tPitch: "));
  Serial.print(heading.pitch);
  Serial.print(F("\tRoll: "));
  Serial.println(heading.roll);
  Serial.println(F("---------------------------------------"));
  Serial.println(F("Acceleration"));
  Serial.println(F("---------------------------------------"));
  Serial.print(F("X: "));
  Serial.print(heading.x_accel);
  Serial.print(F("\tY: "));
  Serial.print(heading.y_accel);
  Serial.print(F("\tZ: "));
  Serial.println(heading.z_accel);
  Serial.println(F("---------------------------------------"));


  //  delay(200);
}
By Lookang many thanks to Fu-Kwun Hwang and author of Easy Java Simulation = Francisco Esquembre - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=15837410

This guide was first published on Oct 14, 2020. It was last updated on 2023-12-04 10:49:40 -0500.

This page (UART-RVC for Arduino) was last updated on Sep 22, 2020.

Text editor powered by tinymce.