# Motor doesn't rotate without computer connection

**URL:** <https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383>\
**Category:** Motors, Mechanics, Power and CNC\
**Created:** [May 24, 2023, 6:50am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383 "2023-05-24T06:50:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anandrew](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@anandrew](https://forum.arduino.cc/u/anandrew)\
**Post date:** [May 24, 2023, 6:50am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/1 "2023-05-24T06:50:13Z")

</div>

![1BUTTON1motor](https://europe1.discourse-cdn.com/arduino/original/4X/1/3/1/131e0177db8226d5a63c049f1d1c9cf71f1d098d.png)  
 ![SmartSelect_20230524_154706_Samsung Internet](https://europe1.discourse-cdn.com/arduino/original/4X/1/b/e/1bed89bd3902887bc1f8a42a4bcb28c0393307ec.jpeg)  
My 5v dc motor only rotate when the computer is connected to arduino.  
I want my motor rotate only with 9v battery, without connenction to computer  
What should I do?  
I am using a 9v battery. The Images uploaded is my code and circuit.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [May 24, 2023, 6:54am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/2 "2023-05-24T06:54:49Z")

</div>

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'  
  
Use **code tags** (the \< CODE/ \> icon above the compose window)&nbsp;to make it easier to read and copy for examination   
  
[https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum)

> [@anandrew](#):
>
> I am using a 9v battery.

Such a battery is not capable of supplying the required current to power the Arduino for long let alone a motor. Consider using an alternative source of power such as 6 AA cells in series

If you have a multimeter then measure the battery voltage when it is powering the project

---

<div class="post-metadata">

**Author:** ![anandrew](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@anandrew](https://forum.arduino.cc/u/anandrew)\
**Post date:** [May 24, 2023, 6:57am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/3 "2023-05-24T06:57:01Z")

</div>

This is kind of contest for my school. I am actually designing a ball shooter and the given rule is only to use 9v battery. Is there any kind of way to solve it?

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [May 24, 2023, 6:59am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/4 "2023-05-24T06:59:37Z")

</div>

What is the exact wording of the rules ?

Do the rules state that you must use a 9V battery of that type ? To my mind, 6 AA cells in series constitutes a 9V battery

---

<div class="post-metadata">

**Author:** ![anandrew](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@anandrew](https://forum.arduino.cc/u/anandrew)\
**Post date:** [May 24, 2023, 7:04am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/5 "2023-05-24T07:04:24Z")

</div>

the rule says 'the students should make ball shooter only with provided stuff(part)' and professor said this consist the 9v battery so I can't use other kind of battery.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [May 24, 2023, 7:10am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/6 "2023-05-24T07:10:24Z")

</div>

Are you sure that is the type of battery that will be provided ? With luck a fresh battery will last for a few minutes

---

<div class="post-metadata">

**Author:** ![anandrew](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@anandrew](https://forum.arduino.cc/u/anandrew)\
**Post date:** [May 24, 2023, 7:15am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/7 "2023-05-24T07:15:36Z")

</div>

Yeah i amsure. I also changed my battery to new ones a few time but it still doesn't work

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [May 24, 2023, 7:23am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/8 "2023-05-24T07:23:21Z")

</div>

Looking at your picture, how is the Arduino powered when using the battery ?

---

<div class="post-metadata">

**Author:** ![anandrew](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@anandrew](https://forum.arduino.cc/u/anandrew)\
**Post date:** [May 24, 2023, 7:35am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/9 "2023-05-24T07:35:23Z")

</div>

I actually don know how but the light on arduino board in turned on when only the battery is connencted

---

<div class="post-metadata">

**Author:** ![2112](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/2112/32/1129664_2.png) [@2112](https://forum.arduino.cc/u/2112)\
**Post date:** [May 24, 2023, 9:27am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/10 "2023-05-24T09:27:35Z")

</div>

Connect +9V from battery to UNO Vin to power the UNO.

---

<div class="post-metadata">

**Author:** ![anandrew](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@anandrew](https://forum.arduino.cc/u/anandrew)\
**Post date:** [May 24, 2023, 10:20am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/11 "2023-05-24T10:20:00Z")

</div>

could you expalin more specifically?

2023년 5월 24일 (수) 오후 6:37, 2112 via Arduino Forum \<[notifications@arduino.discoursemail.com](mailto:notifications@arduino.discoursemail.com)\>님이 작성:

---

<div class="post-metadata">

**Author:** ![2112](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/2112/32/1129664_2.png) [@2112](https://forum.arduino.cc/u/2112)\
**Post date:** [May 24, 2023, 10:31am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/12 "2023-05-24T10:31:12Z")

</div>

> [@anandrew](#):
>
> could you expalin more specifically?

> [@anandrew](#):
>
> could you expalin more specifically?

Your UNO isn't getting power.  
The UNO uses the 5V from the USB port for power when you are plugged into the computer. The UNO needs power from somewhere when not plugged into the USB port. You give it that power by connecting the + side of your 9V battery to the VIN pin.

You connected 5V from UNO to the motor controller but there isn't 5V on that pin until you connect the battery to VIN.

---

<div class="post-metadata">

**Author:** ![anandrew](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@anandrew](https://forum.arduino.cc/u/anandrew)\
**Post date:** [May 24, 2023, 10:34am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/13 "2023-05-24T10:34:21Z")

</div>

Then should I use two battery?

---

<div class="post-metadata">

**Author:** ![2112](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/2112/32/1129664_2.png) [@2112](https://forum.arduino.cc/u/2112)\
**Post date:** [May 24, 2023, 10:41am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/14 "2023-05-24T10:41:42Z")

</div>

It would be better if you did use a second battery connected to VIN and GND to supply a clean supply voltage to the UNO.

For now, connect motor controller +12V to UNO VIN pin to see if it starts working.

---

<div class="post-metadata">

**Author:** ![anandrew](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@anandrew](https://forum.arduino.cc/u/anandrew)\
**Post date:** [May 24, 2023, 10:44am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/15 "2023-05-24T10:44:50Z")

</div>

Thanks. I will try it till tomorrow!

---

<div class="post-metadata">

**Author:** ![2112](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/2112/32/1129664_2.png) [@2112](https://forum.arduino.cc/u/2112)\
**Post date:** [May 24, 2023, 11:00am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/17 "2023-05-24T11:00:09Z")

</div>

~~ChatGPT just entered the room. I'm out!~~  
Thank you.  
That poor advice would have murdered his UNO

---

<div class="post-metadata">

**Author:** ![PerryBebbington](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/perrybebbington/32/238766_2.png) [@PerryBebbington](https://forum.arduino.cc/u/PerryBebbington)\
**Post date:** [May 24, 2023, 11:28am UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/18 "2023-05-24T11:28:27Z")

</div>

AI nonsense deleted.

---

<div class="post-metadata">

**Author:** ![2112](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/2112/32/1129664_2.png) [@2112](https://forum.arduino.cc/u/2112)\
**Post date:** [May 24, 2023, 12:04pm UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/19 "2023-05-24T12:04:32Z")

</div>

What exact L298N module are you using?  
Is there a jumper close to the 12V connector?  
Did they provide a schematic?  
Can you post a pic of the module?

You may of may not want to connect the +5V wire if you use a second battery to power the UNO.

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [May 24, 2023, 4:31pm UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/20 "2023-05-24T16:31:48Z")

</div>

Use a pingpong ball 🙂

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/3/8/e/38e0902db755b6ed250fab11f7d75fa40de61fad.jpeg)

* * *

### Give us a link to the motor driver.

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [May 24, 2023, 4:34pm UTC](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383/21 "2023-05-24T16:34:15Z")

</div>

Hi, @anandrew

Can you please post an image(s) of your project?

In particular the motor driver module, we need to see what it has on board, there are many versions of the 298 module.

Thanks... Tom.. 😀 👍 ☕ 🇦🇺

[Next page](https://forum.arduino.cc/t/motor-doesnt-rotate-without-computer-connection/1130383.md?page=2)
