Tag Archives | bno055

BNO055 IMU 9-Axis DOF Acceleration Analysis

In an effort to further delve into the inner workings of the BNO055 accelerometer and its functions, the serial plotter was applied to the project. To better understand how the produced data is rendered over the I2C SDA/SCL connection to the Nano, the data is translated by the plotter into a visual char as presented below. The gyro and magneto functions of the IMU are not included in this review to get a better depth of understanding around the module’s capabilities.

The amount of capacitive charge capacity within a capacitor. The permittivity of an insulator (ε) describes the insulator’s resistance to the creation of an electric field and is equal to 8.85×10-12 Farads per meter for an air-gap capacitor.

The three-axis of acceleration is plotted over time as a function of latitude movement (x-axis), longitude movement (y-axis), and vertical movement (z-axis). As the IMU module is moved and oriented to different positions, the sensor interprets that activity by measurement of differences in charge. Specifically, internally charged surfaces are separated by differences in area and distance to vary a combined capacitive charge. That change in charge, as measured, corresponds to the difference in acceleration since internal plate movement varies in all three directions.

In the photo here, imagine that a lower plate is moving up and down, back and forth through its comb structure. The surface area for each direction of movement brings about a difference in capacitive charge where that becomes interpreted as acceleration. The substrate below the comb structure consists of a surface area that corresponds to the z-axis charge that is tracked for changes in vertical acceleration. The lattice framed structure is suspended by springs to assure continuous and precise movement in any direction within defined limits.

It is again useful to recognize that the amount of charge present within the capacitor, or capacitive body, is determined by the surface area and distance between two charged plates. Reduce the surface area between the two plates, and the total capacitive charge is reduced. Increase the distance between the two plates and the capacitive charge is reduced. This simplified explanation does not take into account any dielectric properties that exist among different types of capacitors.

Red: X-axis latitude acceleration. Blue: Y-axis longitude acceleration. Green: Z-axis vertical. Notice that the green plot is tracking at
9.8m/s2 since that is the acceleration of gravity present at the IMU module. The -9.8m/s2 reading is with the IMU inverted with the internal
micro-electro-mechanical (MEM) structure pulled down by gravity.

Project Schematic:

The same basic connections are in place as before in the prior set up project. The key I2C communication connections between the modules remain in place to transfer clock and data for integration and processing. Both modules share the same ground and 5V VCC.

Project Review:

As demonstrated in this video, the IMU module’s data plot extends across time as the acceleration tests are carried out. As the IMU module is moved to different positions and orientations, observe the corresponding changes in plotted graphical data.


Code Example:

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>

/* Within the Adafruit Unified Library*/
#include <utility/imumaths.h>

#define BNO055_SAMPLERATE_DELAY_MS (100)

/* The myIMU object is self-declared. It can be named any identifier.*/
Adafruit_BNO055 myIMU = Adafruit_BNO055();

void setup()
{
Serial.begin(115200);
myIMU.begin();
delay(1000);

/* The in8_t is a very compact data type:*/
int8_t temp=myIMU.getTemp();

/* Instruction to use the onboard BNO055 VCXO, not on the MPU chip itself:*/
myIMU.setExtCrystalUse(true);
}

void loop()
{
imu::Vector<3> acc =myIMU.getVector(Adafruit_BNO055::VECTOR_ACCELEROMETER);
Serial.print(acc.x());
Serial.print(“,”);
Serial.print(acc.y());
Serial.print(“,”);
Serial.println(acc.z());

/* Insert delay to assure you’re not going faster than what the sensor can handle. */
delay(BNO055_SAMPLERATE_DELAY_MS);
}


BNO055 IMU 9-Axis DOF Hardware & Software Setup

Once initial hardware is in place, it is necessary to gather the libraries to run the software and get connectivity and begin gathering the Arduino unit and the BNO055 IMU Fusion module data. In this setup, various libraries are needed to run the code as it becomes developed in this post and further along among projects.

Project Schematic:

The physical build of the IMU assembly is very simple. Wiring between the IMU module and the Arduino Nano is as illustrated in the schematic below.

BNO055 Module:

The pins on the BNO055 are laterally interspersed by function. Namely, Power, I2C, and Utility. With VIN, 3VO, and Ground as the power input pins, the SDA (serial-data) and SCL (serial clock) are the I2C pins, and finally a mix of addressing, interrupt and mode pins (RST, INT, ADR, & PS0/PS1).

BNO055 Pinout:

