I’m using an L293D motor driver IC and the Arduino Uno R3 to control two 12V, 200 RPM DC motors (2~4Kgcm torque). I’ve attached the code and circuit. I wired the connections as per the circuit. (no extra components; simply connected the Arduino pins defined in the program to the ones shown in the picture)
The code has two functions - demoOne() & demoTwo(). demoOne() runs the two motors in one direction for 2 seconds and in the opposite direction for another 2 seconds. demoTwo() controls the two motors using PWM - 0 to 255 and back to 0.
demoOne() works perfectly fine. Both motors run in one direction for two seconds and reverse their direction in the next two secs. Problem is with demoTwo(). Only one of the motors follows PWM. The other simply runs at a constant speed.
I measured the voltages at the PWM pins of the Arduino Uno R3 using a multimeter. Without connections to the L293D IC, the voltages at the two pins are pulse width modulated. But when I wire the two pins to the IC, only one of those are pulse width modulated. The other simply reads 1.8volts. I tried using different PWM pins but no luck.
I tried driving the motors one at a time (defining only the pins needed to drive one motor) and they worked fine (their speeds were pulse width modulated). The problem arises when I try to drive the two motors at the same time.
I’ve been facing this issue for two to three days now and I tried searching solutions online but couldn’t find any. Please help me out. Thanks in advance.
MOTOR_driver_check.ino (2.12 KB)