While I was experimenting with Arduino and SparkFun’s MPU6050, I came across the usual problem of Serial port being grayed out in Arduino IDE. Earlier I always ignored the problem and restarting the system used to work for majority of the time. This time however, I was determined to find a solution. After experimenting a bit I realized that this command works the best:
sudo usermod -a -G tty yourUserName
Well this works for Linux / Ubuntu users. If you are a Windows user, you may help yourself by erasing Windows completely and installing Linux.