Wish List 0

Gy 85 Bmp085 Sensor Modules 9 Axis Sensor Module

Rs. 684.00 Rs. 821.00

-This most recent nine DOF IMU sensor module referred to as GY-eighty five that has 3-axis gyroscope, triaxial accelerometer and 3-axis magnetic discipline.
-A kind of mixed sensor which use the IIC conversation protocol (fully like minded with three-5v machine, which includes the LLC circuit).
-It will help you to construct more outstanding associated initiatives.

Features
Immersion gold PCB process
Power supply: 3-5V
Size: 2.2cm * 1.7cm


SPECIFICATIONS
-9 axis module
-Chip                     : ITG3205 + ADXL345 + HMC5883L
-Power Supply     :  3-5v
OVERVIEW:
Power supply       3V - 5V
IO Voltage Level   3V - 5V
Communication      IIC communication protocol, fully compatible with the 3-5V System and circuit contain LLC

PACKAGE INCLUDES:

1 PCS x Gy 85 Bmp085 Sensor Modules 9 Axis Sensor Module



//SOURCE CODE TAKEN FROM BELOW LINK

/*https://www.himix.lt/arduino/arduino-and-gy-85-9dof-accelerometer-adxl345-gyroscope-itg3200-and-magnetometer-hmc5883-angle-information-comparison/ */

// Watch video here: https://www.youtube.com/watch?v=y4b-FcmOGV0


// Output for viewing with Serial Oscilloscope: accX,accY,magZ // gyrX, gyrY and gyrZ are commented out


/*

Arduino     MARG GY-85

  A5            SCL

  A4            SDA

  3.3V          VCC

  GND           GND

*/ 


#include <Wire.h>

#include <ADXL345.h>  // ADXL345 Accelerometer Library

#include <HMC5883L.h> // HMC5883L Magnetometer Library

#include <ITG3200.h>


ADXL345 acc; //variable adxl is an instance of the ADXL345 library

HMC5883L compass;

ITG3200 gyro = ITG3200();

float  gx,gy,gz;

float  gx_rate, gy_rate, gz_rate;

int ix, iy, iz;

float anglegx=0.0, anglegy=0.0, anglegz=0.0;

int ax,ay,az;  

int rawX, rawY, rawZ;

float X, Y, Z;

float rollrad, pitchrad;

float rolldeg, pitchdeg;

int error = 0; 

float aoffsetX, aoffsetY, aoffsetZ;

float goffsetX, goffsetY, goffsetZ;

unsigned long time, looptime;


void setup(){

  Serial.begin(9600);

  acc.powerOn();

  compass = HMC5883L();

  error = compass.SetScale(1.3); // Set the scale to +/- 1.3 Ga of the compass

  if(error != 0) // If there is an error, print it out.

    Serial.println(compass.GetErrorText(error));

  

 // Serial.println("Setting measurement mode to continous");

  error = compass.SetMeasurementMode(Measurement_Continuous); // Set the measurement mode to Continuous

  if(error != 0) // If there is an error, print it out.

    Serial.println(compass.GetErrorText(error));

    for (int i = 0; i <= 200; i++) {

    acc.readAccel(&ax, &ay, &az);

    if (i == 0) {

      aoffsetX = ax;

      aoffsetY = ay;

      aoffsetZ = az;

    }

    if (i > 1) {

      aoffsetX = (ax + aoffsetX) / 2;

      aoffsetY = (ay + aoffsetY) / 2;

      aoffsetZ = (az + aoffsetZ) / 2;

    }

  }

  for (int i = 0; i <= 200; i++) {

    gyro.readGyro(&gx,&gy,&gz); 

    if (i == 0) {

      goffsetX = gx;

      goffsetY = gy;

      goffsetZ = gz;

    }

    if (i > 1) {

      goffsetX = (gx + goffsetX) / 2;

      goffsetY = (gy + goffsetY) / 2;

      goffsetZ = (gz + goffsetZ) / 2;

    }

  }

  

  

  delay(1000);

  gyro.init(ITG3200_ADDR_AD0_LOW); 

 // Serial.print("zero Calibrating...");

 // gyro.zeroCalibrate(2500, 2);

 // Serial.println("done.");

}


