Trouble connecting to MPU9150

I’m working on a two wheeled balancing robot and I’m having a little difficulty. Everything was working fine at first( for a day or so ) and now I’m having problems with my IMU (MPU-9150). Using my Arduino I’m able to connect to the IMU and get the readings from it just fine, however when I connect the battery pack and start running the motors I will lose connection to the IMU after a few seconds to a couple minutes, it’s somewhat random. Then even when I disconnect the battery pack I have to disconnect all power and wait a few minutes to be able to connect to it again.

I’m wondering if this is because I’m running the IMU, the motor driver (VNH5019 from Pololu), as well as a logic converter to read the motor encoder position from the same 3.3V line coming out of the Arduino. I don’t think I’m hitting the amp limit on the Arduino ( 130mA: but I’m assuming not much. This setup has worked, and does work for short periods of time.

Maybe the voltage is noisy and that’s messing with the IMU? On my breadboard I didn’t have these issues, but I also had a 10uF capacitor between the 3.3V line and ground near the IMU. I’ve moved the design to a protoboard, but left out the capacitor. Should I try adding this back in?

When I say I’m unable to connect to the IMU, I found some code online for 9 axis sensor fusion using the MPU 9150 (, at the beginning of each read it checks the I2C address (code readByte(MPU9150_ADDRESS, WHO_AM_I_MPU9150); // Read WHO_AM_I register for MPU-9150 ), and where it should be 0x68, the reading I’m getting is typically 0x01 or 0x00 when it stops working. I’m not sure if this is actually a problem, I don’t fully understand the I2C bus. Can I remove this restriction, will I still be able to get the readings from the sensors?

Any help would be appreciated.

Pictures of my setup:

Added in a .11 and 1uF capacitors near the sensor, and I’m still having issues. Also, the issues are presenting now without having the battery/motors connected. I’m guessing this is just a problem with my sensor then? I don’t have a second one to test with, any ideas?

Edit: On the upside. After adding in the capacitors I am able to restart quickly. Where before I would have to leave everything unplugged for a couple minutes before it would let me connect again, now it’s within a couple of seconds. I disconnect the battery, plug it back in and it will typically start working again. What would be causing this?


We moved your post to the general electronics section. If you are still having the problem with the motor disconnected, it sounds like it might be an issue between the Arduino and IMU. I recommend checking all your connections and seeing if anything changed when you moved it over to the protoboards.

I am not sure how the addition of a capacitor is affecting your IMU. You might try contacting the manufacturer, SparkFun, for additional assistance with that board.

- Jeremy