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: sparkfun.com/products/12009) 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 (github.com/kriswiner/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: imgur.com/a/Qu2cG