Arduino Forum

Using Arduino => Sensors => Topic started by: mb387 on Feb 01, 2012, 04:05 pm

Title: MPU-6050
Post by: mb387 on Feb 01, 2012, 04:05 pm
Hi all,
I got a MPU-6050 from invensense from the guys at drotek http://www.drotek.fr/shop/en/42-mpu6050-gyro-accelerometer.html (http://www.drotek.fr/shop/en/42-mpu6050-gyro-accelerometer.html) and I haven't been able to get anything out of that chip, not even an address with this I2C scanner http://todbot.com/arduino/sketches/I2CScanner/I2CScanner.pde (http://todbot.com/arduino/sketches/I2CScanner/I2CScanner.pde).
I have set it up using the sparkfun logic level converter http://www.sparkfun.com/products/8745 (http://www.sparkfun.com/products/8745), using both TX pin pairs for sda and scl. The level converter has built in pull-up resistors and I can measure 5v on the sda and scl pins on the arduino. The MPU is powered by the arduino 3.3v pin.
Aside from a faulty/fried device, what could cause me not to see the chip at all on the i2c bus?
I am new to all this and any help is very much appreciated, thank you.
Title: Re: MPU-6050
Post by: mb387 on Feb 01, 2012, 06:37 pm
Beginner`s mistake! For future reference, I was able to make my setup work by using shorter wires that have lower gauge.
Title: Re: MPU-6050
Post by: evsc on Feb 02, 2012, 11:18 pm
Oh yes? How short / thick do the wires have to be? And how long did you have them in the first place?

Considering buying the MPU-6050 drotek board myself, so it's good to hear you got it running. Found some other reports online, that they actually send it out with a wrong chip mounted on it: http://www.varesano.net/blog/fabio/mpu6050-finally (http://www.varesano.net/blog/fabio/mpu6050-finally)
Title: Re: MPU-6050
Post by: mb387 on Feb 03, 2012, 04:11 am
Hi,
yes I saw those reports too so I made sure I checked the chip when I got it.
Originally I was using the sparkfun jumper wires that come with the arduino kit they sell http://www.sparkfun.com/products/11026 (http://www.sparkfun.com/products/11026), I had no idea this could make a difference. Now it`s hooked up using 22 gauge wire http://www.robotshop.com/ca/elenco-22-gauge-green-25-ft-1.html (http://www.robotshop.com/ca/elenco-22-gauge-green-25-ft-1.html). As for the length of the cable, the setup looks like this now (bit messy)

(http://imguh.com/?di=QGV0)

Good luck with your project!
Title: Re: MPU-6050
Post by: evsc on Feb 03, 2012, 06:50 pm
Maybe one of the jumper wires was faulty.
Hard to believe that they would make a big difference.

I was more anticipating that you had first used a meter-long wire or so .. :)
Title: Re: MPU-6050
Post by: woodstock on Jun 22, 2012, 07:55 pm
Hi,
I would like to buy a "MPU-6050 Module 3 Axis Gyroscope+?Accelerome?ter" but I don't understand what is the different between this

http://i.ebayimg.com/t/MPU-6050-Module-3-Axis-Gyroscope-Accelerometer-Module-Arduino-DIY-/00/s/NjEzWDY2Mg==/$(KGrHqFHJCsE-nCC9g)KBPqyl+QOo!~~60_35.JPG

and this

http://inmotion.pt/blog/wp-content/uploads/2012/05/Triple_Axis_Accelerometer_Gyro_Breakout_MPU_6050.jpg

I have seen that there are 8pins on the first and 10pins on the second...  Can you help me?

Thaks!!!
Title: Re: MPU-6050
Post by: Krodal on Jun 22, 2012, 08:17 pm
Hello Woodstock,

You started a new question on an old post. For this you could better start a new post.
I have made a page for the MPU-6050 : http://arduino.cc/playground/Main/MPU-6050

You have to check the datasheet, to check which the signal lines on the pins of the boards.

Title: Re: MPU-6050
Post by: woodstock on Jul 19, 2012, 03:43 pm
Sorry for my late reply...

Ok Krodal, thank you for the link.
Title: Re: MPU-6050
Post by: IvanDeft on Jul 29, 2012, 04:07 am
Hello everyone! I,m from Russia and sorry for english at first! )
I have some problems with my MPU6050 (Sparkfun edition) htts://www.sparkfun.com/products/11028 (http://htts://www.sparkfun.com/products/11028)
I connect SCL on the board to A5 and SDA to A4 inputs with pull-up resistors (10k or 4,7k) on Ardruino MEGA. GND to Ground & VDD to 3,3V.
But I2C Scanner didn't find my MPU6050 board.
What i do wrong????!!!!
Please Help ME! ((ß
Title: Re: MPU-6050
Post by: Krodal on Jul 29, 2012, 08:46 am
You have a Arduino Mega : http://arduino.cc/en/Main/ArduinoBoardMega/
The SDA and SCL are pin 20 and 21.
Title: Re: MPU-6050
Post by: IvanDeft on Jul 29, 2012, 10:02 am

You have a Arduino Mega : http://arduino.cc/en/Main/ArduinoBoardMega/
The SDA and SCL are pin 20 and 21.


Thank you!! ))) I forgot it!
But on 20-21 SDA/SCL don't work too!!! (((
Maybe i must change some options more on mega???

But i try to catch I2C signal from ASCL / ASDA pins on the board, and when i try it - program immediately hangs (stopped on "Scanning" step)... What does matter maybe??
Title: Re: MPU-6050
Post by: Krodal on Jul 30, 2012, 07:03 am
Is this your sensor board : https://www.sparkfun.com/products/11028
If the I2C can't continue, perhaps something is keeping the line low. You might have mixed up the SDA and SCL, or the pull-up resistors are missing, or you use very long wires, or you accidently used ASCL and ASDA (which are for a second sub-i2c bus), or the voltage is wrong, or de sensor is damaged, or something else.
Title: Re: MPU-6050
Post by: woodstock on Jul 31, 2012, 04:33 pm
Hi
please, can someone post an image with the links between MPU6050 (htts://www.sparkfun.com/products/11028) and arduino?? Because I don't understand how and if I must add the 4.7K resistors. I read some post regard MPU6050 but someone use the resistors and other don't... example in this post --> arduino.cc/forum/index.php/topic,103408.0.html

Thank you so much!

Title: Re: MPU-6050
Post by: Krodal on Jul 31, 2012, 06:45 pm
The first picture in this page shows how : http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter

But the Sparkfun breakout board has already 10k pull-up resistors.
You don't really need extra pull-up resistors, but 4k7 is better than 10k. So you could add two 10k pull-up resistors (10k parallel 10k becomes 5k).
But that's just an improvement. The breakout board should work if those 10k on the breakout board are soldered properly.
Title: Re: MPU-6050
Post by: julianpe on Dec 23, 2016, 06:15 pm
Hello everyone,

I found this thread because I use the MPU 6050 and a Arduino Nano.
Therefore I use Jeff Rowbergs I2Ccdevlib for handling data of the MPU6050.

Currently I'm using this sketch:
https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/examples/MPU6050_DMP6/MPU6050_DMP6.ino

In the first 20 seconds after startig, the sensor values are floating a little bit. After that time the sensor values are nearly constant. I want to show the values on a serial monitor only if they are constant (after the 20 seconds). Which program codes do I have to keep in the void loop function?

I want this behaviour [PSEUDOCODE]

WHILE (SensorValuesCalibrating)
{
    //DO NOTHING
}

// NOW SENSOR VALUES ARE CONSTANT
// DO OTHER STUFF