Go Down

Topic: Arduino Micro with SN754410NE DIP-16 H Bridge (Read 1 time) previous topic - next topic

phthomps

Hi,

I'm using an Arduino Micro with an SN754410NE H Bridge and an IR Receiver connected to 1 motor, all powered by a single 2 AMP AC/DC adapter.
The purpose of the IR Receiver is to run the motor either forwards, backwards or stop depending on the button code received.

If I use 5V as the AC/DC input power(see diagram),then everything works great (except that the motor runs slow since it only gets 5v)
(Arduino: Vin=5V / H Bridge: Pin1=5v/Pin8=5v/Pin9=5v/Pin16=5v)

If I use 7v as the AC/DC input power (see diagram), then the motor starts to work erratically.
When the power comes on, or the Arduino is reset then sometimes the motor immediately starts on full speed in one direction and will not go in reverse.
(Arduino: Vin=7v / H Bridge: Pin1=5v/Pin8=7v/Pin9=5v/Pin16=5v)

Could you please take a look at my diagram and see what i'm doing wrong?  (The chip supports up to 36v)

In the code, the only thing i'm doing is setting the pinmode to 'OUTPUT'  and telling the motor to not move:

int motor_1_pins[] = {2, 3};

void setup()
{
  Serial.begin(9600);
  pinMode(motor_1_pins[0], OUTPUT);
  pinMode(motor_1_pins[1], OUTPUT);
  digitalWrite(motor_1_pins[0], LOW);
  digitalWrite(motor_1_pins[1], LOW);
}

Any help would be really appreciated!

Thanks in advance,
Paul

GaryWilkerson

Paul,

What drawing program do you use to create your attached drawing?  I normally use Visio; I've seen your program used and I really like the battery packs, breadboard and motor objects.

Any help would be appreciated.

Gary

GaryWilkerson

Paul,

Don't bother responding, I found it, Fritzing!.

Gary

LarryD

I have always made it a policy to always use a separate power supply for the controller and the motor!

Quote
If I use 7v as the AC/DC input power (see diagram), then the motor starts to work erratically.

I would first confirm the 7 volt power supply is not being pulled down too low.

Quote
SN754410NE H Bridge

This is rated at 1.2 amps 2 amps peak. How much current is drawn by the motor if you connect it directly to 7volts?

Is this all the code you have?
The way you have it in your schematic isn't the same as how you have it wired up!

phthomps

Hi,
Thanks for your help, regarding the motor it has the following stats:

Operating range: 4.5 - 15v
No Load Current 0.15 A
At Maximum Efficiency: 0.84 A

The power adapter puts out 7 volts at 2000ma, I have also tried a second one with 7,5v 2100ma with the same results.
I tried to measure the amps when the motor is connected directly to the power adapter but it seemed almost too low to measure (0.05).  Perhaps I did this wrong.

I have also tried two different h bridges but they do the same.

For the code, I removed most of it to try and identify the cause of the problem and can see that the issue happens the when I call the "pinMode(motor_1_pins[0], OUTPUT);" commands
Here is the code I am left with:

int motor_1_pins[] = {2, 3};
 
void setup()
{
  Serial.begin(9600);
  pinMode(motor_1_pins[0], OUTPUT);
  pinMode(motor_1_pins[1], OUTPUT);
  // Problem happens already here
  delay(100);
  motor_stop(motor_1_pins[0],motor_1_pins[1]);
}

//-------------------------------------------
//Stop motor
int motor_stop(int pina, int pinb)
{
  digitalWrite(pina, LOW);
  digitalWrite(pinb, LOW);
}
//-------------------------------------------

//Main Program
void loop()
{
}

Thanks!

Go Up