Hi there ,
This is my first project using Arduino :
I followed all the steps , the motor is running but I have some questions and I hope you can help me.
1- While connecting my adruino uno to my computer , the motor runs but the batteries have no effect at all !
I even unplugged the 2 wires from the breadboard and the motor kept running !
So , what is the role of the batteries ?
2- I tried to unplug the arduino form the computer to see if I can run the motor without being connected to the pc , and I used a 9 v batteries and I connected the 4 AA batteries to the breadboard.
BUT in htis case , the motor didn't even start.
Would you please help me and explain to me what is the role of the 4 AA batteries and how can I run the motor without being connected to the PC.
Thank you in advance.
The battories are the power supply for the motor. An Arduino most often does not have enough capacity. Disconnecting the battories might overload the Arduino and damage it.
Ok , I will keep the batteries plugged , but why the 9 V battery doesn't power the adrduino to make the motor running?
Generally it is preferable not to power the Arduino from the motor battory because the motor might send disturbance into the Arduino.
I know , in the project i added its link in my first post , there are 2 sources of power , one connected to the breadboard for the motor ( 4 batteries ) and the Second is from my computer to the arduino using a usb connection .
Now if I want to run everything without being connected to a computer, I used a 9 v batteries and connected it to the arduino , so we still have 2 power sources , BUT in that case nothing works .
my question is why it doesn't work.
9V block batteries are totally unsuitable for motors. They are used for smoke alarms.
so what is the best way to power the arduino in this case ?
Brick power supplies, or AA battery packs will work for both Arduino and small motors.
Motors should be powered separately, as they cause electrical noise that can reset or damage an Arduino. Don't forget to connect the grounds, or the motor won't work.
how many AA batteries do I need ? 4 as the I use for the motor part ?
also can I use a mobile power bank ?
The Arduino requires 7-12V through the barrel jack. 5 or 6 AA would work.
The voltage required for the motor depends on the motor, but 4AA should work with most small ones.
Thank you very much sir for your help.
I will test it and if I had any issues , is it ok to ask you again ?
Have a nice day