简体   繁体   中英

reading raw data of MPU-9150 break board with Arduino micro

We are trying to connect the MPU-9150 break board to arduino micro and we have used the example code suggested in the sparkfun document ( https://github.com/sparkfun/MPU-9150_Breakout/tree/master/firmware ) to read the raw data. Our Vcc is always 3.3V. And our Baud rate is 9600. Here is what serial port monitor shows. all 9DOF values are zero

a/g/m: 0 0 0 0 0 0 0 0 0 
a/g/m: 0 0 0 0 0 0 0 0 0 
a/g/m: 0 0 0 0 0 0 0 0 0 
a/g/m: 0 0 0 0 0 0 0 0 0 
a/g/m: 0 0 0 0 0 0 0 0 0 …

When we use the code suggested in Arduino playground: http://playground.arduino.cc//Main/MPU-9150 Here is what we get. Now all values are -1

-1 -1 -1 -1 -1 -1 -1 -1 -1 
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1 
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1 
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1 
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1 
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1 
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1 

........ We are also pretty sure about the connections. We really have no idea where we are doing wrong. Vcc, GND, SCL and SDA are all connected. any comment would be appreciated.

I am having the exact same problem with the second code you mention (-1 -1 -1 ....)

I had other errors with the first one and couldn't get it working at all. (I'm very new to arduino programming so almost 100% certain it will be something I'm doing wrong).

However I did get older code related to your first example working as follows: [Using arduino uno connected gnd-gnd, vcc-3.3v, sda-A4 and scl-A5]

Download zip file from: https://github.com/sparkfun/MPU-9150_Breakout (zip file is on right hand side)

Unzip, copy folders I2Cdev & MPU6150 into C:.../users/.../documents/arduino/libraries/ (or similar as appropriate where libraries are kept)

Run Arduino

Open the program: MPU9150_raw and upload (it's found in MPU6150\\examples\\MPU9150_raw)

Open the Serial Monitor

Change baud rate to 36000

hopefully works!


I've recently also gotten the code at playground.arduino.cc//Main/MPU-9150 working with the Arduino Uno and the breakout board. If you are using the sparkfun breakout board I think you need to alter the code in two places to change the I2C address to 0x68 because AD0 on the board is pulled low rather than high. So you would search for int MPU9150_I2C_ADDRESS = 0x69; and change to 0x68 (It mentions this in the code so sorry if this is obvious to most people, just thought I'd post it anyway in case it helps someone else).

On the arduino webpage for the 6050 (I don't have enough reputation to post another link) it says

"The I2C-address depends on the AD0 pin of the sensor. If it is connected to ground, the >address is 0x68. If it is connected to VLOGIC (+3.3V) it is 0x69. There are a few sensor >boards with the MPU-6050 sensor already soldered on it. Some of those boards have a pull->down resistor at AD0 (address = 0x68), others have a pull-up resistor (address = 0x69)."

Same problem. Juste change the I2C adress of your device... Connect, AD0 to GND and cho

i have the mpu9150 also. this code gives me raw values for all three internal chips. double check your baud rates. good luck

https://github.com/sparkfun/MPU-9150_Breakout/blob/master/firmware/MPU6050/Examples/MPU9150_raw/MPU9150_raw.ino

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM