Go Down

Topic: Gyro and acceleremeter in one [ADVICE] (Read 1 time) previous topic - next topic


Hello peeps,

Ive been looking around for some gyro sensor, but on the path I found something better. A gyro combined with an accelerometer.
But my question about this piece is, do you know if the outputs are separate (gyro for its own, and accelerometer for its own).
I dont really know what some of the outputs means, lol.

Because I want to start with the gyro, and then advance and combine the two of em together to get more accurate numbers.

And do I need other piece of electronics, or is it just plug and go?


Oh, and here is the object ofcourse.


There is a page for that sensor: http://arduino.cc/playground/Main/MPU-6050

Yes, you can use the gyro values, or the accelerometer values, or you can combine them.

You need pull up resistors of 4k7 to use the I2C-bus (SDA and SCL), and I can't see if they are alread on the board.

Any questions about that MPU-6050 page, just ask.


The device includes pull-up resistors - check out the sparkfun page http://www.sparkfun.com/products/11028.

Note the MPU6050 is a 3.3V device, the breakout board needs its supply connected to 3V3, not 5V
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


I took a look into that page 2, but I wanst really sure if that was any pullup res. But now I do know ofcourse, so thats clear now =)

So what you are saying is that, I cannot connect it directly to the arduino board?
What if Ill change the PWM (or PPM?) so that the pins doesnt output more that 3.3V? I dont really know what Im talking about hehe but is it possible?
If not, what do I need?

And, I checked arduinos playground page for the MPU, it didnt give me much instead the code down confused me.
Ive read some datasheets about the MPU, but still Im not getting answers on how to make it work with arduino.

Ive seen that ppl only uses two digital pins and one analog pin. For the outputs.

I havnt recieved the item yet, so I cant really test things out. But Id like to gather information so that Im ready to just plug it and go along, without messing things up.


Most Arduino boards have a 3.3V regulator on board. The pin that says "3.3V" on your Arduino board is an output. You can use that for the sensor.

To read and write the registers of the sensor, you need the I2C-bus. This bus uses two pins: SDA and SCL. This is a digital bus. The SDA and SCL happen to use analog input pins 4 and 5 (although the I2C-bus is digital and not analog).

If you look the three bottom functions in my code at: http://arduino.cc/playground/Main/MPU-6050
You will see that they implement the I2C-communication to the sensor, using the Wire library. You don't have to know how I2C works, you can use those three functions.


Indeed - and its important that when using the I2C bus to a 3V3 device that any pull-ups are to 3.3V, not to 5V.  That board has 10k pull-ups to its own supply rail (which must be 3.3V) if you look at the schematic provided by SparkFun.

And of course you must not enable the SCL or SDA as outputs and pull them HIGH - the I2C library is careful to avoid that and drives them as open-drain outputs (never actively pulled-up).  Just rely on the I2C (Wire) library.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


... the I2C library is careful to avoid that and drives them as open-drain outputs (never actively pulled-up)...

MarkT, are you sure ?
I wrote a whole section here : http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter
The Wire library (mistakenly) enables the internal pull-up resistors. But with external pull-up resistors of 4k7 to the 3.3V everything should be fine.

Go Up