Pages: [1]   Go Down
Author Topic: GY-521 Accelerometer + Gyro  (Read 550 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, in past days i bought new GY-521 sensor.
After a while of trying to get it work, I finally received some data from it. I used sketch from the website : http://playground.arduino.cc/Main/MPU-6050
But i dont think everythink is working properly.

I added some lines to print out the registers which were read from the GY-521.
You can have a look at it here  : http://pastie.org/8125686
Here is what i get over serial from board : http://pastie.org/8125717

I dont know why is this happening ... u can see the that the gyro y value is not changing although the registers value is changing.
Also the temperature changes when i lean the device.
Logged

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I smell something fishy.

If you do everything in the normal way, it probably works.

Check with a magnifier if the chip is actually the MPU-6050.
Use a normal Arduino board, like the Arduino Uno or Nano or Mega or so.
Download the newest Arduino software. Version 1.0.5 at the moment. Download it in a new folder, so I don't get mixed up with old things.
Don't install any other libraries.
Use the Arduino 5V pin to power the GY-521 Vcc.
Run the sketch and it will work (I think).

Don't change the sketch and show the output from the beginning (with WHO_AM_I byte and so).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, but how to make it work with DUE, its operating on 3,3V.
Sketch was not changed i just added few lines to the output to see more info.
Logged

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The DUE had a problem with the return value of endTransmission.
I don't know the status of that bug at the moment.

Can you tell me where the reference for Wire.setModule() is ?

Do you have an other Arduino board ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have copy like due, ARM processor, operating voltage 3,3V
Wire.setModule just selects one of the I2C channels because my board have 4 of them.
Transmission is going good i can read who_am_i and receive 0x68.
Also i can read the registers with data like temp,accel,gyro but the numbers are little bit crazy :/ as you can see
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

[SOLVED]

http://pastie.org/8127043

Sensor working very well.
The board integer was 4 byte long so i chaned the int definition in union to int16_t.
Working clearly now.
Logged

Pages: [1]   Go Up
Jump to: