I'm using a pi 4 for a rover I want to build and I have 2 L298N drivers. I connected them using a breadboard to my pi so I don't need that much GPIO pins but only one pair of motors is working and when I unplug the driver that works the second pair of motors on the second driver are working. can u pls help me, I already double triple quadruple whatever checked my cables and connections but I can't find the error isn't there enough power output?
The following two configurations work only one at a time:
(1) L298N Driver 1 (D1) works with motor pair (M1a + M1b).
(2) Similarly, D2 works with M2a + M2b.
There are a couple of possibilities, including:
(a) Motor power too weak. The 5V power from Rpi4B's 40 pin connector (pins 2, 4) might have a problem driving 4 motors. You might consider using an external power source, like a LiPo power bank (See Ref 2).
/to continue, ...
/ to continue, ...
Appendix A - How to check if batteries run out
You can use a multi-meter to check your battery power bank output.
For example, if (1) no motor running is 4.5V, (2) one battery is 3.0V, (3) two batteries is 2.0V, then it means your battery is too weak to drive two motors.
If you don't have a multi-meter, you can DIY a LED based battery status indicator as follows:
Connect a LED to series resistor, then connect one end of resistor to one end of battery power bank output, and one end of LED to the other end of battery power.
Now you can test your L298N driver again. If no motors, LED is bright, two motors LED is dim, 4 motors LED is very dim, then it is time to buy new batteries.