I have been trying to use MPU-6050 (specifically GY-521) with an Arduino Nano v3.0 but am not getting any readings when I try to power the MPU-6050 with the VCC and GND hooked up to digital pins on the Arduino.
When I have VCC and GND hooked to the 5V or 3V3 and GND on the Arduino, I am able to get readings from the gyro/accelerometer. When I hook them up to digital pins, I get readings but they are all zeros and even when the sensor is shaken the values stay at zero. The code I use in the settings for the digital pins is as follows:
pinMode(powerpin, OUTPUT);
pinMode(groundpin, OUTPUT);
digitalWrite(powerpin, HIGH);
digitalWrite(groundpin, LOW);
When I power an accelerometer, ADXL377, with the same pins, I get readings without a problem. Is this a problem with the amount of current that can be passed through the digital pins? Seems that the digital pins on the Nano can spit out at max 40mA and the MPU-6050 only needs like 3mA, so I am supposing the current is not a problem. Any help would be great.