void loop(){

  // code fragment for Accelerometer angles (roll and pitch)

  time = millis();

  acc.readAccel(&ax, &ay, &az); //read the accelerometer values and store them in variables  x,y,z

  rawX = ax - aoffsetX;

  rawY = ay - aoffsetY;

  rawZ = az  - (255 - aoffsetZ);

  X = rawX/256.00; // used for angle calculations

  Y = rawY/256.00; // used for angle calculations

  Z = rawZ/256.00; // used for angle calculations

  rollrad = atan(Y/sqrt(X*X+Z*Z));  // calculated angle in radians

  pitchrad = atan(X/sqrt(Y*Y+Z*Z)); // calculated angle in radians

  rolldeg = 180*(atan(Y/sqrt(X*X+Z*Z)))/PI; // calculated angle in degrees

  pitchdeg = 180*(atan(X/sqrt(Y*Y+Z*Z)))/PI; // calculated angle in degrees


// Code fragment for Magnetometer heading (yaw)

  MagnetometerRaw raw = compass.ReadRawAxis();

  MagnetometerScaled scaled = compass.ReadScaledAxis();

  int MilliGauss_OnThe_XAxis = scaled.XAxis;// (or YAxis, or ZAxis)

  float heading = atan2(scaled.YAxis, scaled.XAxis);

  float declinationAngle = 0.0457;

  heading += declinationAngle;

  if(heading < 0)

    heading += 2*PI;

  if(heading > 2*PI)

    heading -= 2*PI;

  float headingDegrees = heading * 180/M_PI;

  

// Code fragment for Gyroscope (roll, pitch, yaw)  

  gyro.readGyro(&gx,&gy,&gz); 

  looptime = millis() - time;

  gx_rate = (gx-goffsetX) / 14.375;

  gy_rate = (gy-goffsetY) / 14.375;

  gz_rate = (gz-goffsetZ) / 14.375;

  delay(100);

 /* Serial.print(gx_rate);  // calculated angle in degrees

  Serial.print(",");

  Serial.print(gy_rate);

  Serial.print(",");

  Serial.print(gz_rate); 

  Serial.println(","); 

*/    

  anglegx = anglegx + (gx_rate * looptime);

  anglegy = anglegy + (gx_rate * looptime);

  anglegz = anglegz + (gz_rate * looptime);

// Accelerometer, Magnetometer and Gyroscope Output

  Serial.print(rolldeg);

  Serial.print(",");

  Serial.print(pitchdeg);  // calculated angle in degrees

  Serial.print(",");

  Serial.print(headingDegrees);

  Serial.println(",");

  //Serial.print(anglegx); 

  // Serial.print(","); 

  //Serial.print(anglegy); 

  //Serial.print(","); 

  //Serial.println(anglegz);

  //Serial.println(looptime);

  //Output(raw, scaled, heading, headingDegrees);

}



void Output(MagnetometerRaw raw, MagnetometerScaled scaled, float heading, float headingDegrees)

{

   Serial.print("Raw:\t");

   Serial.print(raw.XAxis);

   Serial.print("   ");   

   Serial.print(raw.YAxis);

   Serial.print("   ");   

   Serial.print(raw.ZAxis);

   Serial.print("   \tScaled:\t");

   Serial.print(scaled.XAxis);

   Serial.print("   ");   

   Serial.print(scaled.YAxis);

   Serial.print("   ");   

   Serial.print(scaled.ZAxis);

   Serial.print("   \tHeading:\t");

   Serial.print(heading);

   Serial.print(" Radians   \t");

}

15 days

Write a review

Please login or register to review