MPU 6050 I2C read rates using Netduino plus 2

The quadcopter will need to determine it’s orientation then update the thrust to be delivered by each motor many times a second. So I was interested to see how fast my Nedtduino plus 2 could read data from the MPU 6050 accelerometer & gyroscope. I stumbled across this blog and it appears that they are building a Quadcopter as well(Google translation was hard work to read).

There was also some very useful C# NetMF code which I used as the basis for my performance test harness.

10,000 readings of 16bit values from the Accelerometer (X,Y,Z) Gyroscope (X,Y,Z) and temperature sensor. The initial run didn’t look to positive

21.78, 21.77, 21.77, 21.77, 21.77, 21.77, 21.77,21.77,21.77,21.77 sec Avg 21.77

Which is roughly 460/sec

I then had a look at the I2C interface code and noticed that the bus speed was set to 100KHz so I increased it to 400KHz

10.33, 10.23, 10.23,10.23,10.23,10.23,10.23,10.23,10.72,10.23 Avg 10.29

Which is roughly 970/sec

I then had a look at the I2C interface code and changed the way that the register values were read so the array of registers to read didn’t have to be loaded.

8.55,8.57,8.55,8.57,8.55,8.57,8.57,8.57,8.55,8.57 Avg 8.56

I think 1170/sec should be sufficient, but I’m going to have a look at the Digital Motion Processor (DMP) capabilities of the MPU6050. This will require significant effort as there currently (June 2013) doesn’t appear to be any NetMF support for this approach.

10 thoughts on “MPU 6050 I2C read rates using Netduino plus 2

  1. Any way you would be able to share your solution with this breakout board.

    I’m having issues with connecting to devices through I2C on the netduino plus 2 and have no Idea what I am doing wrong.

    The i2c devices work as they will run on a standard arduino.

    Any help would be appriciated.

      • The only difference to mine is that I was connected to 3v pin with 10k Pullup resistors between the vcc and the 2 scl and sda lines.

        I have not had any luck with communication with any I2C device outside of arduino, when I connect the bus pirate to the circuit it does detect both devices on i2c.

        I also noticed that you don’t have any pull up resistors in your circuit, I thought they were needed to bring the voltage on the line to a known state.

        Most examples that I have found like the BMP085 example all fail on initial communication with the device.
        I have tried with pull up’s and without, triple checked the wiring. confirmed the device was working with an arduino.
        Found that the example was for a Netduino Plus not a Plus 2.

      • Hi,

        On holiday, back early next week.

        I’ll dig out my MPU 6050 board and get a really cut back demo working.

        Then I’ll send you the code to try on your Netduino 2

        Bryn

  2. Forgot to mention that I have this exact board along with a BMP085 among other i2c devices.

    Any help would be appreciated.

      • Sorry to hear about the damage, I’ve put it down for now due to other priorities.

        The wiring diagram I was going off of was from here. http://learn.adafruit.com/bmp085/wiring-the-bmp085. I was using the 5 and 4 for the clock and data lines. They should be the same line’s as the SC and SD pins.

        When I get back to it I will try these pins to see if that makes a difference.

        Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s