Jump to content
I2Cdevlib Forums

Samellanak

Members
  • Posts

    0
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Samellanak reacted to zzz2b2 in teapot demo works at last   
    I got the teapot demo to work after MANY hours. My 6050 IMU GY-521 is connected with 5 wires GND,V+,SDA,SCL and INT.
    BTW you do need a reset button on the arduino (so the MiniPro will not work).
    Then make sure to edit the INO from https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050/Examples/MPU6050_DMP6
    to enable teapot format output by commenting out 'yawpitch' and uncommenting the 'teapot' lines like so:
    //#define OUTPUT_READABLE_YAWPITCHROLL
    #define OUTPUT_TEAPOT
    Make sure the baud rates are the same in the INO and the PDE:
    Then run the processing PDE from the below link (with the toxiclib PDE library installed):
    https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050/Examples/MPU6050_DMP6/Processing ...
    After a few seconds you should see a small window pop up with an airplane in it. If it does not move, just press the reset button on the arduino and the plane will start moving.
    I am running win7 32bit and Java V7, PROCESSING V2 and IDE v 1 05 . I also found that If I get Java error messages, the only way to correct this , is to reboot the PC.
     
  2. Like
    Samellanak reacted to WanaGo in ADS1115 Single Ended mode - Strange results   
    Hello,
     
    Basically what I am doing is I have the ADS1115 in single channel mode, measuring the voltage across a resistor, which indicates the current flowing through the resistor. The current comes from an AC Current Clamp which sits on my mains power board.
     
    Basically what I am trying to do is measure the current flowing, using information I have found on the openenergymonitor.org site.
    They have a library which basically offsets the AC wave into the positive space, then filters out the wave in code and samples the wave to get an average, which then gives you the current flowing in the AC line.
     
    They have used the standard 10 bit ADC on the Arduino, but I wanted to use the 16bit ADS1115 instead.
     
    I have set the Gain to be 4.096, and have tried 860samples/second in continuous mode, but I am seeing very weird results sometimes.
    Its like Channel 0 is merging into Channel, and 2 into 3, or some other random combination, and I cannot fully understand what is going on.
     
    I found a similar problem described on the Adafruit website http://forums.adafruit.com/viewtopic.php?f=19&t=54496
    This is however using their own library, but one guy mentions yours and said it has a similar problem. He describes a fix, but I cannot find where to apply that.
     
    I am also using a Chipkit board, so its running at 80Mhz compared to the 16Mhz of the Arduino.
     
    I was wanting to know if you could tell me if there is any reason why doing
    sampleI = adc.getConversionP1GND();
     
    quite fast, would cause problems. I was under the impression that you could call this as often as you liked, and it would just report the current figure that the ADS1115 had measured at the time, since its in continuous mode. Is that right?
     
    Here are the 2 main functions I have in my code, which is mainly copied out of the example from the openenergymonitor.org website
    double calcIrms(int NUMBER_OF_SAMPLES, int Channel) {                 double ADC_COUNTS = 24512; //portion of 15bit count used for range                 double SUPPLYVOLTAGE = 3064; //3.064V is the full scale I can output into sensor from clamp                 double ICAL = 100; //current constant = (100 / 0.050) / 20 = 100                 for (int n = 0; n < NUMBER_OF_SAMPLES; n++)                 {                                 lastSampleI = sampleI;                                 if(Channel == 1)                                 {                                                 sampleI = adc.getConversionP1GND();                                 }                                 else if(Channel == 3)                                 {                                                 sampleI = adc.getConversionP3GND();;                                 }                                 else                                 {                                                 return 0;                                 }                                 lastFilteredI = filteredI;                                 filteredI = 0.996 * (lastFilteredI + sampleI - lastSampleI);                                 // Root-mean-square method current                                 // 1) square current values                                 sqI = filteredI * filteredI;                                 // 2) sum                                 sumI += sqI;                 }                 double I_RATIO = ICAL * ((SUPPLYVOLTAGE / 1000.0) / (ADC_COUNTS));                 double Irms = I_RATIO * sqrt(sumI / NUMBER_OF_SAMPLES);                 //Reset accumulators                 sumI = 0;                 return Irms; } void loop() {                 Irms1 = calcIrms(100, 1);  // Calculate Irms only                 Irms3 = calcIrms(100, 3);  // Calculate Irms only                 apparentPower1 = supplyVoltage * Irms1;     //extract Apparent Power into variable                 apparentPower3 = supplyVoltage * Irms3;     //extract Apparent Power into variable } I am displaying this to a TFT LCD and sometimes the figures just drop to 0 and stay there, and now and then the numbers blink to show something, and then go away again.
     
    Any help you could provide would be appreciative, esp if you see that I am doing something stupid.
    Regards
    WanaGo
  3. Like
    Samellanak reacted to theBliz in MPU-6050 and i2cdevlib "slide" for a while on turn on   
    Hi I'm new to Arduino and I'm trying to use a 6DOF IMU (the MPU-6050) along with the i2cdevlib.
    I've been able to set the libraries and to execute a sketch in order to calculate the offset of the IMU
    starting from the raw data. 
    Now I'm trying to execute the example code that i found on the github  of the i2cdevlibhttps://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/Examples/MPU6050_DMP6/MPU6050_DMP6.ino  setting the output in the YPR modeCode: #define OUTPUT_READABLE_YAWPITCHROLL with and without my offset parameters.
    In both sketches I found the same issue.
    The data on the serial  shift from the initial position for 5-8 second showing an increment of several degrees (depends on the cases but usually there are 12-25 degrees) of the YPR angles without moving the IMU.
    The same thing happen with the Euler anglesCode: #define OUTPUT_READABLE_EULER I've tried also to execute the quaternion output modeCode: #define OUTPUT_READABLE_QUATERNION which i don't know how to read (I'm just started learning about this) but the value I read on the serial seems to stay "stable".

    I might solve this with a delay from the turn on which allow me to see of how much degrees the IMU "virtually moved" and then subtract that value to future reading (such as another offset) but i find this not usefull since I need the IMU to have the right angles on the turn on.

    Thanks for reading, hope someone could help me   
  4. Like
    Samellanak reacted to lectroidmarc in Support for this sensor?   
    Hello,
     
    I see the MPL3115A2 in the list of supported devices, but it doesn't seem to be present in the code.  Even the github link on http://www.i2cdevlib.com/devices/mpl3115a2#source points to code that doesn't exist.
     
    I just got one of these so if it's really supported, that would be great.
     
    Thanks,
    Marc
  5. Like
    Samellanak reacted to nicnac in GY-86   
    Hey!
    I've got a GY-86 with MPU6050, a Barometer and the HMC5883L.
     
    On the Arduino (UNO) I get the MPU to work. But I can't figure out how to get the magnetometer data!
    I2C scanner tells me:
     
    Scanning...
    I2C device found at address 0x68  !
    I2C device found at address 0x77  !
    done
     
    and 0x68 is definately the mpu6050. And since I know, that it can be a master again, I suspect, that the other would be barometer and the HMC is on the slave of the MPU. Am I right with that? Can anybody tell me how I can proceed? Check my assumption or just get the mag data?
     
    Any help much appreciated!!
  6. Like
    Samellanak reacted to ger in L3G4200D raw data   
    Hi,
     
    I'm having a bit of trouble understanding the output of the L3G4200D Gyroscope.
     
    When I run the sample program I get an output on all axis between 0 and 255. It doesn't seem to distinguish between clockwise rotation and anti-clockwise rotation.
     
    Here's an example of the output from running https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/L3G4200D/Examples/L3G4200D_raw/L3G4200D_raw.ino (excluding Serial.print("angular velocity:\t"); )
     
    Does anyone know if this is correct?
    Initializing I2C devices... Testing device connections... L3G4200D connection successful 183 213 32 8 253 19 9 255 23 11 0 26 8 252 17 11 255 24 11 253 16 7 252 20 8 253 17 12 254 17 8 1 18 10 255 17 12 250 19 5 251 19 13 0 22 10 254 19 13 254 18 10 254 18 13 254 15 13 1 25 10 254 20 14 255 17 13 250 20 18 255 21 11 0 19 14 1 14 14 255 16 12 0 17 7 255 19 10 252 19 13 254 18 10 248 14 7 254 15 10 252 20 8 253 19 10 251 14 11 254 18 11 3 19 10 255 12 9 252 18 13 3 20 9 255 18 9 4 24 13 1 18 8 4 17 16 0 16 10 0 22 7 1 12 15 255 16 10 1 21 11 255 23 6 0 19 9 252 23 11 4 15 7 252 20 8 1 20 5 1 20 11 254 15 7 252 16 15 255 15 11 254 18 14 250 20 14 254 20 6 255 25 8 250 21 7 255 22 12 253 23 11 0 14 11 252 20 8 253 24 10 251 16 5 251 18 12 254 20 18 254 18 15 254 24 3 255 22 5 251 15 9 0 18 7 249 20 12 255 22 7 252 21 12 3 19 11 253 22 13 253 17 13 1 15 13 1 21 8 251 16 7 255 16 13 250 23 8 255 16 10 252 18 9 1 20 10 255 17 14 252 18 9 251 13 11 254 19 12 253 22 9 1 15 13 251 19 9 255 20 6 249 16 8 253 17 10 1 24 8 253 18 9 253 16 10 248 22 7 251 21 8 3 21 10 253 19 10 0 23 10 250 19 5 255 19 11 250 20 11 252 26 10 250 19 11 251 12 10 254 15 12 0 18 10 255 23 7 0 21 9 250 22 13 251 16 8 248 22 9 0 18 9 255 24 15 254 17 7 255 25 10 255 19 14 253 19 13 252 25 11 2 17 9 255 18 12 5 21 13 254 20 13 254 17 13 0 20 12 0 20 11 250 25 6 255 16 16 1 17 14 253 19 10 255 19 11 255 19 9 254 24 10 1 17 12 250 18 7 5 13 9 255 21 4 249 20 15 255 15 9 245 16 7 248 18 9 1 17 9 252 21 7 0 16 14 252 17 9 255 18 10 1 20 12 251 17 14 253 19 10 1 17 12 255 13 10 252 14 10 254 16 11 255 17 7 255 21 10 0 21 10 254 21 9 0 20 9 254 16 10 0 15 12 254 13 8 250 16 14 0 11 12 255 16 12 3 19 7 251 25 11 255 18 10 255 22 9 255 15 11 254 19 12 251 17 13 255 18 8 253 19 14 0 17 9 254 19 16 250 19 7 1 20 11 1 17 8 255 20 7 1 16 11 0 15 17 1 19 11 0 22 12 254 20 13 253 17 12 255 17 12 254 28 11 252 21 13 252 20 14 254 18 12 251 18 11 251 22 10 253 18 9 0 23 15 248 20 13 0 15 10 254 20 10 255 19 10 254 18 7 249 21 10 251 21 7 1 23 7 252 15 6 253 19 9 254 18 13 253 18 8 246 21 11 255 14 12 0 13 7 254 22 12 252 20 7 254 20 13 251 18 12 254 13 9 249 17 8 253 20 13 255 20 11 253 17 14 254 21 16 2 19 12 255 15 10 255 17 11 0 20 9 253 17 12 0 21 11 247 16 11 0 22 8 0 15 8 254 17 13 253 20 9 1 14 13 253 17 8 252 19 13 255 18 11 252 23 9 252 18 14 253 16 9 4 24 18 253 25 9 251 18 6 0 18 12 1 21 18 254 17 10 2 19 14 254 17 10 255 24 9 251 18 10 0 16 11 3 18 7 254 24 8 1 16 7 255 18 10 1 16 9 254 20 15 249 20 6 0 14 13 252 23 10 253 18 7 254 20 10 254 19 10 1 19 11 255 20 13 250 17 17 253 15 13 251 18 6 255 19 7 249 15 11 253 16 12 252 16 9 254 18 10 2 19 7 3 23 10 252 19 8 2 12 6 255 17 14 254 15 11 251 16 14 2 14 7 1 22 9 253 17 14 0 17 15 252 16 11 250 21 5 255 16 8 253 18 8 253 25 11 253 18 10 253 13 9 252 15 7 0 20 11 255 19 11 253 21 5 255 16 13 251 15 13 254 19 10 5 9 9 1 17 4 254 15 12 254 11 9 1 17 10 254 19 11 254 22 13 254 16 12 5 20 11 1 20 13 252 21 13 252 18 8 254 22 16 253 20 10 253 22 8 252 17 9 253 15 14 255 17 11 0 14 8 252 14 11 0 17 8 249 20 8 247 17 12 1 20 9 255 21 11 0 26 10 255 22 10 3 15 9 0 18 8 253 17 10 252 14 6 255 15 11 248 21 10 255 25 5 254 20 8 254 17 13 252 21 13 254 17 9 254 17 7 1 23 4 253 20 13 254 20 9 254 18 5 251 21 10 2 17 9 2 21 16 252 16 15 253 16 6 255 15 12 254 20 11 0 19 10 254 17 13 1 19 11 255 17 11 251 21 10 0 19 9 2 21 10 0 21 14 249 18 14 250 16 14 250 18 12 1 14 13 254 16 9 254 16 10 252 19 9 250 13 6 255 17 7 251 16 16 2 23 13 253 20 8 2 20 9 3 22 12 0 27 16 255 94 11 1 120 13 3 104 238 88 101 0 226 240 52 142 52 242 158 234 66 128 179 137 235 17 234 154 7 117 1 152 25 76 231 189 157 44 1 121 104 122 198 127 102 126 232 216 201 119 95 174 108 255 122 49 115 129 78 108 56 218 140 135 143 121 206 161 61 187 0 13 216 107 80 45 51 165 187 158 69 135 29 44 97 142 9 171 119 6 49 157 81 109 232 41 185 148 5 232 242 146 242 217 20 252 146 103 211 101 27 135 253 235 202 30 173 252 118 41 127 59 203 43 63 102 45 105 189 218 142 121 158 213 15 190 44 39 82 34 173 69 128 239 221 38 13 123 193 110 170 216 114 32 34 144 115 36 17 76 104 251 224 5 1 240 197 74 61 36 166 236 64 3 59 236 163 120 138 123 107 236 192 27 0 147 51 196 118 125 191 9 227 224 220 170 24 61 189 61 13 249 96 143 116 131 21 32 56 15 3 44 18 10 40 25 3 52 23 251 148 18 249 88 18 250 64 136 168 78 9 250 170 19 238 162 12 247 52 6 220 15 10 15 19 12 17 16 7 1 20 8 247 20 8 248 23 15 253 16 12 12 18 10 255 17 9 254 18 13 2 19 14 249 17 9 0 18 11 252 16 10 4 18 13 251 14 11 0 18 6 0 20 12 0 24 8 255 17 14 252 22 12 252 20 11 0 21 8 255 19 11 252 19 8 0 14 6 0 19 5 6 19 11 254 16 4 250 207 13 0 25 9 250 26 13 252 25 9 254 20 17 7 40 10 0 246 15 2 245 12 248 18 5 249 25 10 0 20 11 3 35 10 6 251 8 255 62 11 0 75 10 245 95 9 238 47 11 249 18 14 245 23 40 225 47 128 229 66 224 64 96 196 252 72 41 230 164 162 125 48 227 241 27 226 245 249 237 230 232 120 96 120 162 100 67 7 9 241 112 172 13 30 224 140 102 162 244 63 53 56 89 228 166 248 173 152 14 94 190 153 6 96 137 227 199 124 199 77 56 146 228 68 250 158 3 5 135 165 210 67 13 13 78 32 17 225 150 208 168 129 112 69 184 240 152 236 231 29 42 129 193 207 8 32 70 206 85 57 223 14 111 228 242 176 6 141 121 130 167 55 103 163 245 62 71 133 246 243 69 210 46 51 182 4 118 126 223 14 60 213 223 71 224 237 16 252 10 13 11 29 66 20 
  7. Like
    Samellanak reacted to damienLAURENT in No interrupt signal from sparkfun mpu6050   
    Hello,
     
    Thanks to Jeff for his work ! I couldn't even try using DMP without his code...
     
    The MPU6050_raw works well with my sparkfun mpu6050 connected to an arduino uno.
    The MPU6050_DMP6 has an irregular behavior. When launching, the serial monitor says "DMP ready! Waiting for first interrupt...", and indeed it waits a pretty long time...
    The interrupt pin is connected to arduino pin 2
    I've also tried to connect the vio to arduino 3.3v
    The point is that I've no interrupt signal when connecting an oscilloscope on INT pin of the mpu... is there a hardware issue ? or should I initialize something in the mpu ?
     
    Thanks for your response
     
    damien
  8. Like
    Samellanak reacted to Jmakin23 in Multiple MPU6050's using DMP and interrupts   
    Hi,
    I am new to this so please bear with me. My current project requires that i use multiple MPU6050's in order to track the motion of a person.
    I am aware that the MPU6050 has two addresses and that in the code supplied by jeff you can state which address on the I2C bus to read from.
    The problem is with the use of the DMP code and interrupts, am I able to attach the second IMU to the alternate interrupt pin on the Arduino Pro Mini that I am using? If i was to do this what would i have to do in the example code and/or the libraries in order to determine which interrupt is read etc.
     
    I have tried to interpret the libraries to see if there was a line of code that states which interrupt pin is being used but i quite frankly dont know what i am looking at or looking for.
     
    I hope that someone will be able to help me.
     
    Thanks
  9. Like
    Samellanak reacted to SmartBomb in Convert DMP Values to G-Force   
    I was under the impression that the default range for the MPU-6050 accelerometer was +/-2g, but after doing some datalogging I'm beginning to think that is only the case for the raw values (i.e. using MPU6050_raw.ino)  and not true when using the DMP (i.e. using DMP6050_DMP6.ino). The values I obtained are half of what I believe they should be, leading me to believe that with DMP the default range is +/-4g.
     
    I found a line in MPU6050_6Axis_MotionApps20.h that only confuses me more:
    // get rid of the gravity component (+1g = +8192 in standard DMP FIFO packet, sensitivity is 2g)  If the sensitivity is 2g, doesn't 1g = 16,384? Or am I reading the datasheet incorrectly? At this point I'm pretty confused and hopefully somebody can clear it all up for me... 
  10. Like
    Samellanak reacted to ibrahims in MSP430 + MPU 9150   
    Hi im trying to access the magnetometers data. I am using Energia. THe following code is being used. The x,y,z values are all nearly the same. If anyone can please post a fix with code this would be helpful.
     

  11. Like
    Samellanak reacted to Kuba in MPU-6050 DMP with magnetometer fusion   
    Hi,
    I know that there are some eamples showing how to put magnetometer data into DMP. For example this one:
    http://www.i2cdevlib.com/forums/topic/111-arduino-example-sketch-to-read-magnetometer-while-dmp-is-on/
    but it does not make any sensor fusion.
     
    I couldn't find any library which would make magnetometer fusion inside DMP. Does such library exist?
    Maybe code in this file
    MPU6050_9Axis_MotionApps41.h make DMP+magnetometer fusion? I couldn't find any tips in the code and right now I am not able to test it.
     
    So the question is: does such library exist or the only way to do this is to make own fiters (for example complementary filter)?
    Maybe there is some MPU9150 library that can be used with MPU6050+magnetometer?
  12. Like
    Samellanak reacted to sharst in Is there a way to disable gyroscope drift compensation?   
    Hello,
     
    I'm using I2Cdevlib to read out the fused DMP data from an MPU-6050 breakout board, and I'm absolutely amazed at the amount of precision I get from such a low-cost sensor!
    I've got one problem though: I attached the sensor to a mobile robot, which sometimes moves in large circles, i.e. the gyroscope will register the same small turn velocity over a long period of time. During these periods, after ~8 seconds the yaw reading of the sensor stabilizes at some point and I don't get rotation updates anymore.
     
    From what I gathered from other posts, I assume that the DMP tries to cancel out gyro drift by subtracting any constant gyro reading that it gets from the next readings. I guess what happens is that the DMP thinks my slowly moving robot is actually the gyroscope drifting and tries to compensate. (I can actually see the yaw moving in the opposite direction for a short while when I stop the robot mid-turn.)
     
    So my question is: Is there some way I can turn off gyro drift compensation in the DMP? I can take care of slow drifts myself by measuring the gyro drift when I'm completely sure that the robot isn't moving. It would be a pity if I couldn't use this great sensor and library because I can't disable this feature.
     
    Thanks a lot for your responses,
     
    Simon
  13. Like
    Samellanak reacted to hatt0002 in velocity from acceleration   
    Hi, 

    I am currently doing a project in which I need to capture the acceleration of a pivoted rotating wooden beam. From the acceleration, I need to determine the velocity. 

    I am using Jeff's teapot sketch with the mpu6050 and I have managed to also include the acceleration in the teapotPacket to print acceleration in processing. I know that velocity is the first integral of acceleration. Such integral can be expressed as:
    v = u + AT, where v is the current velocity, u is the velocity before, A is the acceleration and T is a time interval.

    This is my code for the velocities in the three directions with sampling time of 1ms:
     
     vX = uX + (AX)*0.001; //vX = current velocity in the X direction, uX = velocity in the previous iteration, AX = acceleration in the x direc  uX = vX;                      //setting the current velocity as the previous velocity              vY = uY + (AY)*0.001;  uY = vY;                  vZ = uZ + (AZ)*0.001;  uZ = vZ;        If I move the sensor say in the x direction, acceleration in the x direction increases and when I stop the sensor, acceleration becomes negative and converges to zero, as expected. The velocity seems to be calculated and printed right when increasing from zero to a particular value. Now my problem is, that when I stop moving the sensor, velocity does not go back to zero when the sensor is stationary, but it decreases by a small amount only (say it stops decreasing at 0.5m/s. This gets worse when the sensor is moved faster. 

    It seems like the acceleration is read more than the deceleration (decreasing acceleration) and therefore, less negative values for acceleration are captured.    Can anybody help me?

    Thanks, Hatt
     
  14. Like
    Samellanak reacted to Julian.O. in MPU6050_DMP6 Sketch hangs randomly   
    Hello People,
     
    I have got a Problem with the MPU6050_DMP6 Code as it sometimes hangs when its running. It seems to stop randomly after some time and it makes no difference if i have the Arduino powered from USB, USB and Running Serial Monitor or from 9V Battery.
     
    I did minor changes to the code: Added Raw Values and Datalogging on a Micro SD Card with a Catalex Micro SD Adapter for Arduino and removed parts like TeaPot Demo and so one because i dont need them for my application. But i dont think this problem occus due to my changes because i think i saw this freezing also with the Basic MPU6050_DMP6 Code.
    I tried the Datalogging with SD-Library and SDFatLibrary but the Problem occured with both.
    The FIFO/DMP Rate is set to 25 Hz with 0x02,   0x16,   0x02,   0x00, 0x07                // D_0_22 inv_set_fifo_rate in the MPU6050_6Axis_MotionApps20 Library .h File because i had Fifo Overflow when runnig with 100Hz.
     
    Here is my sketch code:
     
    I added a Led on Pin 8 with indicates aktivity so i see the led stopping blinking once in a while when i run the code. If i have the serial monitor then it just stoppes writing new lines.
    Can somebody give me a hint why this happens and how it could be fixed? Or if somebody got a code for Datalogging Yaw Pitch and Roll Values + Raw Values Accelerometer and Gyroskop i would also appreciate very much!
    I also tried 2 differnet SDCards (one Class 10) and ther was no differnce...
    I really annoying because i want to log data and when it stops randomly and mostly after not more than 2 to 3 minutes the application is unreliable and useless....
    Greets Julian
     
  15. Like
    Samellanak reacted to _MeRKeZ_ in STM32F4 Discovery MPU6050 DMP   
    Hi friends,
     
    I'm building a quadcopter and I need sensor values. In order to get three angles -roll, pitch, yaw- I need to get DMP values. As I see, there is no STM library for mpu6050 dmp. What should I do? Is there any way to get three angles without dmp?
     
     
    Thank you
  16. Like
    Samellanak reacted to hassan ali in roll and pitch angles ranges   
    Hi everybody... I've been working on a project recently and i need to measure the roll and pitch angles of a moving platform, but the problem is that the value of these angles starts from 0 then reaches 90, then starts to decrease again to reach 0 (positive or negative 90 degrees of course) ... what i need to do is to have this value in the range of zero to 180 (positive or negative) not from zero to 90 as it is now ... do anyone have any idea??
  17. Like
    Samellanak reacted to hatt0002 in roll affecting yaw?   
    Hi friends,

    I have managed to read from two mpu6050 on DMP. Both sensors are fitted on a piece of board and are perfectly levelled. 
    My problem is that when I tilt the sensors such that I increase/decrease Roll, the Yaw is changed, even when the sensors are not rotated on the z axis. Is it normal that rolling affects yawing? Furthermore, the change in Yaw for both sensors is not the same, and there will be a difference in yaw of 8 deg between the two sensors for a 45deg rolling.

    Thanks in advance,
    Hatt
  18. Like
    Samellanak reacted to jlboygenius in Using two ADXL345s in a project   
    has anyone been able to run two adxl345s at the same time?
     
     
    I've setup two instances:
    ADXL345 accel(0x53);   ADXL345 accelB(0x1D);   and each runs the initialize function:
     accel.initialize(); accelB.initialize();         and:   Serial.println(accel.testConnection() ? "ADXL345 connection successful" : "ADXL345 connection failed");     Serial.println(accelB.testConnection() ? "ADXL345B connection successful" : "ADXL345B connection failed");        
     
     
    When both are connected, the arduio outputs on the serial:
    Init
     
    and that's it. just "Init".
     
    When only one is connected, data is retrieved for the working one, but only one can work at a time. I can read data from either one, but not both at the same time. One is wired with SDO high, to allow it to run on 0x1D, the other is wired to SDO low and runs on 0x53. 
     
    wiring: 
    Both are given grd, 3.3v,  Both SCL's are connected in parallel to A5, SDA to A4.
     
     
    Does the wiring need to be different? Can you run both at the same time?
     
     
  19. Like
    Samellanak reacted to luisrodenas in Arduino Sketch to automatically calculate MPU6050 offsets   
    I have made an Arduino sketch that simplifies the task of calibrating the MPU6050's offsets.
     
    Easy steps:
     
    - Wire your MPU6050 to your Arduino.
    - Put the MPU6050 as horizontal as possible and leave it there, don't touch it.
    - Check the sketch in order to configure your MPU's I2C address (0x68 or 0x69).
    - Upload the sketch to your Arduino.
    - Open Arduino serial monitor and send any character to the Arduino.
    - Wait.
    - Write down your offsets for that particular MPU6050 and use them with library's functions "...setoffset..." in your projects.
     
     
    There are also a few options in the code in case you want to fine tune it.
     
    There may be bugs, or maybe it does not converge for everyone, so let me know your experience.
    I use it with an Arduino DUE, configured to 400KHz I2C bus speed, but I think you can use any Arduino and standard bus speed (100KHz).
     
    If people find it useful maybe Jeff can add it to the library once it is bugfree.
     
    Happy new year.
     
    UPDATE 30th January:  New version 1.1 available. It fixes a bug related to variables overflowing in Arduinos other than the DUE.
    MPU6050_calibration_v1.1.zip
×
×
  • Create New...