PWM-ENABLE driver motor not working for 2 motors?

Discussion in 'General Electronics Chat' started by Nagbbaba Khasakali, Feb 9, 2015.

  1. Nagbbaba Khasakali

    Thread Starter New Member

    Feb 9, 2015
    2
    0
    So i have an L298N dual H bridge motor driver, which can drive 2 motors at max.

    What do I want to achieve? control the speeds of each motor separately. Google suggests I connect each enable pin from the driver to a PWM pin on my Arduino board (UNO R3). IT WORKS for ONE (1) motor. But when I use TWO (2) motors and try to control the speeds separately like so:

    analogWrite(ENALEFT, 255); // 100% speed
    analogWrite(ENARIGHT, 125); // 50% speed

    it doesn't work....
     
  2. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    You didn't show the circuit and pcb or breadboard.
     
  3. Nagbbaba Khasakali

    Thread Starter New Member

    Feb 9, 2015
    2
    0
    well to show the previous breadboard wirings... here it is (attached below).

    I however resorted to using PWMs for all the motor terminals and disconnected the driver enable pins from the arduino board. It now works.
     
Loading...