So ive been trying to make a balance robot with 2 dc motors using an L298N and MPU6050.
I have a very simple code that gets the tilt numbers and rotates the motors according to that data.
But when i connect L298N(with motors connected to it) to my arduino nano, the mpu6050's tilt data just stops. I mean i cant even see it on the serial monitor. It just stops. I have checked the sensor and its led stays on all the time. But when i connect the l298n, it runs ok for about 2 seconds and then the data stops flowing.
Notes : Im using a 12v 4.5A external power supply for the project. I ve also tried separating arduino and motor drivers power supply's but it didnt help.
What am i supposed to do at this point to get constant data from the MPU6050 ?