Pico with Adafruit BNO055 #11299
-
I have read the discussion archive on the micropython forum about using a BNO055 IMU with a Pico. That was where I found the github project []. The problem I have is that I hooked the BNO055 board to the Pico as described, loaded the code using Thonny and I only get an error that the BNO055 is not found. To prove that the BNO055 is ok, I connected it to an Arduino and it works so I know the BNO055 is not the problem. The Vout on the Pico is 3.3V and the Vout on the Arduino is 5V. I have SDA, SCL, power, ground hooked up to the Pico, but nothing. What could possibly be wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 19 replies
-
Which pins are you using and how are you initialising I2C? What is the result of issuing |
Beta Was this translation helpful? Give feedback.
-
Yes, sir I had the pins wrong. I swapped the wires around and now I'm getting data. Luckily I have the Kittronik kit and on the back of the experiments book it has the pinouts. I had sda and scl on gpio12 and 13 respectively. I didnt correct the pull up resistors and it's been printing data for about 10 minutes. Maybe I don't need them? Just out of curiosity now that it is running, I ran i2c.scan() and it failed saying something about i2c not defined, so I disconnected sda and ran it again. This time it gave me a whole array of numbers starting with 8.
Anyway, thank you so much for the code and the help getting the BNO055 wired up correctly. This is fun stuff. |
Beta Was this translation helpful? Give feedback.
-
I2c.scan() returning (almost) all addresses means a problem with wiring or pull up resistances on the bus |
Beta Was this translation helpful? Give feedback.
-
I've had the BNO055 connected and running for hours and hours at a time without a hiccup. I did not use the pullup resistors and I notice the speed of update is not all that fast and the graph in thonny has lots of gaps in data when I move the sensor and board setup. If I were to use the pullups would I be able to get faster data? |
Beta Was this translation helpful? Give feedback.
-
The sphere is very memory intensive - I tested on a Pyboard D SF6W. Drawing an equator in a different color should be easy, something like class Sphere(Shape): # Unit sphere in XY plane centred on origin
def __init__(self, color, equ_color, segments=12):
lines = []
s = Circle(color)
equ = Circle(equ_color) # Equator
xrot = Rotator(2 * pi / segments, 1, 0, 0)
for n in range(segments / 2 + 1):
gc.collect()
if n == 0: # Draw equator
lines.extend(equ.lines[:])
else:
lines.extend(s.lines[:])
s @= xrot
super().__init__(lines) As for how to rotate things I can only suggest you read the docs: 3D rotation is the essential purpose of the quaternions module. In essence you need to define a rotation quaternion and use the @ operator. Experiment at the REPL! |
Beta Was this translation helpful? Give feedback.
-
Sorry about the bad formatting. I copied the text from thonny and used the <> and it looks formatted wrong. Anyway, I have no clue how to use the imaginary/complex stuff to make a vector, so I just copied from the aclock code and the alevel code. It's very easy to get data from the BNO055.
acompass() |
Beta Was this translation helpful? Give feedback.
The I2C scan result indicates that you have a hardware problem on the I2C bus. Are you sure you're not confusing package pin numbers and GPIO numbers? SDA should be GPIO16, package pin 21.
In my experience with the Pico it is safest to explicitly state the pins used in the class constructor as the defaults are undocumented.