Go Down

Topic: GY-521 gyroscope/accelerometer breakout board (Read 34 times) previous topic - next topic

zincate

@Krodal: Have been reading the forum and am new to Arduino. I have the same problem with Mardec. Am working on a project that detects the position and force impact on a ball. Am getting these raw values from my Gy-521.

Read accel, temp and gyro, error = 0
accel x,y,z: 7804, -11208, -8428
temperature: 22.388 degrees Celsius
gyro x,y,z : -7661, -34745, 7669

How do i use this information to calculate the force, distance or position of the ball. Aniticipating your reply thanks

Emeka T

Krodal

You can read the datasheet for the sensitivity.

Or use the i2cdevlib and read about the functions. You still have to read the datasheet to understand how much 'g' the acceleration value is.
http://www.i2cdevlib.com/

About the distance and position, I don't know. Sorry. I never tried to calculate that.

taz8du29

Hi krodal,

I saw something wrong (or not ?) in your code : the gyro and accel values are inverted !
An example : when my GY-521 is on a flat surface, the "gyro" values are close to "0", and the "accel" ones are around 1.000-15.000, but if I move the module, the "gyro" values quickly go to 1500 before going back close to "0". during this time, "accel" values increased (or decreased, depending of the dirction I moved the module).

Can you take a look at this please, because your code is to complex for me ^^

thanks,
taz

PS: if my english is bad, that's normal, I'm a young french guy :)
Sh**ing unofficial Uno w/ Lcd + keypad display, ethernet non-official board, bluetooth non-official board & IR remote

michinyon

I don't think they are inverted,  I think you are misunderstanding what the values represent.

schrockstudio

I followed the plans you layer out , and I was getting readings yay!!!!
but then all of a sudden it just doesn't work :(
nothing.
I was getting readings that were totally responding as I would expect.
I was going to see if I could hook up another board, but before I could it halted any readings and when I press reset on the Arduino it reads:

MPU-6050
InvenSense MPU-6050
June 2012

and nothing else

If I pull the:
A4 and A5 from The SDA and SCL
it scrolls, but unresponsive:

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,

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,

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,

dang :( did I fry my chip somehow?

schrockstudio

I try another sensor and it scrolls

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 0, 0, 0
temperature: 36.506 degrees Celsius
gyro x,y,z : 0, 0, 0,

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 0, 0, 0
temperature: 36.506 degrees Celsius
gyro x,y,z : 0, 0, 0,

MPU-6050
InvenSense MPU-6050
June 2012
InvenSense MPU-6050
June 2012


then stops. and I attempted to reset twice :/

michinyon

If you are getting all those zeros,  your communication is not working.       And i don't believe that it is 36 celsius  in new orleans right now.

schrockstudio

I know... I'm researching why I am getting such insane readings right now... or none at all. it's a bit unsettling, it should be pretty straight forward...

michinyon

when the device is not moving,    then the accelerometer readings you see represent the direction of the gravitational force ( or the opposite of it ).

alfredjunior

@schrockstudio 
Managed to solve the error of all data is zero?
I have the same problem here.

omryofec

#25
Mar 05, 2014, 04:56 pm Last Edit: Mar 05, 2014, 05:18 pm by omryofec Reason: 1
hi,
we've tried using the I2C_Scanner suggested above and another one we found elsewhere but it can't seem to find the address of our Gyro(GY-5210, Nano ATmega328)

anyone knows what might be the problem?

BubbleGum

#26
Mar 16, 2014, 01:48 am Last Edit: Mar 16, 2014, 07:36 pm by BubbleGum Reason: 1

hi,
we've tried using the I2C_Scanner suggested above and another one we found elsewhere but it can't seem to find the address of our Gyro(GY-5210, Nano ATmega328)

anyone knows what might be the problem?


Hi! I can't see on the picture if the LED light on the gyroscope is lit up. My concern with your circuit is that you power up the gyroscope from Vin pin. Try to power it up from 5V pin instead. I don't have an Arduino now to check, but I suspect voltage might not be available on Vin pin when you power the Arduino from USB.

UPDATE: I think you need to use pins A4 and A5 instead of D4 and D5

michinyon

For I2C,   you need to the use the correct pins for I2c  for the model of Arduino board and chip that you have.  A4 and A5 is for I2c  on a Uno.   For a nano,  I don't know.  Look it up.

omryofec

the d4 d5 pins on nano are SCLK and SDATA so they are the correct ones.
but we've come to the conclusion that we might have burned the sensor cause it needs only 3.3V and not 5V :)
so now we're waiting for the new ones to arrive. we'll keep you posted :)

profgeof2000

I would like to find  a real schematic for this - so far I have had NO success - anyone know where I can find schematic
and bread board..  I  Have NO idea how this thing works.  Basically came in a large box - chip and connectors.  Not  even sure it is
a GY 521. looks like it - but no proof!   Glad I did not pay much for it- get you get what you pay for. Zip!

Go Up