Pages: [1]   Go Down
Author Topic: MPU 6050 Breakout board [HELP]  (Read 2886 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Howdie guys,

Recieved my mpu board today, so Im trying to make it work right now but without any luck.

Here is the board:
https://www.sparkfun.com/products/11028?

Here is the schematics:
http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/IMU/MPU-6050_Breakout%20V11.pdf

As you can see on the schematic pullup resistors are connected to SCL and SDA.


Wirings:
VDD  - 3.3V
GND - GND
SCL - A5
SDA - A4
VI0 - 3.3V

The I2C scanner was from here
http://arduino.cc/playground/Main/I2cScanner

This is the result when running the code
Quote
I2C Scanner
Scanning...
No I2C devices found
What am I doing wrong?
« Last Edit: July 27, 2012, 12:44:43 pm by freak174 » Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What am I doing wrong?

Nothing, as far as I can tell.

Can you measure the voltages on the board. Perhaps some connection is not good.
Which Arduino board are you using (I'm guessing an Arduino Uno).
You could upload a photo of how it is connected.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here are some readings from the voltmeter:
GND - VDD ~ 3.3V
GND - VI0  ~ 3.3v
GND - SCL ~ -5V
GND - SDA ~ -5V



And here is a photo of the wirings,
Red > VDD, VI0 - 3.3V
White > GND - GND
Green > SCL - A5
Blue > SDA - A4



Edit:
My bad, my bad! I soldered em. I was so sure that everything was connected and solid without the soldering.
Quote
Scanning...
I2C device found at address 0x68 !
done

Atleast ppl can learn from my misstake, DO NOT TAKE THINGS FOR GRANTED! hehe
« Last Edit: July 28, 2012, 06:12:46 am by freak174 » Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice!

There is one thing with the I2C, the SCL and SDA should be high 3.3V.
A 4k7 pull-up resistor is normal, so you could add two 4k7 pull-up resistors to the 3.3V.
But since there is already 10k on the breakout board, you could add two 10k pull-up resistors to the 3.3V.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What could happen if Id skip that part?

Do you mean that one 10k pullup res for the VI0 and one for VDD ?

-And do you know any page I can read about the values that it outputs?
- Are these 6 axis enough to stabilize a rc plane, or do you need all the 9 axis with the magnetometer?

Cheers
« Last Edit: July 28, 2012, 07:00:54 am by freak174 » Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I ment a resistor from the SDA to 3.3V, and a resistor from SCL to 3.3V.
If you choose 10k resistors, they will be parallel to the resistors on the breakout board. So the result will be 5k on both I2C lines.

In this page is some information about it: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter

The magnetometer is needed for earth location/orientation.
For balancing, the 6 axis (3 gyro, 3 accel) are good.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

Yesterday I took my time to make some readings from the sensor. I made a notice, the x value increases or decreases (one of them only). It keeps changing by decimal only, but it doesnt stop. Why? (raw values, sketch from Krodal).

I also tried out a sketch from Jeff Rowberg, getting the values in degrees instead (yaw, pitch,roll).
The yaw value doesnt even start at zero, and also does the same as described above (and yes, i use the interrupt pin with this sketch).

Also the pitch and roll isnt at zero degrees even its laid to be like that.

Cheers
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you show a number of values ?
The sensor is 16-bit and very sensitive. If I put it on the table, the computer on my table causes vibrations (which I don't feel) that makes the values noisy/jitter. If I place the sensor on concreet, the values still do that, but not as much.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is absolutely something wrong!

Krodals sketch (RAW VALUES):


Jeff Rowbers sketch (degrees, YAW PITCH ROLL):
« Last Edit: August 01, 2012, 12:48:52 pm by freak174 » Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The raw values of my sketch look good.
The raw values do change, that's why some filtering or averaging is always needed.
So I guess that Jeff Rowbergs values are also good.

The gyro drifts, the accellerator jitters, it's all normal. Remember they are 16-bits values, a change of 50 is very little.

But the Jeff Rowberg library needs an interrupt.
The FIFO of the sensor is only read by the Arduino if the sensor signals an interrupt to the Arduino.
I think that the library uses INT0, pin 2.
http://arduino.cc/it/Hacking/PinMapping168
So you have to connect the 'INT' of the sensor breakout board to pin 2 of the Arduino.

So nothing is wrong, you are getting there.
« Last Edit: August 01, 2012, 01:30:45 pm by Krodal » Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I see, well it seems to be working out. I just have to let it for like 10 seconds and the values goes to the way they are supposed to be.

However, I tried to add this line (just for testing) but god damn it freaks out.
The value jumps up and down, and then getting stuck at last. From like 60 degrees to 30, then to 0 and so on.
Im using Jeffs sketch, just took the parts I was interrested in.
Any clue why this is happening? Is it cause its using interrupts?
Code:
if(yaw > 1){
      YawServo.write(180);
      //delay(15);
    }
    else{
      YawServo.write(0);
      //delay(15);
    }

Could I use your sketch to convert the values into degrees?

Cheers
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To test it, you could use delays of 500ms.
Without the delays the servo gets the jitter, and the jitter is positioning it between 0 and 180.

Use my libraries? I don't know.
You need this guide, but that's still too complicated for me : http://arduino.cc/forum/index.php/topic,58048.0.html

You could reduce the sensitivity. In my sketch with writing to a register of the sensor, or with the functions of the Jeff Rowberg library.

You are not the only one that wondered about the raw values, so I added my own measurements from my sketch to the page about the MPU-6050: http://arduino.cc/playground/Main/MPU-6050 (in the "Measurements" section).
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the link provided, Ill take a deeper look at it when Im back from work.

However, about the servos. I made it very unclear what I actually meant. The degrees from the sensor is jumping, and then the script totally stops.

Cheers
Logged

SF Bay area
Offline Offline
Sr. Member
****
Karma: 3
Posts: 268
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you need to edit the wire library to remove the use of internal pullups.

comment out lines 76 and 77 in twi.c

  // activate internal pullups for twi.
  digitalWrite(SDA, 1);
  digitalWrite(SCL, 1);

then you should see the pin voltage closer to 3.3v.
Logged

Pages: [1]   Go Up
Jump to: