Pages: [1]   Go Down
Author Topic: Breakout - MPU-6050 SEN-11028 wiring  (Read 5258 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I have the Triple Axis Accelerometer & Gyro Breakout - MPU-6050

something similar to this:
https://www.sparkfun.com/products/11028


I have download the zip file from here:
https://github.com/jrowberg/i2cdevlib/zipball/master
Opened the example file MPU605_DMP6 which is 6axis gyroscope and Accelerometer.
the code is uploaded to the board without any error.

the board has following pins
5V
3V3
GND
SCL
SDA
INT
SYNC
CLK
ASCL
ASDA


Used the following code but did not find any guide about the board on how to connect it to arduino.
Would someone please tell me except 5v, 3.3v and GND I don't know which Arduino pin to connect to?
I have soldered the board to the

The system didn't allow me to post the code (too long) so here is the code.
Text file: http://equaser.com/arduino/images/MPU6050_DMP6.txt

I am thinking to be connect the MPU-6050 board to Arduino and then read the x, y,z orientation and acceleration.
so Questions are :
  • How to connect the pin from the gyro board to Arduino uno?
  • Then where do I get the values for the x, y, z for orientation and acceleration?

* MPU6050_DMP6.ino (14.79 KB - downloaded 33 times.)
« Last Edit: August 23, 2012, 01:37:27 pm by barnamah » Logged

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

you only need to connect either 5v or 3.3v, and not both. then gnd, sdc and scl. you also need to disable the use of internal pullup in wire library.
Logged

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

I didn't know this breakout board.
They seem to be the cheapest ones on Ebay.
R1 and R2 are the pull-up resistors, but I don't know what the value is.

I have made this page : http://arduino.cc/playground/Main/MPU-6050
It is easier to start with that sketch.
I have added your breakout board as "no name breakout board".
But first you should have the I2C connected, and run the i2c_scanner : http://arduino.cc/playground/Main/I2cScanner

Your board has a 3.3V voltage regulator on the breakout board, so if you connect the +5V of the Arduino to the +5V of the breakout board, it will make its own 3.3V.
Connect the ground.
Connect SDA to Arduino A4 (analog input 4 is Arduino's SDA).
Connect SCL to Arduion A5 (analog input 5 is Arduino's SCL).
Run the i2c_scanner and see if it can be found.
« Last Edit: August 23, 2012, 05:59:09 pm by Krodal » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you Krodal,
I did run the I2C scanner and it found the device

------------------ result ---------------
I2C Scanner
Scanning...
I2C device found at address 0x68 !
done
--------------------- result end ------------

 and then I run the code from the playground: http://arduino.cc/playground/Main/MPU-6050#boards

and here is the readout:

--------------------- serial port monitor start -------------
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: -200, -2188, 16080
temperature: 27.471 degrees Celsius
gyro x,y,z : 129, 42, -206,

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: -88, -2256, 16012
temperature: 27.329 degrees Celsius
gyro x,y,z : 119, 61, -198,
--------------------- serial port monitor end -------------

and every time it shows different values.

so what is wrong and and how can I correct it.

thank you
« Last Edit: August 24, 2012, 11:16:20 am by barnamah » Logged

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

Read the section "Measurements" on that page : http://arduino.cc/playground/Main/MPU-6050#measurements
So your values are okay. But you need some filtering or averaging in software.

For the libraries of Jeff Rowberg, you have to connect 'INT' to pin 2 (INT0).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you Krodal,
I did connect the pin INT to A2. Is it correct?

I read the "measurement". do you mean to read for an interval of let's say 500ms 10 times and average it?

Also I tried this code: https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/Examples/MPU6050_DMP6/MPU6050_DMP6.ino
and  undocumented the two lines:
Code:
#define OUTPUT_READABLE_QUATERNION

// uncomment "OUTPUT_READABLE_EULER" if you want to see Euler angles
// (in degrees) calculated from the quaternions coming from the FIFO.
// Note that Euler angles suffer from gimbal lock (for more info, see
// http://en.wikipedia.org/wiki/Gimbal_lock)
#define OUTPUT_READABLE_EULER

and I get this "P├┐├
Logged

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

INT0 is digital pin 2.
http://arduino.cc/en/Hacking/PinMapping168

About filtering, you should read this : http://arduino.cc/forum/index.php/topic,58048.0.html
But that's only for raw values. I haven't tried that myself.

But Jeff Rowberg's library uses filtering I think.
I don't undestand your question, it looks like this:


* Schermafdruk van 2012-08-25 00:30:47.png (2.99 KB, 218x68 - viewed 43 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What I meant was when I run the above sketch, the serial monitor shows this:

"P├┐´┐Ż

which is unreadable.

Any ways is there a shield or breakout board to have just x, y,z pins for gyro and  x, y,z pins for acceleration?

thanks
Logged

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

That looks as if the baudrate is wrong.

There are analog sensors. With those you connect x,y,z to three analog inputs. With an analog gyro and an analog accelerator you need 6 analog input.
But that would not change anything.......
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I followed all the instruction but still have no success connecting Sparkfun MPU 6050 breakout board with Arduino Uno R3.
Steps I followed-
Copied "I2Cdev" and "MPU6050" folder form  https://github.com/jrowberg/i2cdevlib into libraries
 Wiring-
VDD --> 3.3V
VIO -->  3.3V
GND --> GND
SDA  --> A4
SCL --> A5

then copy pasted the http://playground.arduino.cc/Main/I2cScanner#.Uxhpp3Wx0yB   i2c scanner script but it says no connection found..
could someone tell what am I doing wrong?
Logged

Pages: [1]   Go Up
Jump to: