L298P - How to detect current on motor

Hello, I'm using this board for a car project. https://wiki.keyestudio.com/KS0412_keyestudio_L298P_Shield I've programmed it to automatically drive around the house and turn around if it detects obstacles with an ultrasonic distance sensor.

However, that sensor is not always the best, and sometimes the car runs into objects anyway.

I think that if the car runs into something the motors will now be at maximum current. Is there any way with the shield I posted above to read the current Current from the motor?

If I could monitor that value, I could turn the car around when we detect maximum load.

Thanks!

No, there is no option to read the motor current. However, the L298P is ancient and very inefficient, wasting about half the battery power as heat, so you are better off switching to a modern, much more efficient motor driver that does allow you to monitor the current.

Pololu has the best selection. This one should work, or two of these, one for each motor.

I think if you included bump detectors using spring loaded switches that would be much easier to implement. The usual microswitch is spring loaded to return to the normal connection is the bump is released!

You can add a small current sensing resistor in series. But not really handy as gnd of ic will not be gnd of rest of circuit anymore...