Pages: [1]   Go Down
Author Topic: Gyro and acceleremeter in one [ADVICE]  (Read 786 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Cheers!

Oh, and here is the object ofcourse.
http://www.ebay.com/itm/MPU-6050-Triple-Axis-Accelerometer-Gyro-Breakout-for-AVR-ARM-MultiWii-MWC-KK-ACM-/200788217677?pt=LH_DefaultDomain_0&hash=item2ebfe90f4d
Logged

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

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.
Logged

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12194
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Cheers!
Logged

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

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).
http://arduino.cc/it/Reference/Wire

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.
Logged

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12194
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

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

... 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.
Logged

Pages: [1]   Go Up
Jump to: