I suggest you check your L298 with any other platform. You can test it with an Arduino. A sample code can be found below.
https://www.theengineeringprojects.com/ ... -l298.html
This approach will help you find out if your L298 itself is a faulty one or the problem is in your Raspberry Pi coding or setup.
If your L298 is proven to be OK, you can test it with the Raspberry Pi with a separate code and setup, disconnecting the MPU6050.
https://www.electronicshub.org/raspberr ... pberry-pi/
The reason behind this anomaly can be insufficient power. Your Raspberry Pi is powered by a power bank, but when the L298N starts operating, it may induce transient voltage drops or noise.
If possible, use a buck converter (like a 5V UBEC) https://www.adafruit.com/product/1385 instead of a power bank. Some power banks have unstable output under varying loads.
https://www.theengineeringprojects.com/ ... -l298.html
This approach will help you find out if your L298 itself is a faulty one or the problem is in your Raspberry Pi coding or setup.
If your L298 is proven to be OK, you can test it with the Raspberry Pi with a separate code and setup, disconnecting the MPU6050.
https://www.electronicshub.org/raspberr ... pberry-pi/
The reason behind this anomaly can be insufficient power. Your Raspberry Pi is powered by a power bank, but when the L298N starts operating, it may induce transient voltage drops or noise.
If possible, use a buck converter (like a 5V UBEC) https://www.adafruit.com/product/1385 instead of a power bank. Some power banks have unstable output under varying loads.
Statistics: Posted by ahsrabrifat — Sun Mar 09, 2025 5:08 pm