This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connect magnetic sensor as compass
#1
Hi All,

As I want to have a more future proof (backup) system, I decided to replace my Moitessier with more standard components.

Which is where I ran into problems: I bought a magnetic sensor (MPU9255/ GY9255) and hooked it up according to a makersforum blog post

Next, the I2C app sees a device on port 0x68, but the PyPilot app, while showing some data, is only static/. No motion detected, no data on the 'scope'. 

What am I doing wrong? Is it the wrong device for its purpose? (I do not care too much for the accelerometers, I just want relatively reliable magnetic heading info)

Any hits are appreciated!
Reply
#2
did you follow this guide:

https://openplotter.readthedocs.io/en/la...ation.html#
Reply
#3
(2021-04-30, 06:10 PM)Techstyle Wrote: did you follow this guide:

https://openplotter.readthedocs.io/en/la...ation.html#

Certainly, that is the part where I do not see any data. That is, alignmnet is (something like)  [0.707, -0.707, 0.0, 0.0] 0.0 and doesn't change.
I do not get any calibration points in the compass screen. So either the MPU9255/ GY9255, while detected, is not giving any data, or it is not read correctly. 
Or, I am missing something..?../
Reply
#4
(2021-05-03, 07:32 AM)fishy Wrote:
(2021-04-30, 06:10 PM)Techstyle Wrote: did you follow this guide:

https://openplotter.readthedocs.io/en/la...ation.html#

Certainly, that is the part where I do not see any data. That is, alignmnet is (something like)  [0.707, -0.707, 0.0, 0.0] 0.0 and doesn't change.
I do not get any calibration points in the compass screen. So either the MPU9255/ GY9255, while detected, is not giving any data, or it is not read correctly. 
Or, I am missing something..?../
This is what PyPilot shows me:    
Reply
#5
I have a different IMU than you but at one point, I did try the one you are using and I configured it a little different:

1. VCC - check your literature - on the one I had, you either had to give it 5v or short circuit the two pads that are next to the voltage regulator
2. I did not connect EDA and ECL - just SCL and SDA

on the Pypilot screen you should see "Detected IMU: MPU9225".

I don't think the "I2C enabled | Not running" is a good thing
Reply
#6
Thanks for your response.

what IMU do you have? (Sorely missing some hardware guidance at this point)

The documentation has it using 3.3V, so that's what I am doing. I have also tried only hooking up SCL-SCA only, no cigar.
I2C enabled, not running has been there from the initial install- and yes I2C is enabled in the Pi settings. I can not really find any details on what this message means..

Seems either my Pi, or my MPU (or both?) are toast..?..
Reply
#7
(2021-05-04, 07:35 AM)fishy Wrote: Thanks for your response.

what IMU do you have? (Sorely missing some hardware guidance at this point)

The documentation has it using 3.3V, so that's what I am doing. I have also tried only hooking up SCL-SCA only, no cigar.
I2C enabled, not running has been there from the initial install- and yes I2C is enabled in the Pi settings. I can not really find any details on what this message means..

Seems either my Pi, or my  MPU (or both?) are toast..?..

I have BerryIMU V2, which has been replaced by version 3 and therefore expensive.  I am also questioning the info I get from it so would not necessarily recommend it - I failed to get a 3D fix last season and therefore just used GPS for heading.

I also bought HiLetgo MPU9250 and tried that but I think I did a bad job modifying it to work at 3.3V.  the device is designed for 5V or 3.3V but at 3.3V you have to close the two contacts - but they are tiny and my soldering is rubbish.

   

my understanding is that the voltage regulator accepts 5V and outputs 3.3V or you short the 2 pads together and bypass the regulator to use 3.3V
Reply
#8
Are you sure about the 5V? In the amazon site you linked there's this Q/A:
Question:I know you can connect vcc to 5v but can you connect the other pins to 5v? (ex: with an arduino uno would i need a logic level converter?)
Answer:No the module is 3.3 V so you will need a logic level converter or 3.3 V Arduino like the pro mini. 5 V is supported because there is a 3.3 V regulator on the board.
By Dancing Robots on December 8, 2018
Reply
#9
(2021-05-04, 01:47 PM)fishy Wrote: Are you sure about the 5V? In the amazon site you linkedm there's this Q/A:
Question:I know you can connect vcc to 5v but can you connect the other pins to 5v? (ex: with an arduino uno would i need a logic level converter?)
Answer:No the module is 3.3 V so you will need a logic level converter or 3.3 V Arduino like the pro mini. 5 V is supported because there is a 3.3 V regulator on the board.
By Dancing Robots on December 8, 2018

Read the last sentence of the product page on the manufacturers website: http://www.hiletgo.com/ProductDetail/1953399.html

if you look at the schematic:
   

I don't know if the version you have has the voltage regulator but maybe attach 3.3V and then probe for voltage on the other side of the regulator
Reply
#10
Fishy - I'm having the exact same problem as you with the 9255. I can get I2c to see address 68 and also 69 if you drive pin AD0 high. Pypilot seems to auto detect the IMU but I'm not seeing any data being collected from the sensors, a little probing around gave me this:

ERROR: IMU Init Failed, no inertial data available
pypilot_server: bind failed; already running a server?
Using settings file RTIMULib.ini
Detected MPU9250/MPU9255 at option address
Using fusion algorithm Kalman STATE4
IMU Name: MPU-925x
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
I2C read error from 12, 16 - Failed to read compass fuse ROM

I also had it hooked up to an Arduino board and was getting similar failure messages over the serial port. I've ordered a new one, seems they are a little flaky out of the box. Unless there's something missing here. It should be with me tomorrow so will see how a new one compares, if I'm still getting the same problem I'll likely try a different type.

I'm also having probs getting the GPS data shared properly, currently either OpenCPN or Pypilot can receive the GPS data, not both at the same time but that's another story..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)