Pages: [1] 2 3 4   Go Down
Author Topic: mpu6050 problem  (Read 12629 times)
0 Members and 1 Guest are viewing this topic.
Bologna
Offline Offline
God Member
*****
Karma: 6
Posts: 551
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hi everyone! I have a problem with the gyroscope-accelerometer MPU6050. I've just bought it from ebay: http://www.ebay.it/itm/280791436843?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649#ht_1890wt_1037 it's the drotech brekout board. When it arrived i soldered 6 pin headers on the board and next i put it on a bread board. I've connected +5v and the gnd pin to arduino, the SDA pin to A4 arduino's pin and the SCL to A5 arduino's pin. I've also uploated this sketch on the board http://playground.arduino.cc/Main/MPU-6050 but it send on the serial monitor only this
Code:
MPU-6050
Read accel, temp and gyro, error = 2
accel x,y,z: 747, 512, 12545
temperature: 24.459 degrees Celsius
gyro x,y,z : 520, 4557, 396,

MPU-6050
Read accel, temp and gyro, error = 2
accel x,y,z: -5374, 2, 305
temperature: 37.212 degrees Celsius
gyro x,y,z : 2050, -13039, -29695,

I hope you can understand the problem and help me to solve it! smiley-sad-blue
Logged

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

I never had to deal with errors. I just return them in case they occur.
I think error 2 is from Wire.endTransmission() and indicates that a NACK is received after the address is send.

It could be a bad connection on the bread board.

Can you try the i2c_scanner : http://playground.arduino.cc//Main/I2cScanner
Let it run for a while to see if it always can detect your sensor.

On the backside is a solder pad for PULLUP. I can't see in the photo if that is connected. It seems to connect the two 10k resistors to the 3.3V. You need those pull-up resistors.
Logged

Bologna
Offline Offline
God Member
*****
Karma: 6
Posts: 551
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for this so fast replay. I found a back image of the sensor Board. I don't see any resistor and you?
« Last Edit: January 13, 2013, 01:47:15 pm by SUBSEA » Logged

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

It seems to connect the two 10k resistors ON THE COMPONENT SIDE to the 3.3V.
Logged

Bologna
Offline Offline
God Member
*****
Karma: 6
Posts: 551
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Mmmmh... What does " on the component side" mean? Do i connect the resistors on the breadboard?
Logged

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

Component side : http://en.wikipedia.org/wiki/Printed_circuit_board
Logged

Bologna
Offline Offline
God Member
*****
Karma: 6
Posts: 551
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So I must solder the resistor on the board? I can't pur them on the breadboard?
« Last Edit: January 14, 2013, 11:56:06 am by SUBSEA » Logged

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

The resistors are already on the component side. The two smd components with "103" on them (10k resistors). I don't know if the solder pads with the label "PULLUP" are connected.

Did you run the i2c_scanner ?
Logged

Bologna
Offline Offline
God Member
*****
Karma: 6
Posts: 551
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, now I've understood, thank you. I'll run the i2c tester as fast asse I can.  smiley
Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 71
Posts: 2615
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

On the eBay page you supplied there is a link to some github code https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/Examples/MPU6050_DMP6/MPU6050_DMP6.ino
Does it work as expected using this code instead of the code you downloaded from the playground?
Logged


Bologna
Offline Offline
God Member
*****
Karma: 6
Posts: 551
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Also with this code the problem is the same: the arduino doesn't recognize the board... I'm start thinking that the board is broken... smiley-roll  Maybe I fused it when I soldered the pin header on the board. Is possible that I heat up too much the mpu? Or maybe that I touched one of the resistor whit the welding and I broke it? Later I' ll do the i2c scanner.
Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 71
Posts: 2615
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also with this code the problem is the same: the arduino doesn't recognize the board... I'm start thinking that the board is broken... smiley-roll  Maybe I fused it when I soldered the pin header on the board. Is possible that I heat up too much the mpu? Or maybe that I touched one of the resistor whit the welding and I broke it? Later I' ll do the i2c scanner.
Once you have run the I2C scanner you will know if the board is responding and if it does then confirm the example sketch your using has the correct I2C device address.
Logged


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

I have been using wire.h I2C scanner with the MPU6050 and also get no response.

Looking at the clock and data signal on a scope the MPU6050 does respond with an ACK but wire is not reporting it.  The scanner does a 8 bit clock for all other addresses but extends this to 16 bits for the 0x68 as the hardware sees the address ACK and also gets a data ACK.

On my Raspberry pi the i2cdevice 0 scanner finds the 0x68 ok.

With I2Cdev.h on the Due it also finds the mpu6050 si It looks like a problem with the wire.h driver ?? . See forum "MPU-6050 errors reading data" on how to use the i2cdev
Logged

Bologna
Offline Offline
God Member
*****
Karma: 6
Posts: 551
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone! I've just solved my problem! I've ran the i2c scanner and I have found like i2c address 0x69. Now I' m reading on the serial monitor this
Code:
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: -2120, 108, 17856
temperature: 20.224 degrees Celsius
gyro x,y,z : 236, -164, -98,
I don't understand what this values mean... The acceleration on the z axis should't be 1? And also the other values are strange... Maybe I need to calibrate the sensor. How can I do this?
Logged

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

That's why I added my own measurements to that page : http://playground.arduino.cc/Main/MPU-6050#measurements

Your values seem okay. If you want to know what they mean, you have to read the datasheet about bits and range.
For serious use, you can now move on to use the library by Jeff Rowberg. But you have to connect the INT to Arduino digital pin 2.
Logged

Pages: [1] 2 3 4   Go Up
Jump to: