EDIT - SOLUTION: Sending '0' to the power management (0x6B) register was the problem, as this is the asci character for zero, rather than the binary character. To correctly wake up the IMU, send 0, the binary character for 0, not '0', the asci character for zero. This solution was provided by jremington.
Hi, all!
I'm trying to read from five MPU6050's, specifically the GY-521 modules. However, the device is updating measurements extremely slowly. We're talking less than 1hz. I can read values from the register and send them through serial at an acceptable speed, but it takes a literal second for those values to change. In the meantime, it just keeps sending the same value, over and over. The interesting thing is that when I attach an MPU9250, the code works perfectly, even alongside the MPU6050's. Each value from the MPU9250 is a new, updated value.
I've tried updating the SMPLRT_DIV register, 0x19, and it seems to have no effect. in fact, this register also has no effect on the MPU9250, which makes me wonder if I'm using the register incorrectly. Also, I'm wondering if setting the PWR_MGMT register, 0x6B, to 0 is having some effect - but if it does, it's not affecting the MPU9250.
Here's the serial output that I'm working with. The middle (3rd) value of each line is an MPU9250. Notice that it changes each time, whereas the others only change infrequently.
<17198.67, 15703.79, 15978.93, 14820.22, 15008.79>
<17198.67, 15703.79, 16115.32, 14820.22, 15008.79>
<17198.67, 15703.79, 16057.18, 14820.22, 15008.79>
<17198.67, 15623.56, 15990.02, 14820.22, 15008.79>
<17198.67, 15623.56, 16043.09, 14820.22, 15008.79>
<17198.67, 15623.56, 16024.11, 14820.22, 15008.79>
<17198.67, 15623.56, 15975.18, 14820.22, 15008.79>
<17198.67, 15623.56, 16019.18, 14820.22, 15008.79>
<17198.67, 15623.56, 15970.61, 14820.22, 15008.79>
<17198.67, 15623.56, 16031.11, 14820.22, 15008.79>
<17198.67, 15623.56, 15957.02, 14820.22, 15008.79>
<17198.67, 15623.56, 15906.65, 14820.22, 15008.79>
<17198.67, 15623.56, 15969.58, 14820.22, 15008.79>
<17198.67, 15623.56, 15940.03, 14820.22, 15008.79>
The code for the setup is attached. The wiring is standard I2C, and I'm relatively sure it's correct because the MPU9250 works perfectly when replacing an MPU6050. Still, if you'd like to see it, I can upload a picture.
Anyone have any tips/tricks/suggestions on how to increase this sample rate? I'm not looking for anything extraordinary, even 60hz would be fine. Thanks a bunch! Your time is most appreciated.
Wind_Chimes_Testing.ino (10.1 KB)