Offline
Sr. Member
Karma: 4
Posts: 388
|
 |
« on: January 13, 2013, 11:50:02 am » |
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 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! 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 9
Posts: 1003
|
 |
« Reply #1 on: January 13, 2013, 12:50:46 pm » |
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/I2cScannerLet 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
|
|
|
|
|
Offline
Sr. Member
Karma: 4
Posts: 388
|
 |
« Reply #2 on: January 13, 2013, 01:44:54 pm » |
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
Edison Member
Karma: 9
Posts: 1003
|
 |
« Reply #3 on: January 13, 2013, 02:08:26 pm » |
It seems to connect the two 10k resistors ON THE COMPONENT SIDE to the 3.3V.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 4
Posts: 388
|
 |
« Reply #4 on: January 14, 2013, 08:26:38 am » |
Mmmmh... What does " on the component side" mean? Do i connect the resistors on the breadboard?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 9
Posts: 1003
|
 |
« Reply #5 on: January 14, 2013, 10:21:19 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 4
Posts: 388
|
 |
« Reply #6 on: January 14, 2013, 11:41:28 am » |
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
Edison Member
Karma: 9
Posts: 1003
|
 |
« Reply #7 on: January 14, 2013, 12:11:11 pm » |
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
|
|
|
|
|
Offline
Sr. Member
Karma: 4
Posts: 388
|
 |
« Reply #8 on: January 14, 2013, 04:02:56 pm » |
Ok, now I've understood, thank you. I'll run the i2c tester as fast asse I can. 
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Offline
Sr. Member
Karma: 4
Posts: 388
|
 |
« Reply #10 on: January 15, 2013, 06:44:02 am » |
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...  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
Edison Member
Karma: 25
Posts: 1421
|
 |
« Reply #11 on: January 15, 2013, 06:56:20 am » |
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...  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
Newbie
Karma: 0
Posts: 1
|
 |
« Reply #12 on: January 16, 2013, 11:53:02 am » |
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
|
|
|
|
|
Offline
Sr. Member
Karma: 4
Posts: 388
|
 |
« Reply #13 on: January 21, 2013, 08:50:38 am » |
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 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
Edison Member
Karma: 9
Posts: 1003
|
 |
« Reply #14 on: January 21, 2013, 08:58:36 am » |
That's why I added my own measurements to that page : http://playground.arduino.cc/Main/MPU-6050#measurementsYour 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
|
|
|
|
|
|