Controlling Two Motors with feedback from an INA219 Current Sensor

Hi all,

I am a beginner user and I am planning a project in which I want to control two motors. I want to control the motors independently and not simultaneously. I would like to base the switching between Motor 1 and 2 on a current sensor reading from an INA219 and in certain scenarios for example if current stops flowing to Motor 1, programme switching to drive Motor 2. I am planning to use an L298N to drive the two motors independantly and code some if statements dependant on the current sensor readings from the INA219 in order to achieve this.

Does this sound feasible? I am open to other ways of achieving this. Thanks in advance for any replies just to note again I am a beginner!

Does this sound feasible?

Yes. It isn't clear what is drawing the current that you are measuring or how you intend to "control" the motor - change speed? Just make it spin? - but deciding which one to control is trivial.

PaulS:
Yes. It isn't clear what is drawing the current that you are measuring or how you intend to "control" the motor.

Hi Paul thanks for the quick reply I am glad this simple project seems feasible. So the idea is for current draw of Motor 1 to be measured and depending on the 'health' of Motor 1, Motor 2 will spin in place of Motor 1 if there was an issue present with Motor 1.

PaulS:
Just make it spin? - but deciding which one to control is trivial.

Yes that is the intention just to Spin the motors with presumably some basic ability to set the speed somewhere between 0 - Max in the code.

just to Spin the motors with presumably some basic ability to set the speed somewhere between 0 - Max in the code

So, not "just spin the motor". You do want to control its speed. Based on what? The current drawn by the other motor? The phase of the moon? The number of people in line at the ice cream counter?

If you only need to see if a motor is running or not, a few turns of the motor supply cable around a reed switch would be a simple alternative to INA219 sensor.
Naturally the number of turns would have to be worked out with any "low speed" current.