Pico and BNO055 IMU

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Pico and BNO055 IMU

Post by Roberthh » Wed Jan 05, 2022 12:29 pm

Did you connect the resistors between SDA and 3.3V, SCL and 3.3V?

Thomas_G_S
Posts: 18
Joined: Mon Jan 03, 2022 1:29 pm

Re: Pico and BNO055 IMU

Post by Thomas_G_S » Wed Jan 05, 2022 12:53 pm

My SDA and SCL aren't connected to a 3.3v pin. Only the power is. Have you got any idea why it might have changed, because it was working ok before without any change to the wiring.

Thomas_G_S
Posts: 18
Joined: Mon Jan 03, 2022 1:29 pm

Re: Pico and BNO055 IMU

Post by Thomas_G_S » Thu Jan 06, 2022 11:26 am

I've tried connecting the gyro to a greater power supply, ~5V. I've also changed the wiring to see if that makes a difference, and still no luck.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Pico and BNO055 IMU

Post by Roberthh » Thu Jan 06, 2022 12:00 pm

My SDA and SCL aren't connected to a 3.3v pin.
It is not about connecting these directly to 3.3V. The hint was to connect a 4.7k resistor between
- SDA and 3.3V
- SCL and 3.3V

That way, the level of the SDA and SCL signals is pulled up when not driven by board or sensor. Still strange, if the current setup works with another firmware/driver combo.

Thomas_G_S
Posts: 18
Joined: Mon Jan 03, 2022 1:29 pm

Re: Pico and BNO055 IMU

Post by Thomas_G_S » Thu Jan 06, 2022 12:57 pm

I still don't quite understand what you mean when you say "between the SDA/SCL and 3.3V". This is my current setup:
- Pico GP0 to BNO055 SDA
- Pico GP1 to BNO055 SCL
- Pico 3v3(out) to BNO055 Vin
- Pico GND to BNO055 GND

I have tried putting normal resistors into the SDA and SCL lines between the Pico and the BNO055, are these the same as pullup resistors? When we first got the gyro working it was with exactly this setup and driver.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Pico and BNO055 IMU

Post by Roberthh » Thu Jan 06, 2022 1:32 pm

A proper I2C looks like the picture below. Sometimes the devices like the Gyro have the Pullup resistors already integrated. Than you do not need external ones.
pullup.png
pullup.png (12.76 KiB) Viewed 12460 times

Thomas_G_S
Posts: 18
Joined: Mon Jan 03, 2022 1:29 pm

Re: Pico and BNO055 IMU

Post by Thomas_G_S » Thu Jan 06, 2022 1:39 pm

Ok, I think mine does, it is a breakout board and appears to have a lot of functions. Any idea why it isn't working with the basic setup then? I've tried changing the frequency as you said.

Nitrosfpv
Posts: 16
Joined: Sat May 01, 2021 1:09 pm

Re: Pico and BNO055 IMU

Post by Nitrosfpv » Sun Jan 09, 2022 8:29 pm

You have to set the frequency to 4000 then it works properly:

from bno055 import *
i2c = I2C (0, scl = Pin (5), sda = Pin (4), freq = 4000)
imu = BNO055 (i2c)

And yes, this is enough for the most complex control movements:

https://www.youtube.com/watch?v=9afIRWvspV8

;)

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Pico and BNO055 IMU

Post by Roberthh » Sun Jan 09, 2022 9:09 pm

You have to set the frequency to 4000 then it works properly
That is a clear indication that the external pull up resistors are missing, or/and the wires are too long. The internal pull up resistors are 30-40kOhm.

Thomas_G_S
Posts: 18
Joined: Mon Jan 03, 2022 1:29 pm

Re: Pico and BNO055 IMU

Post by Thomas_G_S » Sun Jan 09, 2022 9:38 pm

I tried setting the frequency to 4000 but still no luck. Thanks for the suggestion though Nitrosfpv :)

Roberthh, I've connected three pullup resistors in series to reach a total of 1.27kΩ (330Ω, 470Ω, 470Ω). The Pico is still failing to detect the BNO055. I'm using wires which are around 20 cm long. Any other suggestions?

Thank you so much for all of the help, much appreciated :)

Post Reply