PinNameDescription
1VIN3.3-5.0V power supply input
23VO3.3V output from the onboard linear voltage regulator, you can draw up to about 50mA.
3GNDThe common/GND pin for power and logic.
4SDAI2C data pin, connect to your microcontroller’s I2C data line. This pin can be used with 3V or 5V logic, and there’s a 10K pullup on this pin.
5SCLI2C data pin, connect to your microcontroller’s I2C data line. This pin can be used with 3V or 5V logic, and there’s a 10K pullup on this pin.
6RSTHardware reset pin. Set this pin low then high to cause a reset on the sensor. This pin is 5V safe.
7ADRSet this pin high to change the default I2C address for the BNO055 if you need to connect two ICs on the same I2C bus. The default address is 0x28. If this pin is connected to 3V, the address will be 0x29.
8INTThe HW interrupt output pin, which can be configured to generate an interrupt signal when certain events occur like movement detected by the accelerometer, etc. (not currently supported in the Adafruit library, but the chip and HW are capable of generating this signal). The voltage level out is 3V.
9PS1This pin can be used to change the mode of the device (it can also do HID-I2C and UART) and also is provided in case Bosch provides a firmware update at some point for the ARM Cortex M0 MCU inside the sensor. Should normally be left unconnected.
10PS0This pin can be used to change the mode of the device (it can also do HID-I2C and UART) and also is provided in case Bosch provides a firmware update at some point for the ARM Cortex M0 MCU inside the sensor. Should normally be left unconnected.

Project Review:

The physical movement of the IMU along the various degrees of freedom (DOF), produces vector data as demonstrated in this video. A before and after comparison of the data by a change of position indicates changes in the acceleration and gyroscope to validate positive and negative orientation.


Arduino IDE:

Arduino Libraries:

Arduino Serial Monitor:

Once a suitable serial COM port is selected from the tools menu, access to the Serial monitor is made available to call for its use in the setup code of the program (under void setup()) function as Serial.begin([baudrate]).

Select Suitable COM Port

Select Serial Monitor

View Serial Monitor for Vector Data

Code Example:

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h> //Within the Adafruit Unified Library

//The myIMU object is self-declared. It can be named any identifier.
Adafruit_BNO055 myIMU = Adafruit_BNO055();

void setup()
{
Serial.begin(9600);
myIMU.begin();
delay(1000);

//The in8_t is a very compact data type:
int8_t temp=myIMU.getTemp();

//Instruction to use the onboard BNO055 VCXO, not on the MPU chip itself:
myIMU.setExtCrystalUse(true);
}

void loop()
{
/*Go out to the IMU and return vector data with 3-components into
acc (accelerometer) named variable and store it into the created
object myIMU with the accelerometer parameter (since there are
three-axis x,y,&z). */

imu::Vector<3> acc =myIMU.getVector(Adafruit_BNO055::VECTOR_ACCELEROMETER);

/*Go out to the IMU and return vector data with 3-components into
gyro (gyroscope) named variable and store it into the created
object myIMU with the gyroscope parameter (since there are
three-axis x,y,&z). */

imu::Vector<3> gyro =myIMU.getVector(Adafruit_BNO055::VECTOR_GYROSCOPE);

/*Go out to the IMU and return vector data with 3-components into mag (magnetometer) named variable and store it into the created object myIMU with the magnetometer parameter (since there are three-axis x,y,&z). */

imu::Vector<3> mag =myIMU.getVector(Adafruit_BNO055::VECTOR_MAGNETOMETER);

Serial.print(“Acceleration X-Vector: “);
Serial.println(acc.x());
Serial.print(“Acceleration Y-Vector: “);
Serial.println(acc.y());
Serial.print(“Acceleration Z-Vector: “);
Serial.println(acc.z());
Serial.println(” “);
Serial.print(“Gyroscope X-Vector: “);
Serial.println(gyro.x());
Serial.print(“Gyroscope Y-Vector: “);
Serial.println(gyro.y());
Serial.print(“Gyroscope Z-Vector: “);
Serial.println(gyro.z());
Serial.println(” “);
Serial.print(“Magnetometer X-Vector: “);
Serial.println(mag.x());
Serial.print(“Magnetometer Y-Vector: “);
Serial.println(mag.y());
Serial.print(“Magnetometer Z-Vector: “);
Serial.println(mag.z());
Serial.println(” “);

/* Insert delay to assure you’re not going faster than what the sensor can handle. */
delay(BNO055_SAMPLERATE_DELAY_MS);
}