# Bizzare motor behavior

**URL:** <https://forum.arduino.cc/t/bizzare-motor-behavior/1347814>\
**Category:** General Electronics\
**Created:** [January 28, 2025, 2:21am UTC](https://forum.arduino.cc/t/bizzare-motor-behavior/1347814 "2025-01-28T02:21:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![daultimateboss](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/daultimateboss/32/1128987_2.png) [@daultimateboss](https://forum.arduino.cc/u/daultimateboss)\
**Post date:** [January 28, 2025, 2:21am UTC](https://forum.arduino.cc/t/bizzare-motor-behavior/1347814/1 "2025-01-28T02:21:29Z")

</div>

Hey all,

I followed the following connection schematic for a dc motor with an H-bridge

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/d/d/b/ddbced0e1e9995212ccc01926273cc7c03a5bd83.png)

My connection is below.

 ![motor_connection2](https://europe1.discourse-cdn.com/arduino/original/4X/1/5/5/155caad076fb9066f85445f1745889e7c2568a76.jpeg)  
 ![motor_connection](https://europe1.discourse-cdn.com/arduino/original/4X/b/c/4/bc4a6dc802fcf6ae308ff64a66f221cfe307be32.jpeg)

This is the following code I am running

```arduino
//www.elegoo.com
//2016.12.12

/ ************************
Exercise the motor using
the L293D chip
************************ /

#define ENABLE 5
#define DIRA 3
#define DIRB 4

int i;
 
void setup() {
  //---set pin direction
  pinMode(ENABLE,OUTPUT);
  pinMode(DIRA,OUTPUT);
  pinMode(DIRB,OUTPUT);
  Serial.begin(9600);
}

void loop() {
  //---back and forth example
    Serial.println("One way, then reverse");
    digitalWrite(ENABLE,HIGH); // enable on
    for (i=0;i<5;i++) {
      digitalWrite(DIRA,HIGH); //one way
      digitalWrite(DIRB,LOW);
      delay(500);
      digitalWrite(DIRA,LOW); //reverse
      digitalWrite(DIRB,HIGH);
      delay(500);
  }
  digitalWrite(ENABLE,LOW); // disable
  delay(2000);

}
   

```

I have videos of whats going on but it seems we cant upload videos. If that is necessary maybe I could upload them to youtube and link them.

I have not connected a battery to the breadboard power supply unit however the motor begins to turn (ie the program runs) though its slow. When i connect the battery it is faster.

Could someone please suggest what could be wrong with my connection or what could be causing the issue?

Edit: I think i can redefine my problem. Why could the motor run when pin 8 on the L293D is not connected to a battery?

---

<div class="post-metadata">

**Author:** ![van\_der\_decken](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/van_der_decken/32/1006976_2.png) [@van\_der\_decken](https://forum.arduino.cc/u/van_der_decken)\
**Post date:** [January 28, 2025, 2:30am UTC](https://forum.arduino.cc/t/bizzare-motor-behavior/1347814/2 "2025-01-28T02:30:35Z")

</div>

![image](https://europe1.discourse-cdn.com/arduino/original/4X/3/a/2/3a2bf88d9e8c0769cfadb210cc914e5ce5cab701.png)

---

<div class="post-metadata">

**Author:** ![daultimateboss](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/daultimateboss/32/1128987_2.png) [@daultimateboss](https://forum.arduino.cc/u/daultimateboss)\
**Post date:** [January 28, 2025, 2:33am UTC](https://forum.arduino.cc/t/bizzare-motor-behavior/1347814/3 "2025-01-28T02:33:48Z")

</div>

If im understanding your reply, is it that pin 16 on the L293D should be connected to 5V on the arduino?

If so, I tried that and have just tried it again, unfortunately gives the same result

---

<div class="post-metadata">

**Author:** ![daultimateboss](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/daultimateboss/32/1128987_2.png) [@daultimateboss](https://forum.arduino.cc/u/daultimateboss)\
**Post date:** [January 28, 2025, 2:34am UTC](https://forum.arduino.cc/t/bizzare-motor-behavior/1347814/4 "2025-01-28T02:34:13Z")

</div>

Ah and also the ground connections on the other side too I have tried those

---

<div class="post-metadata">

**Author:** ![daultimateboss](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/daultimateboss/32/1128987_2.png) [@daultimateboss](https://forum.arduino.cc/u/daultimateboss)\
**Post date:** [January 28, 2025, 2:45am UTC](https://forum.arduino.cc/t/bizzare-motor-behavior/1347814/5 "2025-01-28T02:45:53Z")

</div>

Links to the behaviour im describing:

When battery is not connected

[![](https://europe1.discourse-cdn.com/arduino/original/4X/6/b/0/6b08c1350b4fd41774452868087124cd2e219b10.jpeg "Battery not connected") ](https://www.youtube.com/watch?v=Ur-pmfZi4Y8)

When battery connected

[![](https://europe1.discourse-cdn.com/arduino/original/4X/c/c/c/ccc11e82844d7c8ab0b8e733fc81252f181b1861.jpeg "Battery connected") ](https://www.youtube.com/watch?v=8-2o4pCowag)

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [January 28, 2025, 1:12pm UTC](https://forum.arduino.cc/t/bizzare-motor-behavior/1347814/6 "2025-01-28T13:12:38Z")

</div>

Please do not start multiple topics with the same subject.

> [@Motor Circuit not working](https://forum.arduino.cc/t/motor-circuit-not-working/1347788):
>
> Hey all, I tried setting up the circuit below on tinkercad, but unfortunately it isn't working Could you please have a look to suggest what I'm doing wrong? Thank you. // C++ code // int enable = 5; int dir1 = 4; int dir2 = 3; void setup() { //pinMode(enable, OUTPUT); pinMode(dir1, OUTPUT); pinMode(dir2, OUTPUT); } void loop() { //digitalWrite(enable, 1); digitalWrite(dir1, HIGH); digitalWrite(dir2, LOW); delay(5000); }

---

<div class="post-metadata">

**Author:** ![daultimateboss](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/daultimateboss/32/1128987_2.png) [@daultimateboss](https://forum.arduino.cc/u/daultimateboss)\
**Post date:** [January 28, 2025, 2:26pm UTC](https://forum.arduino.cc/t/bizzare-motor-behavior/1347814/7 "2025-01-28T14:26:32Z")

</div>

Please, I'd endear you to fully read both. That was a circuit I tried setting up on tinkercad (actually to see if i could use software to figure up the problem i describe in this post), and this is another problem entirely.

I found the issue to the other problem too.

However I am stumped here, though I will move on for now. If you could please offer any help I'd be grateful.

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 27, 2025, 2:26pm UTC](https://forum.arduino.cc/t/bizzare-motor-behavior/1347814/8 "2025-07-27T14:26:53Z")

</div>

Closed on July 27, 2025, 2:26pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
