How to prevent interference between dc motor and arduino? It may be already asked question in somewhere but I am struggling!

I have a four wheel robot which I want to drive it to perform 90-degree left/right turn, I am using the MPU6050 3dof to get angles, however everything is ok when the DC motors are off and the readings from the MPU6050 are pretty good. 

But when the DC motors are on, the readings start to be increase randomly. I tried to use a different power supply to the DC motors and the Arduino, but with no solution. At the end when I reset the Arduino everything was back to be normal even if the DC motors are on!


Any help will be appreciated and I am open for any suggestion.
There are two basic things you need to do:


Use proper pullup resistors on your I2C lines (2.2kΩ) instead of relying on the (terrible) internal pullups of the ATMega
Add capacitors to the motors.


For point 2 you need two or three small ceramic capacitors (10nF to 100nF) per motor.


Connect one from each terminal to the motor's body
Optionally connect a third between the two terminals of the motor


This will reduce the EMI produced by the motor, and the improved pullups should reject EMI easier.

(Even if this doesn't entirely fix your underlying issue, it's certainly something that you should do regardless.)