Go Down

Topic: Trouble with the GY-86 module (Read 204 times) previous topic - next topic

dkim360

I have been having some issues with the GY-86 module.  It uses the MS5611, HMC5883L, and MPU6050 sensors., but I'm using it as an altimeter so I really only need the MS5611. I have it wired up and tried out some code (see below) but there seems to be some problems. Here's the wiring:
VCC - 5V
GND - Ground
SCL - Arduino Uno Analog Pin 5
SDA - Arduino Uno Analog Pin 4
And for the code I am using the MS5611 Library. Here is the code:
Code: [Select]
#include <Wire.h>
#include <MS5611.h>

MS5611 ms5611;

void setup()
{
  Serial.begin(115200);

  // Initialize MS5611 sensor
  // Ultra high resolution: MS5611_ULTRA_HIGH_RES
  // (default) High resolution: MS5611_HIGH_RES
  // Standard: MS5611_STANDARD
  // Low power: MS5611_LOW_POWER
  // Ultra low power: MS5611_ULTRA_LOW_POWER
  while(!ms5611.begin(MS5611_ULTRA_HIGH_RES))
  {
    delay(500);
  }
}

void loop()
{
  // Read true temperature & Pressure (without compensation)
  double realTemperature = ms5611.readTemperature();
  long realPressure = ms5611.readPressure();
  double realAltitude = ms5611.getAltitude(realPressure);

  // Read true temperature & Pressure (with compensation)
  double realTemperature2 = ms5611.readTemperature(true);
  long realPressure2 = ms5611.readPressure(true);
  double realAltitude2 = ms5611.getAltitude(realPressure2);

  // Output
  Serial.print(realTemperature);
  Serial.print(":");
  Serial.print(realTemperature2);
  Serial.print(":");
  Serial.print(realPressure);
  Serial.print(":");
  Serial.print(realPressure2);
  Serial.print(":");
  Serial.print(realAltitude);
  Serial.print(":");
  Serial.print(realAltitude2);
  Serial.println();
}

So when I try to upload, while it is compiling, an error message pops up. It reads  "no matching function for call to "MS5611::MS5611()" and highlights "MS5611 ms611" (line three of the code). I don't know if the code is wrong or the wiring. I have researched SCL and SDA quite a bit, an looked online for GY-86 tutorials, but they all don't seem to work. Any help, info, or advice would be greatly appreciated. Feel free to ask any questions especially if I wasn't clear about anything. 
Thank you.

arduarn

It's much better to copy and paste the complete compiler output rather than just a summary.

Taking a stab in the dark here: Was the jarzebski MS5611 library the first one you installed? Either way, take a look in your libraries folder and remove any other MS5611 libraries that might be installed there. It could be that the wrong library is being chosen for the compilation.

dkim360

It's much better to copy and paste the complete compiler output rather than just a summary.

Taking a stab in the dark here: Was the jarzebski MS5611 library the first one you installed? Either way, take a look in your libraries folder and remove any other MS5611 libraries that might be installed there. It could be that the wrong library is being chosen for the compilation.
So I replaced the library and made sure the Jarzbeski library was the only one. It correctly compiles now, but when I open the serial monitor it only reads Initializing Module and nothing happens after.

jremington

#3
Nov 25, 2020, 01:59 am Last Edit: Nov 25, 2020, 02:01 am by jremington
Use the I2C address scanner to check whether I2C communication is working. You may be missing the required pullup resistors on SDA and SCL.

dkim360

Use the I2C address scanner to check whether I2C communication is working. You may be missing the required pullup resistors on SDA and SCL.
That's strange. It says no devices found. I guess my wiring is incorrect:
Arduino Uno
VCC - 5V
GND - Ground
SCL - A5
SDA - A4

dkim360

Use the I2C address scanner to check whether I2C communication is working. You may be missing the required pullup resistors on SDA and SCL.
Wait... I got the scanner to work. One of the jumper wires were defective. Here's what it says:
18:09:38.089 -> Scanning...
18:09:38.089 -> I2C device found at address 0x68  !
18:09:38.135 -> I2C device found at address 0x77  !
18:09:38.182 -> done

dkim360

Okay. I got the serial monitor to open and work now, but the readings are obviously wrong.
18:13:00.869 ->  rawTemp = 0, realTemp = -129.70 *C
18:13:00.916 ->  rawPressure = 0, realPressure = -102807 Pa
18:13:00.963 ->  absoluteAltitude = nan m, relativeAltitude = 0.00 m

jremington

There is still a communications problem, because the I2C scanner does not see the HMC5883 magnetometer.

dkim360

There is still a communications problem, because the I2C scanner does not see the HMC5883 magnetometer.
Hmm yes. A problem with the sensors/module it self?

jremington

#9
Nov 25, 2020, 04:14 am Last Edit: Nov 25, 2020, 04:21 am by jremington
There are several possible reasons why the magnetometer is not detected: bad chip, lack of or wrong I2C pullups, etc. If it is malfunctioning, that could hamper communication with the other chips.

The cheap Chinese sensor modules are always suspect, and if you paid US$ 21 from NewEgg for it, that is a genuine ripoff. They are likely to be made from reject, recycled or counterfeit chips, or can be defective because of poor quality control, damage during shipping and for other reasons.  I might buy a couple and plan on throwing away the nonfunctional ones.

If you want things to actually work, buy modules from reputable manufacturers who support their products. Pololu is probably the best, and their sensors are state of the art, guaranteed to work out of the box and are supported by well crafted software and engineers who constantly monitor the user forum.

dkim360

There are several possible reasons why the magnetometer is not detected: bad chip, lack of or wrong I2C pullups, etc. If it is malfunctioning, that could hamper communication with the other chips.

The cheap Chinese sensor modules are always suspect, and if you paid US$ 21 from NewEgg for it, that is a genuine ripoff. They are likely to be made from reject, recycled or counterfeit chips, or can be defective because of poor quality control, damage during shipping and for other reasons.  I might buy a couple and plan on throwing away the nonfunctional ones.

If you want things to actually work, buy modules from reputable manufacturers who support their products. Pololu is probably the best, and their sensors are state of the art, guaranteed to work out of the box and are supported by well crafted software and engineers who constantly monitor the user forum.
I looked at the review for the sensor, and this problem seems common. But I don't need the altimeter. I just need the Ms5611 for the altitude reading. Is it possible to only get that reading?

jremington

#11
Nov 25, 2020, 06:26 am Last Edit: Nov 25, 2020, 06:30 am by jremington
Why not buy a guaranteed functional, state of the art pressure sensor module for $3.95 plus shipping?  I use this one, and highly recommend it. For twice the price, this one is about 10x more accurate.

Quote
this problem seems common
That is sad. The module is evidently a piece of junk. Can you send it back as nonfunctional?

Go Up