Hi all. Some very novice questions here.
1-- I've made a nice arduino project that runs a small hobby motor, according to an online "for dummies" guide... a diode across the motor terminals, a transistor to switch the motor on and off, etc. The power source for everything was simply the Arduino 5v pin... no other power source.
... It works great. But when I changed the power source of the Arduino to no longer be the USB from my computer, and instead to be four AA batteries, I found that the motor wouldn't start -- just hiccuped and halted everything (even an LED part of my project would hiccup and remain off.)
... So I instead changed it to being six AA batteries, in serial of course, and the motor and everything worked just fine.
Here's my question. I understand that the arduino puts out 5v. But when I add together the AA batteries' voltages, it adds to 1.5 x 4 = 6v. Shouldn't that amount have been good enough? Or maybe the arduino PUTS OUT 5v but to run itself as well, it needs greater, I suppose? I think I'm way oversimplifying this. Can you tell me why 4 AA's wasn't enough and 6 AA's was just fine?
2-- Also, just a general question. I see that when my motor stops and starts, the LED in my project dims as the big draw on the power clearly causes that. (even the LEDs built into the arduino dim low and high based on the motor starting and stopping.) But what if I wanted to wire it so that the motor starting and stopping would not cause that dimming low and high? Is there a way to prevent that dimming by using ... a capacitor or something? Clearly showing my naivete.
Big thanks, I'm grateful for this learning.
Voltage is only part of the equation, you're not considering the current.
you really should not be powering the motor directly from the arduino as you should draw no more than 20mA from a single pin.
You can use the same supply to power both the arduino and the motor using the transistor to control the motor provided the supply has enough current capacity for both.
Here is a good tutorial: DC Motors
" I understand that the arduino puts out 5v."
The arduion does not put out 5V.
There are a couple options to power the arduino from external power sources.
- The USB port
- the 5v pin
- the 12v pin.
You should normally provide any load (such as a motor) with its own power (don’t try to take it from the arduion).
2-- Also, just a general question. I see that when my motor stops and starts, the LED in my project dims as the big draw on the power clearly causes that. (even the LEDs built into the arduino dim low and high based on the motor starting and stopping.)
The motor is drawing "too much" current from the batteries, or the batteries are weak. The battery voltage is dropping when you run the motor.
With 6 batteries, the voltage is dropping too but there's probably enough to keep 5V coming out of the Arduino's voltage regulator.
If you have a multimeter you may be able to measure the actual voltage from the batteries although if it's a short-term voltage drop, the meter may not show it accurately.
"But when I changed the power source of the Arduino to no longer be the USB from my computer, and instead to be four AA batteries, I found that the motor wouldn't start"
You didn't say where you hooked the four AA batteries to the arduino.
You didn't say if the voltage of each AA was 1.2v, 1.5v, or 3.7v .
AA battery is just a size, not a voltage indicator.
It is always a good idea to add extra capacitors. Especially if you are trying to run inductive loads from the small power available.
Hi all -- thanks for your info above.
To answer your questions above --
-- I am taking the power from the 6 batteries and putting it into the power-in jack that is on the side of my arduino Uno -- on the same side of the unit as USB, but instead it's one of those round plugs...
-- the batteries are 1.5v ... that's why I made my (probably too novice) comment that I thought when I used 1.5x4 that would come to 6v, and when I use 1.5x6, that would come to 9v...
... the "LEDs all go dim when the motor runs" even happens when I instead choose to power the arduino via the USB from my computer.
... I guess the main messages I am getting from you guys is the following, let me know if I am missing something:
(1) It is bad practice to power a motor right from the Arduino's own pins.
(2) It is current, not voltage, that is getting "over drawn" when I power a motor from the arduino's own pins. (regardless of whether the arduino itself is powered by USB, or batteries, or anything else.)
... BY THE WAY -- regarding lesson (1) above... if someday I build a robot, and I want the arduino and batteries to be self-contained casrried in the robot's chassis as it goes around on the floor... am I right that my robot would have two battery sets to serve those two purposes ... for example, first it would have four 1.5v AA's just to power the arduino board, and then a separate 4-6 1.5v AA's to power the motors?
THANKS again for your time --
It can be advantageous to have separate power supplies as it can make it easier to isolate the arduino from voltage spikes/dropouts and other noise caused by inductive loads(motors, solenoids etc.)
But it is not a requirement. There are many ways to protect the arduino when using the same power supply(diodes, capacitors etc.) The important thing is to supply the right voltage for each device.
and enough current at all times to keep all devices happy.
For example my friend has a larger robot powered by a 12v car battery that has 2 large motors and a couple small ones, an arduino plus several other things. But he carefully researched how much current was needed for each device and made sure the battery had enough current capacity to run everything for the desired length of time he wanted to get before needing charging (google Amp/hours) and also proper protection circuitry to keep them from interfering with each other.
Hope this helps,
In the case where you were using the USB, the USB was directly supplying
When you use the power jack, it goes through a diode and then a linear regulator.
The spec says you need a minimum of 7V at the power jack.
As for the LED dimming, as motor can draw a lot of instantaneous power
to start. It was most likely causing the linear regulator on the board to
shut down momentarily from over current.
It would seem this wasn't enough over current that is killed the execution
of the processor. Still, as others have mentioned you should not be using the
5V line of the board as though it was an unlimited power supply. Surely,
not to run a motor.
Since you have a transistor to drive the motor, you would be better to
run the motor directly from your battery pack ( assuming it is a lightly loaded
small motor. Otherwise, you should provide a completely new battery
pack just to run the motor.