0

I set up this circuit which uses L293D motor driver IC to control two DC motors.

LM298D motor driver

+6V input is connected to unregulated power supply. It's current rating is 500 mA.

There is a connection between Arduino's ground line and power supplies ground line. There is a parallel 0.1 uF capacitor connected between motor terminal pins.

There is a wheel at the end of the motors but they don't have a gearbox. The wheels are suspended so that they can rotate freely.

The source code of the software is as follows.

#include <Arduino.h>

unsigned int firstMotorPositive = 8;
unsigned int firstMotorNegative = 7;
unsigned int enableFirstMotor = 9;
unsigned int secondMotorPositive = 5;
unsigned int secondMotorNegative = 4;
unsigned int enableSecondMotor = 3;

void setup()
{
    pinMode(firstMotorPositive, OUTPUT);
    pinMode(secondMotorPositive, OUTPUT);
    pinMode(enableFirstMotor, OUTPUT);
    pinMode(secondMotorPositive, OUTPUT);
    pinMode(secondMotorNegative, OUTPUT);
    pinMode(enableSecondMotor, OUTPUT);

    // All motors are off
    digitalWrite(firstMotorPositive, LOW);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, LOW);
    digitalWrite(secondMotorNegative, LOW);
}

void speedControl()
{
    digitalWrite(firstMotorPositive, HIGH);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, HIGH);
    digitalWrite(secondMotorNegative, LOW);

    for (int i = 0; i < 10; ++i)
    {
        for (int i = 200; i < 255; ++i)
        {
            analogWrite(enableFirstMotor, i);
            analogWrite(enableSecondMotor, i);
            delay(20);
        }
    }

    // All motors are off
    digitalWrite(firstMotorPositive, LOW);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, LOW);
    digitalWrite(secondMotorNegative, LOW);
}

void loop()
{
      speedControl();
      delay(1000);
}

The problem is they need help to start rotating. They will only start rotating if I physically twist the shaft with my fingers first.

As far as I know the motors used in this circuit are two 6 volt DC motors.

When I measure the maximum voltage between motor terminals I read about 0.5 volts. If I twist the shaft I read about 4.5 volts.

It is interesting that, if I connect a small 1.5 volt battery between motor terminals they spin.

  • 2
    already asked at https://arduino.stackexchange.com/questions/79548/l293d-driver-dc-motors-need-help-to-start-rotating – jsotola Nov 23 '20 at 21:23
  • 1
    Do not repost questions you've already posted in the SE network. Also see the several existing questions here explaining why Darlington drivers such as the L293/L298 are **horrible choices** for low voltage, recognize that putting a wheel directly on such a motor is unworkable, and also pay attention to the fact that your code seems to be repeatedly and nonsensically turning the motor on and off each time through the loop *outside* of whatever PWM you were hoping for with the analogWrite() – Chris Stratton Nov 23 '20 at 21:26
  • Ok thanks. I asked it here because I thought that this question might be less Arduino and more electronics. –  Nov 23 '20 at 21:34
  • 1
    [Read this about how crappy they are on low voltage supplies](https://electronics.stackexchange.com/questions/108686/l293-l298-and-sn754410-h-bridge-drivers-on-low-voltage-power-supply) – Andy aka Nov 23 '20 at 22:43

0 Answers0